:root {
    --ink: #1f1d24;
    --muted: #706c78;
    --line: #e1d9e7;
    --surface: #ffffff;
    --surface-alt: #f6f3ef;
    --surface-dark: #171617;
    --brand: #a893bf;
    --brand-strong: #7f6699;
    --accent: #f10d73;
    --accent-soft: #f4edf9;
    --radius: 6px;
    --shadow-soft: 0 12px 30px rgba(28, 24, 32, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--surface-alt);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

main {
    min-height: calc(100vh - 180px);
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-radius: var(--radius);
    font-weight: 750;
    letter-spacing: 0;
}

.btn-shop-primary,
.btn-success {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-strong);
    --bs-btn-hover-border-color: var(--brand-strong);
    --bs-btn-active-bg: var(--brand-strong);
    --bs-btn-active-border-color: var(--brand-strong);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    color: #fff;
}

.btn-shop-secondary,
.btn-outline-success {
    --bs-btn-color: var(--ink);
    --bs-btn-border-color: #d3c8de;
    --bs-btn-hover-bg: #f4eef8;
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-hover-color: var(--brand-strong);
    --bs-btn-active-bg: #f4eef8;
    --bs-btn-active-border-color: var(--brand);
    --bs-btn-active-color: var(--brand-strong);
    background: #fff;
}

.form-control,
.form-select {
    min-height: 2.8rem;
    border-color: #d7cfde;
    border-radius: var(--radius);
}

.form-control:focus,
.form-select:focus,
.filter-group input:focus,
.filter-group select:focus,
.catalog-sort select:focus,
.header-search input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem rgba(168, 147, 191, 0.16);
    outline: none;
}

.store-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--surface-dark);
    box-shadow: 0 12px 30px rgba(13, 12, 14, 0.24);
}

.store-header-inner {
    display: grid;
    grid-template-columns: auto auto auto minmax(280px, 1fr) auto auto;
    align-items: center;
    gap: 1rem;
    min-height: 86px;
}

.store-brand,
.header-shortcut,
.header-account,
.header-cart {
    color: #fff;
}

.store-brand:hover,
.header-shortcut:hover,
.header-account:hover,
.header-cart:hover,
.site-nav-links a:hover {
    color: #fff;
}

.store-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
}

.store-brand-mark {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    font-family: Georgia, serif;
    font-size: 2.1rem;
    line-height: 1;
}

.store-brand-copy {
    display: grid;
    gap: 0.08rem;
    line-height: 1.05;
}

.store-brand-copy strong {
    font-size: 1.1rem;
    font-weight: 800;
}

.store-brand-copy small {
    color: #cbc6d3;
    font-size: 0.82rem;
}

.header-shortcut {
    min-height: 52px;
    padding: 0 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    font-weight: 750;
}

.header-shortcut i,
.header-cart i {
    font-size: 1.55rem;
}

.header-location {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    min-width: 170px;
}

.header-location i {
    font-size: 1.45rem;
    color: #f0edf4;
}

.header-location small,
.header-account small {
    display: block;
    color: #cfcbd7;
    font-size: 0.82rem;
}

.header-location strong,
.header-account strong {
    display: block;
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.15;
}

.header-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 60px;
    overflow: hidden;
    border-radius: var(--radius);
    background: #fff;
}

.header-search input {
    width: 100%;
    min-width: 0;
    height: 52px;
    padding: 0 1.15rem;
    border: 0;
    color: #403c46;
    background: #fff;
}

.header-search button {
    height: 52px;
    border: 0;
    color: #fff;
    background: #5a565b;
}

.header-account {
    display: grid;
    gap: 0.08rem;
    min-width: 138px;
}

.header-cart {
    position: relative;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
}

.cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 1.45rem;
    height: 1.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.28rem;
    border-radius: 999px;
    color: #fff;
    background: var(--accent);
    font-size: 0.74rem;
    font-weight: 850;
}

.site-nav-collapse {
    background: #1c1a1d;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: 0.9rem 0;
}

.site-nav-links a {
    color: #ebe8ef;
    font-size: 0.94rem;
    font-weight: 700;
}

.flash-wrap {
    margin-top: 1rem;
}

.site-footer {
    margin-top: 4rem;
    padding: 1.35rem 0;
    background: #fff;
    border-top: 1px solid #e5deea;
}

.site-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
}

.site-footer-inner a {
    color: var(--brand-strong);
    font-weight: 700;
}

.catalog-overview {
    padding: 1.25rem 0 1.15rem;
    background: #faf8f5;
    border-bottom: 1px solid #e8e0ea;
}

.catalog-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
    color: #6e6a74;
    font-size: 0.95rem;
}

.catalog-breadcrumb a {
    color: #605c67;
}

.catalog-breadcrumb i {
    font-size: 0.75rem;
}

.catalog-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.catalog-summary {
    max-width: 780px;
}

.section-kicker {
    display: inline-block;
    color: var(--brand-strong);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0;
}

.catalog-summary h1,
.cart-heading h1,
.detail-info h1,
.page-heading h1 {
    margin: 0.35rem 0 0.55rem;
    font-weight: 850;
    line-height: 1.05;
    letter-spacing: 0;
}

.catalog-summary h1 {
    font-size: 2.2rem;
}

.catalog-summary p,
.cart-heading p,
.detail-info p {
    margin: 0;
    color: var(--muted);
    font-size: 1.03rem;
}

.catalog-summary p strong,
.catalog-summary p span {
    color: var(--ink);
    font-weight: 800;
}

.catalog-toolbar-controls {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.catalog-sort {
    display: grid;
    gap: 0.35rem;
    min-width: 270px;
}

.catalog-sort label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 850;
    text-transform: uppercase;
}

.catalog-sort select,
.filter-group input,
.filter-group select {
    width: 100%;
    min-height: 50px;
    padding: 0 0.9rem;
    border: 1px solid #d9d1df;
    border-radius: var(--radius);
    color: var(--ink);
    background: #fff;
}

.catalog-shell {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 1.5rem;
    padding-top: 1.5rem;
}

.catalog-sidebar {
    align-self: start;
}

.sidebar-panel {
    border: 1px solid #e3dce8;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-soft);
    padding: 1.3rem;
}

.catalog-sidebar .sidebar-panel + .sidebar-panel {
    margin-top: 1rem;
}

.sidebar-panel-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.sidebar-accent {
    width: 8px;
    min-width: 8px;
    height: 34px;
    margin-top: 0.15rem;
    background: var(--brand-strong);
}

.sidebar-panel-heading h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 850;
}

.sidebar-panel-heading p {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.sidebar-scroll {
    max-height: 450px;
    overflow: auto;
    padding-right: 0.3rem;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 8px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: #c7bfce;
    border-radius: 999px;
}

.category-link {
    display: block;
    padding: 0.75rem 0.85rem 0.75rem calc(0.85rem + (var(--level) * 0.95rem));
    border-left: 2px solid transparent;
    color: #3c3942;
    font-weight: 650;
}

.category-link:hover,
.category-link.active {
    background: #f5f1f8;
    color: var(--brand-strong);
    border-left-color: var(--brand-strong);
}

.filter-title {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.filter-title i {
    color: var(--brand-strong);
    font-size: 1.1rem;
}

.filter-title h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 850;
}

.filter-group {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.filter-group label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
}

.catalog-content {
    min-width: 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.product-card {
    display: flex;
    min-width: 0;
    min-height: 100%;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e0d9e4;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 8px 24px rgba(19, 17, 22, 0.06);
}

.product-media {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    padding: 1.3rem;
    background: #fff;
}

.product-media img,
.detail-media img,
.current-image img,
.admin-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0 1rem 0.4rem;
}

.product-highlight {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.55rem;
    border-radius: var(--radius);
    background: #edf0f5;
    color: #45424b;
    font-size: 0.75rem;
    font-weight: 780;
}

.product-highlight.muted {
    background: var(--accent-soft);
    color: var(--brand-strong);
}

.product-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 0 1rem 1rem;
}

.product-info h2 {
    min-height: 3rem;
    margin: 0 0 0.7rem;
    font-size: 1.05rem;
    line-height: 1.35;
    font-weight: 850;
}

.product-info h2 a {
    color: var(--ink);
}

.product-info p {
    display: -webkit-box;
    min-height: 4rem;
    margin: 0 0 1rem;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.45;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.product-price-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
}

.product-price {
    color: #141318;
    font-size: 1.7rem;
    font-weight: 900;
    line-height: 1;
}

.product-link {
    color: var(--brand-strong);
    font-size: 0.88rem;
    font-weight: 850;
}

.product-actions {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0 1rem 1rem;
}

.quantity-label {
    display: grid;
    gap: 0.25rem;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 850;
    text-transform: uppercase;
}

.quantity-input {
    min-height: 44px;
    text-align: center;
}

.product-actions .add-cart {
    grid-column: 1 / -1;
}

.breadcrumb-wrap {
    padding-top: 1.25rem;
}

.product-detail-shell {
    padding-top: 1rem;
    padding-bottom: 2rem;
}

.product-detail {
    display: grid;
    grid-template-columns: minmax(300px, 520px) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.detail-media {
    overflow: hidden;
    aspect-ratio: 1 / 1;
    padding: 1.5rem;
    border: 1px solid #e1dae7;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.detail-info {
    padding: 0.5rem 0;
}

.detail-info h1 {
    font-size: 2.2rem;
}

.detail-stats {
    display: grid;
    grid-template-columns: minmax(0, 248px);
    gap: 1rem;
    margin: 1.5rem 0;
}

.detail-stats div,
.cart-content,
.admin-table-wrap,
.admin-filter,
.form-section {
    border: 1px solid #e2dbe7;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.detail-stats div {
    padding: 1rem;
}

.detail-stats span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.detail-stats strong {
    display: block;
    margin-top: 0.2rem;
    color: var(--ink);
    font-size: 1.45rem;
}

.detail-actions {
    max-width: 520px;
}

.cart-shell {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.cart-heading {
    margin-bottom: 1.5rem;
}

.cart-table {
    margin: 0;
}

.cart-table th {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 850;
    text-transform: uppercase;
}

.cart-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-top: 1px solid #e5dfea;
}

.cart-summary span {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.cart-summary strong {
    color: var(--ink);
    font-size: 1.65rem;
}

.empty-state {
    padding: 3rem 1.2rem;
    border: 1px dashed #ccbfd7;
    border-radius: var(--radius);
    background: #fff;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.empty-state h1,
.empty-state h2 {
    margin-bottom: 0.6rem;
    font-weight: 850;
}

.empty-state p {
    color: var(--muted);
}

.admin-body {
    background: #f4f2f6;
}

.admin-navbar {
    background: #201a27;
}

.admin-main {
    min-height: calc(100vh - 58px);
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.stat-card {
    padding: 1.35rem;
    border: 1px solid #e2dbe7;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 750;
}

.stat-card strong {
    display: block;
    margin-top: 0.2rem;
    color: var(--ink);
    font-size: 2.2rem;
    line-height: 1;
}

.admin-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.admin-filter {
    max-width: 720px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.admin-table-wrap {
    overflow: hidden;
}

.admin-table-wrap .table {
    margin-bottom: 0;
}

.admin-thumb {
    width: 64px;
    height: 64px;
    padding: 0.25rem;
    border: 1px solid #e1dae7;
    border-radius: var(--radius);
    background: #fff;
}

.table-actions {
    display: inline-flex;
    justify-content: flex-end;
    gap: 0.45rem;
}

.table-actions form {
    margin: 0;
}

.admin-form {
    max-width: 1120px;
}

.admin-form.compact {
    max-width: 680px;
}

.form-section {
    padding: 1rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.current-image {
    display: grid;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.current-image img {
    aspect-ratio: 4 / 3;
    padding: 0.25rem;
    border: 1px solid #e1dae7;
    border-radius: var(--radius);
    background: #fff;
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: #f3eff7;
}

.auth-wrap {
    width: min(100%, 420px);
}

.auth-card {
    padding: 1.35rem;
    border: 1px solid #e2dbe7;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 18px 45px rgba(31, 24, 39, 0.12);
}

.auth-brand {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--brand-strong);
    font-weight: 900;
}

.auth-card h1 {
    margin-bottom: 1.2rem;
    font-size: 1.6rem;
    font-weight: 850;
}

@media (max-width: 1199.98px) {
    .store-header-inner {
        grid-template-columns: auto auto minmax(220px, 1fr) auto auto;
    }

    .header-location {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .store-header-inner {
        grid-template-columns: 1fr auto auto;
        gap: 0.85rem;
        padding: 0.9rem 0;
    }

    .header-shortcut {
        justify-self: end;
        padding: 0 0.8rem;
        border-left: 0;
    }

    .header-account {
        display: none;
    }

    .header-search {
        grid-column: 1 / -1;
        order: 5;
    }

    .catalog-shell,
    .product-detail {
        grid-template-columns: 1fr;
    }

    .catalog-sidebar {
        margin-bottom: 1rem;
    }

    .catalog-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .catalog-toolbar-controls {
        justify-content: space-between;
    }

    .catalog-sort {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .store-header-inner {
        grid-template-columns: 1fr auto;
    }

    .header-shortcut {
        order: 2;
    }

    .header-cart {
        order: 3;
    }

    .header-search {
        order: 4;
        grid-column: 1 / -1;
    }

    .catalog-overview {
        padding: 1rem 0;
    }

    .catalog-summary h1,
    .detail-info h1,
    .cart-heading h1,
    .page-heading h1 {
        font-size: 1.8rem;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .product-actions,
    .detail-actions {
        grid-template-columns: 1fr;
    }

    .product-actions .add-cart {
        grid-column: auto;
    }

    .detail-stats,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .cart-summary,
    .page-heading,
    .site-footer-inner,
    .catalog-toolbar-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .cart-summary .btn,
    .page-heading .btn,
    .catalog-mobile-trigger,
    .catalog-sort select {
        width: 100%;
    }

    .table-actions {
        flex-direction: column;
        width: 100%;
    }

    .table-actions .btn {
        width: 100%;
    }
}

@media (min-width: 992px) {
    .catalog-sidebar.collapse {
        display: block;
    }
}
