:root {
    --bg: #f3efe7;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-solid: #ffffff;
    --ink: #182126;
    --muted: #5f6972;
    --line: rgba(24, 33, 38, 0.12);
    --primary: #9a221c;
    --primary-dark: #721813;
    --primary-soft: rgba(154, 34, 28, 0.1);
    --accent: #d8c4a8;
    --sidebar: #182126;
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --shadow: 0 20px 60px rgba(24, 33, 38, 0.08);
    --radius: 24px;
    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(154, 34, 28, 0.08), transparent 30%),
        linear-gradient(180deg, #fbf8f2 0%, #f3efe7 100%);
}

body.menu-open {
    overflow: hidden;
}

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

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

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

main {
    min-height: 60vh;
}

.container {
    width: min(var(--container), calc(100% - 2rem));
    margin: 0 auto;
}

.desktop-only {
    display: flex;
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(24, 33, 38, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 40;
}

body.menu-open .mobile-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(18px);
    background: rgba(251, 248, 242, 0.92);
    border-bottom: 1px solid var(--line);
}

.sub-header {
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
}

.nav-shell,
.main-nav,
.sub-nav,
.brand,
.hero-actions,
.footer-bottom,
.panel-head,
.admin-topbar,
.contact-actions,
.filter-bar,
.action-stack,
.home-category-head,
.mobile-drawer-head,
.admin-mobile-bar {
    display: flex;
    align-items: center;
}

.nav-shell,
.admin-topbar,
.home-category-head {
    justify-content: space-between;
    gap: 1.25rem;
}

.nav-shell {
    padding: 1rem 0;
}

.sub-nav {
    gap: 1.1rem;
    padding: 0.9rem 0;
    overflow-x: auto;
}

.brand {
    gap: 0.9rem;
    min-width: 0;
}

.brand strong,
.section-heading h2,
.page-hero h1,
.hero-section h1,
.admin-topbar h1,
.detail-block h3,
.admin-panel h2,
.home-category-head h3 {
    font-family: 'Newsreader', serif;
}

.brand small {
    display: block;
    color: var(--muted);
    margin-top: 0.15rem;
}

.brand-mark,
.card-icon,
.placeholder-art {
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), #c3532d);
    color: #fff;
}

.brand-mark {
    width: 52px;
    height: 52px;
    font-weight: 800;
}

.brand-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    flex-shrink: 0;
}

.main-nav,
.sub-nav {
    justify-content: flex-end;
}

.main-nav a,
.sub-nav a,
.admin-nav a,
.text-link {
    color: var(--muted);
    transition: color 0.22s ease, transform 0.22s ease, background 0.22s ease;
}

.main-nav a:hover,
.sub-nav a:hover,
.admin-nav a:hover,
.text-link:hover {
    color: var(--primary);
    transform: translateY(-1px);
}

.main-nav a {
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.82);
}

.sub-nav a {
    white-space: nowrap;
    padding: 0.55rem 0.75rem;
    border-radius: 999px;
}

.sub-nav a:hover {
    background: var(--primary-soft);
}

.hamburger-btn,
.drawer-close {
    display: none;
    border: 0;
    cursor: pointer;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hamburger-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.8);
    flex-direction: column;
    justify-content: center;
    gap: 0.28rem;
}

.hamburger-btn span {
    width: 18px;
    height: 2px;
    background: var(--ink);
    border-radius: 999px;
    display: block;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100dvh;
    max-height: 100dvh;
    width: min(340px, 86vw);
    padding: 1.25rem;
    padding-bottom: 2rem;
    background: var(--surface-solid);
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 50;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    box-shadow: var(--shadow);
}

body.menu-open .mobile-drawer {
    transform: translateX(0);
}

.mobile-drawer-head {
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.drawer-close {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.7rem;
    line-height: 1;
    text-align: center;
}

.mobile-drawer-nav,
.admin-nav {
    display: grid;
    gap: 0.55rem;
}

.mobile-drawer-nav a {
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: #f7f3ec;
    font-weight: 600;
}

.mobile-nav-divider {
    height: 1px;
    background: var(--line);
    margin: 0.4rem 0;
}

.hero-section,
.page-hero {
    padding: 4.5rem 0 2rem;
}

.hero-grid,
.about-grid,
.product-detail-layout,
.contact-page-grid,
.admin-grid,
.footer-grid,
.contact-strip {
    display: grid;
    gap: 1.5rem;
}

.form-split {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
}

.hero-grid {
    grid-template-columns: 1.25fr 0.8fr;
    align-items: center;
}

.eyebrow,
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--primary);
}

.hero-section h1,
.page-hero h1 {
    font-size: clamp(2.9rem, 5vw, 4.9rem);
    line-height: 0.98;
    margin: 0.8rem 0 1rem;
}

.hero-section p,
.page-hero p,
.info-card p,
.product-copy p,
.detail-block p,
.site-footer p,
.helper-text {
    color: var(--muted);
    line-height: 1.72;
}

.hero-panel,
.stats-grid,
.thumb-grid,
.gallery-grid {
    display: grid;
    gap: 1rem;
}

.metric-card,
.info-card,
.product-card,
.detail-block,
.admin-panel,
.stat-card,
.thumb-card,
.empty-state,
.admin-login-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.metric-card,
.stat-card {
    padding: 1.4rem;
}

.metric-card strong,
.stat-card strong {
    display: block;
    font-size: 1.3rem;
    margin-bottom: 0.35rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.95rem 1.35rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

.hero-actions {
    gap: 1rem;
    flex-wrap: wrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(24, 33, 38, 0.08);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--ink);
    border-color: var(--line);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.84);
}

.section {
    padding: 2rem 0 4rem;
}

.section-muted {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.52));
}

.section-accent {
    padding-top: 0;
}

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

.section-heading h2,
.admin-topbar h1,
.detail-block h3,
.admin-panel h2 {
    margin: 0.4rem 0 0;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.home-category-head {
    margin: 0 0 1.1rem;
    flex-wrap: wrap;
}

.home-category-head h3 {
    margin: 0.3rem 0 0;
    font-size: clamp(1.5rem, 2vw, 2rem);
}

.home-category-block + .home-category-block {
    margin-top: 2.25rem;
}

.card-grid,
.product-grid {
    display: grid;
    gap: 1.3rem;
}

.card-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.homepage-product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.info-card,
.product-card,
.thumb-card {
    overflow: hidden;
}

.info-card,
.product-copy,
.detail-block,
.admin-panel,
.empty-state,
.contact-form,
.admin-form,
.admin-login-card {
    padding: 1.5rem;
}

.admin-form,
.admin-login-card,
.contact-form {
    display: grid;
    gap: 1rem;
}

.admin-form > .btn {
    margin-top: 0.5rem;
}

.card-icon {
    width: 64px;
    height: 64px;
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.product-card {
    display: grid;
    min-height: 100%;
}

.product-card-clickable {
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.product-card-clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 60px rgba(24, 33, 38, 0.12);
}

.card-link-btn {
    margin-top: 0.4rem;
    width: fit-content;
}

.product-copy h3,
.empty-state h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.product-copy p,
.empty-state p {
    margin-top: 0;
}

.product-visual,
.gallery-item {
    min-height: 230px;
    background: linear-gradient(135deg, rgba(216, 196, 168, 0.34), rgba(154, 34, 28, 0.08));
}

.gallery-button {
    width: 100%;
    padding: 0;
    border: 0;
    overflow: hidden;
    border-radius: 20px;
    cursor: zoom-in;
}

.product-visual img,
.gallery-item img,
.thumb-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-art {
    width: 100%;
    min-height: 230px;
    font-size: 4rem;
    font-weight: 800;
}

.placeholder-art.large {
    min-height: 420px;
}

.filter-bar,
.contact-strip {
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-bar {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(24, 33, 38, 0.08);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 1.5rem;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.86);
    color: var(--ink);
}

label {
    display: grid;
    gap: 0.45rem;
    font-weight: 600;
    min-width: 0;
}

.about-grid,
.contact-page-grid,
.product-detail-layout,
.footer-grid,
.contact-strip,
.admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-detail-layout {
    align-items: start;
}

.product-side-panel {
    display: grid;
    gap: 1rem;
}

.action-stack {
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}

.detail-list {
    margin: 0;
    padding-left: 1rem;
    color: var(--muted);
}

.detail-block h3 {
    margin-bottom: 0.8rem;
}

.detail-list li + li {
    margin-top: 0.45rem;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 80;
}

.lightbox[hidden] {
    display: none;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 18, 0.78);
}

.lightbox-dialog {
    position: relative;
    z-index: 1;
    width: min(1080px, calc(100% - 1.25rem));
    height: min(90dvh, 820px);
    margin: min(5dvh, 2rem) auto;
    padding: 1rem 4.5rem 1.25rem;
    border-radius: 28px;
    background: rgba(19, 25, 30, 0.96);
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 1rem;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.lightbox-figure {
    margin: 0;
    min-height: 0;
    display: grid;
    place-items: center;
}

.lightbox-figure img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 18px;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    border: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.7rem;
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 2rem;
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.lightbox-thumbs {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
}

.lightbox-thumb {
    width: 76px;
    height: 76px;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    padding: 0;
    flex: 0 0 auto;
}

.lightbox-thumb.active {
    border-color: #fff;
}

.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 2.5rem 0 1.25rem;
    background: rgba(255, 255, 255, 0.58);
}

.site-footer a {
    display: block;
    margin: 0.45rem 0;
    color: var(--muted);
}

.footer-logo {
    width: 78px;
    height: auto;
    object-fit: contain;
    display: block;
    margin-bottom: 0.9rem;
}

.site-footer h3,
.site-footer h4 {
    margin-top: 0;
    margin-bottom: 0.85rem;
}

.footer-bottom {
    justify-content: space-between;
    border-top: 1px solid var(--line);
    margin-top: 1.5rem;
    padding-top: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-credit {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    text-decoration: none;
    opacity: 0.92;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.footer-credit:hover {
    color: var(--primary);
    text-decoration: none;
    opacity: 1;
}

.legal-layout {
    display: grid;
    gap: 1.25rem;
}

.admin-body {
    background: linear-gradient(180deg, #ede7dd 0%, #f8f5ef 100%);
}

.admin-layout {
    display: grid;
    grid-template-columns: 270px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: linear-gradient(180deg, #182126 0%, #212d33 100%);
    color: #f3eee6;
    padding: 1.5rem;
    position: relative;
    z-index: 45;
}

.admin-brand small,
.admin-nav a {
    color: rgba(243, 238, 230, 0.74);
}

.admin-nav {
    margin-top: 2rem;
}

.admin-nav a {
    padding: 0.95rem 1rem;
    border-radius: 16px;
    font-weight: 700;
}

.admin-nav a:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
    transform: translateX(4px);
}

.admin-main {
    padding: 1.5rem;
}

.admin-panel .panel-head,
.admin-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 1rem;
    row-gap: 1rem;
}

.admin-panel .panel-head .btn,
.admin-topbar .btn {
    max-width: 100%;
    justify-self: end;
}

.admin-form .btn,
.admin-login-card .btn,
.contact-form .btn {
    width: 100%;
}

.admin-form input,
.admin-form select,
.admin-form textarea,
.admin-login-card input,
.admin-login-card select,
.admin-login-card textarea,
.contact-form input,
.contact-form select,
.contact-form textarea {
    min-width: 0;
}

.admin-form > *,
.form-split > * {
    min-width: 0;
}

.admin-form select,
.admin-login-card select,
.contact-form select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 22px) calc(50% - 3px),
        calc(100% - 16px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 3rem;
}

.admin-form input[type="file"] {
    padding: 0.8rem 1rem;
    overflow: hidden;
}

.admin-form input[type="file"]::file-selector-button {
    margin-right: 0.85rem;
    border: 0;
    border-radius: 999px;
    padding: 0.7rem 1rem;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
}

.admin-mobile-bar {
    display: none;
    justify-content: flex-start;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.admin-mobile-bar strong {
    display: block;
    margin-top: 0.2rem;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 1.5rem;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.95rem 0.75rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.actions-cell {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.thumb-card {
    padding: 0;
    display: grid;
    overflow: hidden;
    border-radius: 20px;
}

.thumb-card a {
    display: block;
    padding: 0.9rem 1rem;
    color: var(--primary);
    font-weight: 700;
    border-top: 1px solid var(--line);
}

.admin-panel + .admin-panel {
    margin-top: 1.25rem;
}

.admin-login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.admin-login-card {
    width: min(460px, 100%);
}

.alert {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    margin-bottom: 1rem;
}

.alert.success {
    background: rgba(68, 141, 85, 0.12);
    color: #256438;
}

.alert.error {
    background: rgba(154, 34, 28, 0.12);
    color: var(--primary);
}

.empty-state {
    text-align: center;
}

@media (max-width: 1100px) {
    .homepage-product-grid,
    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .desktop-only {
        display: none;
    }

    .hamburger-btn,
    .drawer-close {
        display: inline-flex;
    }

    .hero-grid,
    .about-grid,
    .contact-page-grid,
    .product-detail-layout,
    .footer-grid,
    .contact-strip,
    .admin-grid,
    .form-split,
    .legal-layout {
        grid-template-columns: 1fr;
    }

    .homepage-product-grid,
    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .site-header {
        position: sticky;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100dvh;
        max-height: 100dvh;
        width: min(320px, 84vw);
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        box-shadow: var(--shadow);
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    body.menu-open .admin-sidebar {
        transform: translateX(0);
    }

    .admin-mobile-bar {
        display: flex;
    }
}

@media (max-width: 900px) and (min-width: 641px) {
    .homepage-product-grid,
    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .product-visual,
    .placeholder-art {
        min-height: 180px;
    }
}

@media (max-width: 640px) {
    .site-header {
        position: static;
    }

    .nav-shell,
    .admin-topbar,
    .home-category-head {
        align-items: flex-start;
    }

    .hero-section,
    .page-hero {
        padding-top: 2.5rem;
    }

    .hero-section h1,
    .page-hero h1 {
        font-size: 2.45rem;
    }

    .filter-bar {
        padding: 1rem 0.9rem;
    }

    .filter-bar .btn,
    .filter-bar input {
        width: 100%;
    }

    .homepage-product-grid,
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

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

    .product-side-panel .action-stack .btn {
        width: 100%;
    }

    .lightbox-dialog {
        width: calc(100% - 0.75rem);
        height: min(92dvh, 760px);
        margin: 0.375rem auto;
        padding: 3.75rem 0.75rem 1rem;
    }

    .lightbox-nav {
        top: auto;
        bottom: 5.75rem;
        transform: none;
        width: 42px;
        height: 42px;
    }

    .lightbox-prev {
        left: 0.75rem;
    }

    .lightbox-next {
        right: 0.75rem;
    }

    .lightbox-thumb {
        width: 64px;
        height: 64px;
    }

    .product-visual,
    .placeholder-art {
        min-height: 150px;
    }

    .container {
        width: min(var(--container), calc(100% - 1rem));
    }

    .brand-logo {
        width: 50px;
        height: 50px;
    }

    .footer-logo {
        width: 68px;
    }

    .panel-head,
    .admin-topbar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .panel-head .btn,
    .admin-topbar .btn {
        width: 100%;
        justify-self: stretch;
    }
}
