:root {
    --primary: #11562a;
    --primary-container: #2e6f40;
    --primary-fixed: #adf3b8;
    --secondary: #7d562d;
    --surface: #fcf9f4;
    --surface-low: #f6f3ee;
    --surface-high: #ebe8e3;
    --surface-container: #f0ede9;
    --on-surface: #1c1c19;
    --on-surface-variant: #404940;
    --on-primary: #ffffff;
    --radius-lg: 0.25rem;
    --radius-xl: 0.5rem;
    --radius-full: 0.75rem;
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2.5rem;
    --margin: 1rem;
    --margin-desktop: 3rem;
    --font-serif: 'Newsreader', Georgia, serif;
    --font-sans: 'Be Vietnam Pro', system-ui, sans-serif;
    --header-h: 64px;
    --footer-h: 88px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 22px;
    color: var(--on-surface);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

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

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

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    line-height: 1;
}

/* Header */
.home-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(252, 249, 244, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(235, 232, 227, 0.6);
    box-shadow: 0 1px 2px rgba(28, 28, 25, 0.04);
}

.home-header__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--space-sm) var(--margin);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.home-logo {
    display: none;
    font-family: var(--font-serif);
    font-size: 22px;
    line-height: 28px;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.home-tabs {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: rgba(235, 232, 227, 0.6);
    padding: 4px;
    border-radius: var(--radius-full);
    flex: 1;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.home-tabs::-webkit-scrollbar {
    display: none;
}

.home-tab {
    flex: 0 0 auto;
    border: 0;
    cursor: pointer;
    background: transparent;
    color: var(--on-surface-variant);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 400;
    line-height: 22px;
    padding: 8px 14px;
    border-radius: var(--radius-xl);
    text-align: center;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.home-tab:hover {
    color: var(--on-surface);
}

.home-tab.is-active {
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(17, 86, 42, 0.25);
}

/* Main */
.home-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--space-lg) var(--margin) calc(var(--footer-h) + var(--space-xl));
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.home-section {
    scroll-margin-top: calc(var(--header-h) + 16px);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.home-section__head {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.home-section__bar {
    width: 6px;
    height: 20px;
    background: var(--primary);
    border-radius: 999px;
    flex-shrink: 0;
}

.home-section__title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 26px;
    line-height: 34px;
    font-weight: 500;
    color: var(--on-surface);
}

.home-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--surface-low);
    border-radius: var(--radius-full);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(28, 28, 25, 0.06);
    transition: box-shadow 0.35s, transform 0.2s;
}

.product-card:hover {
    box-shadow: 0 12px 28px rgba(28, 28, 25, 0.1);
}

.product-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--surface-high);
    overflow: hidden;
}

.product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.product-card:hover .product-card__media img {
    transform: scale(1.02);
}

.product-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--on-surface-variant);
    background: var(--surface-high);
}

.product-card__placeholder .material-symbols-outlined {
    font-size: 48px;
    opacity: 0.45;
}

.product-card__body {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-card__name {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 18px;
    line-height: 26px;
    font-weight: 600;
    color: var(--on-surface);
}

.product-card__desc {
    margin: 4px 0 0;
    font-size: 14px;
    line-height: 22px;
    color: var(--on-surface-variant);
    white-space: pre-line;
}

.product-card__gallery-btn {
    margin-top: 10px;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(17, 86, 42, 0.2);
    background: rgba(173, 243, 184, 0.25);
    color: var(--primary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.product-card__gallery-btn:hover {
    background: rgba(173, 243, 184, 0.45);
}

.product-card__gallery-btn:active {
    transform: scale(0.97);
}

.product-card__gallery-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.product-card__gallery-btn .material-symbols-outlined {
    font-size: 18px;
}

.product-card__gallery-count {
    opacity: 0.75;
}

.gallery-modal[hidden] {
    display: none !important;
}

.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.gallery-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(28, 28, 25, 0.55);
}

.gallery-modal__dialog {
    position: relative;
    width: min(960px, 100%);
    max-height: calc(100vh - 32px);
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(28, 28, 25, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gallery-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--surface-high);
}

.gallery-modal__header h3 {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 500;
    color: var(--on-surface);
}

.gallery-modal__close {
    border: 0;
    background: var(--surface-high);
    color: var(--on-surface);
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.gallery-modal__body {
    padding: 16px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--surface-low);
}

.gallery-modal__item {
    margin: 0;
    display: flex;
    justify-content: center;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid var(--surface-high);
}

.gallery-modal__item img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(70vh, 900px);
    object-fit: contain;
}

.gallery-modal__empty {
    margin: 24px 0;
    text-align: center;
    color: var(--on-surface-variant);
}

.home-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xl) var(--margin);
    color: var(--on-surface-variant);
    text-align: center;
}

.home-empty .material-symbols-outlined {
    font-size: 48px;
    opacity: 0.4;
}

.home-empty p {
    margin: 0;
    font-size: 16px;
}

/* Floating Facebook — small Messenger-style bubble */
.home-fab {
    position: fixed;
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: calc(var(--footer-h) - 16px + env(safe-area-inset-bottom, 0px));
    z-index: 70;
    box-sizing: border-box;
    width: 52px;
    height: 52px;
    max-width: 52px;
    max-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #1877f2;
    color: #fff !important;
    text-decoration: none;
    box-shadow:
        0 4px 14px rgba(24, 119, 242, 0.45),
        0 2px 6px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.home-fab__icon {
    width: 22px !important;
    height: 22px !important;
    max-width: 22px;
    max-height: 22px;
    display: block;
    flex-shrink: 0;
    fill: #fff;
}

.home-fab--facebook:hover {
    transform: translateY(-2px);
    background: #166fe5;
    box-shadow:
        0 8px 20px rgba(24, 119, 242, 0.5),
        0 3px 8px rgba(0, 0, 0, 0.2);
}

.home-fab--facebook:active {
    transform: scale(0.94);
}

/* Footer hotline */
.home-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(246, 243, 238, 0.95);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--surface-high);
    box-shadow: 0 -4px 24px rgba(30, 75, 43, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.home-footer__inner {
    max-width: 1280px;
    margin: 0 auto;
    min-height: 64px;
    height: auto;
    padding: 10px var(--margin);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.home-footer__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 420px;
}

.home-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    height: 44px;
    padding: 0 14px;
    border-radius: var(--radius-full);
    background: var(--primary-container);
    color: var(--on-primary);
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    box-shadow: 0 1px 3px rgba(17, 86, 42, 0.2);
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    flex: 1 1 140px;
    white-space: nowrap;
}

.home-cta:hover {
    background: var(--primary);
    color: var(--on-primary);
}

.home-cta:active {
    transform: scale(0.97);
}

.home-cta .material-symbols-outlined {
    font-size: 18px;
}

.home-footer .home-cta--zalo {
    background: #0068ff !important;
    box-shadow: 0 1px 3px rgba(0, 104, 255, 0.28);
}

.home-footer .home-cta--zalo:hover {
    background: #0052cc !important;
}

.home-footer .home-cta--messenger {
    background: #0084ff !important;
    box-shadow: 0 1px 3px rgba(0, 132, 255, 0.28);
}

.home-footer .home-cta--messenger:hover {
    background: #006dff !important;
}

.home-cta__zalo-icon,
.home-cta__fb-icon {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    :root {
        --footer-h: 80px;
    }

    .home-fab {
        right: max(20px, env(safe-area-inset-right, 0px));
        width: 56px;
        height: 56px;
        max-width: 56px;
        max-height: 56px;
    }

    .home-fab__icon {
        width: 24px !important;
        height: 24px !important;
        max-width: 24px;
        max-height: 24px;
    }

    .home-footer__actions {
        max-width: none;
        width: auto;
        flex-wrap: nowrap;
        gap: 10px;
    }

    .home-cta {
        flex: 0 0 auto;
        min-width: 150px;
        padding: 0 18px;
        font-size: 14px;
    }
}

@media (min-width: 768px) {
    .home-header__inner {
        padding: var(--space-sm) var(--margin-desktop);
    }

    .home-logo {
        display: block;
        font-size: 24px;
        line-height: 32px;
    }

    .home-tabs {
        flex: 0 1 auto;
        width: auto;
        max-width: min(100%, 640px);
    }

    .home-tab {
        padding: 8px 24px;
        font-size: 16px;
        line-height: 24px;
    }

    .home-main {
        padding: var(--space-xl) var(--margin-desktop) calc(var(--footer-h) + var(--space-xl));
    }

    .home-section__bar {
        height: 24px;
    }

    .home-section__title {
        font-size: 34px;
        line-height: 42px;
    }

    .home-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xl);
    }

    .product-card--wide {
        grid-column: 1 / -1;
        max-width: 42rem;
        margin-inline: auto;
        width: 100%;
    }

    .home-footer__inner {
        padding: 12px var(--margin-desktop);
        min-height: 64px;
    }
}
