:root {
    --ink: #181614;
    --muted: #68635d;
    --line: #ded8cf;
    --paper: #fbfaf7;
    --panel: #ffffff;
    --accent: #d84f36;
    --gold: #f4bd43;
    --teal: #245d63;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

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

a:hover {
    color: var(--accent);
}

.navbar-brand {
    letter-spacing: 0;
}

.hero {
    background: linear-gradient(135deg, #f7f1e5 0%, #ffffff 54%, #e7f0ed 100%);
    border-bottom: 1px solid var(--line);
    padding: clamp(3rem, 8vw, 7rem) 0 3rem;
}

.home-banner {
    align-items: center;
    background: linear-gradient(24deg, rgba(18, 17, 15, 0.78) 0%, rgb(18 18 15 / 0%) 42%, rgba(18, 17, 15, 0.14) 100%), url(/assets/images/sword-art-online/318.jpg) center / cover no-repeat;
    color: #fff;
    display: flex;
    min-height: min(76vh, 720px);
    padding: clamp(4rem, 12vw, 8rem) 0 clamp(2.5rem, 7vw, 5rem);
}

.home-banner-copy {
    max-width: 680px;
}

.home-banner .eyebrow {
    color: #ffd36f;
}

.home-banner .lead {
    max-width: 560px;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 6.75rem);
    line-height: 0.92;
    letter-spacing: 0;
    margin-bottom: 1rem;
}

.eyebrow {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-poster-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    max-width: 460px;
    margin-left: auto;
}

.hero-poster-grid img,
.product-card img,
.main-product-image {
    background: transparent;
    border: 1px solid var(--line);
    image-orientation: from-image;
    object-fit: contain;
}

.hero-poster-grid img {
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    width: 100%;
    box-shadow: 0 18px 40px rgba(24, 22, 20, 0.12);
}

.section-title {
    font-size: 1.55rem;
}

.product-card {
    background: var(--panel);
    border: 1px solid transparent;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.product-card:hover {
    box-shadow: 0 18px 36px rgba(24, 22, 20, 0.08);
    transform: translateY(-2px);
}

.product-card img {
    aspect-ratio: 1 / 1;
    width: 100%;
}

.product-card img.landscape,
.hero-poster-grid img.landscape {
    aspect-ratio: 4 / 3;
}

.product-card img.portrait,
.hero-poster-grid img.portrait {
    aspect-ratio: 3 / 4;
}

.product-card > .p-3 {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.product-card-actions {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 0.8fr 1.2fr;
    margin-top: auto;
}

.product-card-actions form,
.product-card-actions button,
.product-card-actions a {
    width: 100%;
}

.product-desc {
    display: -webkit-box;
    min-height: 3rem;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.filters {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
    gap: 0.6rem;
    width: min(100%, 940px);
}

.admin-product-filters {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(130px, 1fr)) auto auto;
}

.compact-filters {
    padding: 0.75rem;
}

.compact-filters .form-control,
.compact-filters .form-select,
.compact-filters .btn {
    min-height: 34px;
    padding-bottom: 0.25rem;
    padding-top: 0.25rem;
}

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

.zoom-trigger {
    background: transparent;
    border: 0;
    padding: 0;
    position: relative;
}

.zoom-trigger::after {
    background: rgba(24, 22, 20, 0.72);
    border-radius: 999px;
    bottom: 1rem;
    color: #fff;
    content: "Click to zoom";
    font-size: 0.85rem;
    padding: 0.35rem 0.7rem;
    position: absolute;
    right: 1rem;
}

.main-product-image {
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    cursor: zoom-in;
    height: 70vh;
    max-height: 70vh;
    width: 100%;
}

.main-product-image.portrait {
    aspect-ratio: 3 / 4;
}

.main-product-image.landscape {
    aspect-ratio: 4 / 3;
}

.thumb-row {
    display: flex;
    gap: 0.7rem;
    overflow-x: auto;
}

.thumb-row img,
.image-strip img {
    aspect-ratio: 1 / 1;
    background: #f3efe7;
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    object-fit: contain;
    width: 72px;
}

.purchase-panel,
.summary-panel,
.auth-panel,
.admin-panel,
.message-thread {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1.25rem;
}

.auth-wrap {
    display: grid;
    min-height: 68vh;
    padding: 3rem 1rem;
    place-items: center;
}

.auth-panel {
    width: min(100%, 430px);
}

.cart-summary {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    text-align: right;
}

.cart-product,
.checkout-item,
.admin-product-preview,
.admin-order-item {
    align-items: center;
    display: flex;
    gap: 0.75rem;
}

.cart-product img,
.checkout-item img,
.admin-product-preview img,
.admin-order-item img {
    aspect-ratio: 1 / 1;
    background: #f3efe7;
    border: 1px solid var(--line);
    border-radius: 6px;
    flex: 0 0 auto;
    object-fit: contain;
    width: 58px;
}

.checkout-item {
    display: grid;
    grid-template-columns: 52px 1fr auto;
}

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

.contact-link {
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 700;
    padding: 1rem;
    text-align: center;
}

.contact-facebook { background: #eef4ff; }
.contact-zalo { background: #eaf7ff; }
.contact-telegram { background: #eef8fb; }
.contact-whatsapp { background: #edf9f1; }

.empty-state {
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    padding: 2rem;
    text-align: center;
}

.message-thread {
    margin-bottom: 1rem;
}

.admin-reply {
    background: #f2f7f5;
    border-left: 4px solid var(--teal);
    padding: 1rem;
}

.admin-body {
    background: #f5f6f4;
}

.metric {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1.2rem;
}

.metric span {
    color: var(--muted);
    display: block;
    font-size: 0.86rem;
}

.metric strong {
    display: block;
    font-size: 2rem;
    line-height: 1.1;
}

.image-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.7rem;
}

.image-strip img {
    width: 100%;
}

.admin-edit-images .image-strip {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.admin-edit-images .image-strip img {
    max-height: 360px;
}

.btn,
.form-control,
.form-select {
    border-radius: 6px;
}

.btn-dark {
    background: var(--ink);
    border-color: var(--ink);
}

.image-zoom-overlay {
    background: rgba(12, 12, 12, 0.92);
    display: none;
    inset: 0;
    padding: 2rem;
    position: fixed;
    z-index: 1080;
}

.image-zoom-overlay.is-open {
    display: flex;
}

.image-zoom-stage {
    align-items: center;
    display: flex;
    height: 100%;
    justify-content: center;
    overflow: auto;
    width: 100%;
    user-select: none;
}

.image-zoom-stage img {
    cursor: zoom-in;
    max-height: 88vh;
    max-width: 88vw;
    object-fit: contain;
    transition: transform 120ms ease;
}

.image-zoom-stage.is-zoomed {
    align-items: flex-start;
    justify-content: flex-start;
}

.image-zoom-stage.is-zoomed img {
    cursor: grab;
    margin: auto;
}

.image-zoom-toolbar {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    position: absolute;
    right: 1.25rem;
    top: 1.25rem;
    z-index: 2;
}

.image-zoom-toolbar button {
    background: #fff;
    border: 1px solid #d8d8d8;
    border-radius: 999px;
    color: var(--ink);
    min-width: 2.5rem;
    padding: 0.45rem 0.75rem;
}

.image-zoom-close {
    align-items: center;
    display: flex;
    font-size: 1.4rem;
    height: 2.5rem;
    justify-content: center;
    line-height: 1;
    width: 2.5rem;
}

.cart-notice {
    background: #198754;
    border-radius: 0.5rem;
    bottom: 1.5rem;
    box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.2);
    color: #fff;
    max-width: calc(100vw - 2rem);
    opacity: 0;
    padding: 0.85rem 1.1rem;
    pointer-events: none;
    position: fixed;
    right: 1.5rem;
    transform: translateY(1rem);
    transition: opacity 160ms ease, transform 160ms ease;
    z-index: 1100;
}

.cart-notice.is-error {
    background: #dc3545;
}

.cart-notice.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 991.98px) {
    .home-banner {
        background-position: 58% center;
        min-height: 68vh;
    }

    .hero-poster-grid {
        margin-left: 0;
    }

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

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

    .main-product-image {
        height: 62vh;
    }
}

@media (max-width: 575.98px) {
    .home-banner {
        background:
            linear-gradient(180deg, rgba(18, 17, 15, 0.38) 0%, rgba(18, 17, 15, 0.82) 100%),
            url("/assets/images/sword-art-online/318.jpg") 58% center / cover no-repeat;
        min-height: 64vh;
    }

    .cart-summary {
        flex-direction: column;
        text-align: left;
    }

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

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

    .main-product-image {
        height: 55vh;
    }

    .zoom-trigger::after {
        font-size: 0.75rem;
    }
}
