:root {
    --green: #16834a;
    --green-dark: #0f5d36;
    --green-soft: #e8f6ee;
    --ink: #1e2a24;
    --muted: #6b756f;
    --line: #dfe7e2;
    --surface: #ffffff;
    --background: #f6f8f5;
    --warning: #8a5a00;
    --danger: #b42318;
    --blue: #2563eb;
    --purple: #6d28d9;
    --shadow: 0 18px 45px rgba(30, 42, 36, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
    letter-spacing: 0;
}

body.admin-body {
    background: #f4f6f7;
}

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

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

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

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 11px 12px;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(22, 131, 74, 0.14);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.header-inner {
    width: min(1180px, calc(100% - 28px));
    min-height: 70px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.brand img {
    width: auto;
    max-width: 172px;
    height: 42px;
    object-fit: contain;
}

.brand-text {
    font-weight: 800;
    color: var(--green-dark);
}

.menu-toggle {
    width: 44px;
    height: 44px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--ink);
}

.site-nav {
    position: absolute;
    top: 70px;
    left: 14px;
    right: 14px;
    display: none;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.site-nav.is-open {
    display: grid;
}

.site-nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 700;
}

.site-nav a.is-active,
.site-nav a:hover {
    background: var(--green-soft);
    color: var(--green-dark);
}

.site-nav .whatsapp-link {
    background: var(--green);
    color: #fff;
}

.page-shell {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    padding: 22px 0 42px;
}

.admin-shell {
    padding-top: 24px;
}

.btn {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--green);
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    padding: 11px 16px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

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

.btn.secondary {
    background: #fff;
    color: var(--green-dark);
    border-color: var(--line);
}

.btn.secondary:hover {
    background: var(--green-soft);
    border-color: var(--green);
}

.btn.small {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 13px;
}

.btn.danger {
    background: #fff;
    color: var(--danger);
    border-color: #f1b9b5;
}

.btn.danger:hover {
    background: #fff1f0;
}

.alert {
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 12px 14px;
    font-weight: 700;
}

.alert-success {
    background: var(--green-soft);
    border-color: #bfe7ce;
    color: var(--green-dark);
}

.alert-error {
    background: #fff1f0;
    border-color: #f3c0ba;
    color: var(--danger);
}

.store-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: end;
    margin: 8px 0 22px;
    padding: 22px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.store-head.compact {
    padding: 18px 20px;
}

.home-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: stretch;
    margin: 8px 0 18px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.home-hero-copy {
    padding: 24px;
}

.home-hero-copy h1 {
    max-width: 720px;
    font-size: clamp(34px, 6vw, 58px);
}

.home-hero-copy p {
    max-width: 660px;
    font-size: 17px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.hero-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 20px;
}

.hero-stats span {
    padding: 10px 12px;
    background: #f9fbfa;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-weight: 700;
}

.hero-stats strong {
    display: block;
    color: var(--green-dark);
    font-size: 24px;
}

.home-hero-media {
    position: relative;
    min-height: 260px;
    background: #eef2ef;
    overflow: hidden;
}

.home-hero-media img {
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
}

.home-hero-media span {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 8px;
    color: var(--ink);
    font-weight: 900;
}

.category-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 0 16px;
}

.category-strip a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 13px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--green-dark);
    font-weight: 800;
    white-space: nowrap;
}

.category-strip a.is-active,
.category-strip a:hover {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.category-strip span {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    min-height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 12px;
}

.category-strip a.is-active span,
.category-strip a:hover span {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0;
}

.section-head h2 {
    margin-bottom: 0;
    font-size: clamp(26px, 4vw, 36px);
}

.featured-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 22px;
}

.product-toolbar {
    margin-top: 18px;
}

.eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.05;
}

h2 {
    margin-bottom: 10px;
    font-size: 22px;
}

p {
    color: var(--muted);
}

.search-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.admin-search {
    margin-bottom: 18px;
}

.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.product-card,
.form-card,
.admin-panel,
.summary-panel,
.auth-card,
.success-card,
.empty-state,
.buy-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(30, 42, 36, 0.04);
}

.product-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.product-media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    background: #eef2ef;
    overflow: hidden;
}

.product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    left: 10px;
    top: 10px;
    max-width: calc(100% - 20px);
    padding: 6px 9px;
    border-radius: 8px;
    background: #fff;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.product-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
}

.product-card h2 {
    margin-bottom: 6px;
    font-size: 19px;
    line-height: 1.25;
}

.mini-category {
    display: inline-flex;
    margin-bottom: 7px;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.product-card p {
    margin-bottom: 0;
    font-size: 14px;
}

.price-pair {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.price-pair span {
    display: grid;
    gap: 2px;
    padding: 10px;
    background: #f9fbfa;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 900;
}

.price-pair small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.card-actions,
.form-actions,
.summary-actions,
.success-actions,
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.card-actions {
    margin-top: auto;
}

.table-actions form {
    margin: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.badge-green {
    background: var(--green-soft);
    color: var(--green-dark);
}

.badge-red {
    background: #fff1f0;
    color: var(--danger);
}

.badge-blue {
    background: #eff6ff;
    color: var(--blue);
}

.badge-purple {
    background: #f4f0ff;
    color: var(--purple);
}

.badge-dark {
    background: #eef1ef;
    color: var(--ink);
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.gallery {
    min-width: 0;
}

.gallery-main {
    aspect-ratio: 4 / 3;
    background: #eef2ef;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.gallery-main img,
.gallery-main video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.thumb-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 86px;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 0 2px;
}

.thumb {
    width: 86px;
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
}

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

.buy-panel {
    padding: 18px;
    align-self: start;
}

.detail-prices {
    margin: 16px 0;
}

.meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 18px;
    color: var(--muted);
}

.cart-add-form {
    display: grid;
    gap: 12px;
}

.content-section {
    margin-top: 20px;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.rich-text {
    color: var(--ink);
}

.payment-switch {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.payment-switch.inline {
    margin-bottom: 16px;
}

.payment-switch label {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 10px;
    align-items: center;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}

.payment-switch input {
    width: 18px;
    min-height: 18px;
}

.payment-switch strong {
    grid-column: 2;
    color: var(--green-dark);
}

.payment-switch label.is-selected {
    border-color: var(--green);
    background: var(--green-soft);
}

.cart-layout,
.checkout-grid,
.order-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.cart-list {
    display: grid;
    gap: 12px;
}

.cart-item {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.cart-item img {
    width: 82px;
    height: 82px;
    object-fit: cover;
    border-radius: 8px;
    background: #eef2ef;
}

.cart-item-main {
    min-width: 0;
}

.cart-item h2 {
    margin-bottom: 4px;
    font-size: 17px;
}

.quantity-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: end;
    margin-top: 10px;
}

.quantity-row input {
    max-width: 110px;
}

.cart-price {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.cart-price small {
    color: var(--muted);
}

.summary-panel {
    padding: 16px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.summary-line span {
    min-width: 0;
    color: var(--muted);
}

.summary-line strong {
    text-align: right;
}

.summary-line.total {
    border-bottom: 0;
    font-size: 19px;
}

.summary-actions {
    margin-top: 14px;
}

.checkout-form,
.admin-form,
.stack-form {
    display: grid;
    gap: 14px;
}

.form-card,
.admin-panel {
    padding: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.form-grid label,
.stack-form label,
.cart-add-form label {
    display: grid;
    gap: 6px;
    font-weight: 800;
}

.form-grid span,
.stack-form span,
.cart-add-form span {
    color: var(--ink);
    font-size: 14px;
}

.check-row {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 10px;
    min-height: 46px;
}

.check-row input {
    width: 18px;
    min-height: 18px;
}

.eft-box {
    display: none;
    padding: 14px;
    background: #f9fbfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.eft-box.is-visible {
    display: grid;
    gap: 12px;
}

.eft-box p {
    margin-bottom: 0;
}

.eft-box a {
    color: var(--green-dark);
    font-weight: 800;
}

.checkout-submit {
    width: 100%;
}

.sticky-summary {
    align-self: start;
}

.auth-card,
.success-card,
.empty-state {
    width: min(560px, 100%);
    margin: 28px auto;
    padding: 22px;
}

.success-card {
    text-align: center;
}

.success-actions {
    justify-content: center;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 18px;
}

.stat-card {
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-weight: 800;
}

.stat-card strong {
    display: block;
    margin-top: 4px;
    font-size: 28px;
}

.panel-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.panel-title h2 {
    margin-bottom: 0;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.table-thumb {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 8px;
    background: #eef2ef;
}

.detail-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.detail-list dt {
    color: var(--muted);
    font-weight: 800;
}

.detail-list dd {
    margin: -8px 0 0;
}

.media-preview,
.receipt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.media-preview figure,
.receipt-card {
    margin: 0;
    padding: 8px;
    background: #f9fbfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.media-preview img,
.media-preview video,
.receipt-card img,
.pdf-box {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    background: #fff;
}

.media-preview figcaption,
.receipt-card span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.receipt-card {
    display: grid;
    gap: 8px;
}

.pdf-box {
    display: grid;
    place-items: center;
    color: var(--danger);
    font-weight: 900;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: #fff;
}

.footer-inner {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    padding: 22px 0;
    display: grid;
    gap: 14px;
}

.footer-inner p {
    margin: 6px 0 0;
}

@media (min-width: 560px) {
    .search-form {
        grid-template-columns: 1fr auto;
    }

    .price-pair {
        grid-template-columns: 1fr 1fr;
    }

    .payment-switch {
        grid-template-columns: 1fr 1fr;
    }

    .cart-item {
        grid-template-columns: 96px 1fr auto;
        align-items: center;
    }

    .cart-item img {
        width: 96px;
        height: 96px;
    }

    .cart-price {
        grid-column: auto;
        min-width: 150px;
        border-top: 0;
        padding-top: 0;
    }

    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid .full {
        grid-column: 1 / -1;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 820px) {
    .menu-toggle {
        display: none;
    }

    .site-nav {
        position: static;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        box-shadow: none;
        border: 0;
        padding: 0;
        background: transparent;
    }

    .site-nav a {
        min-height: 40px;
    }

    .store-head {
        grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    }

    .home-hero {
        grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
    }

    .home-hero-copy {
        padding: 34px;
    }

    .store-head.compact {
        grid-template-columns: minmax(0, 1fr) auto;
    }

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

    .product-detail,
    .checkout-grid {
        grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    }

    .cart-layout {
        grid-template-columns: minmax(0, 1fr) 330px;
        align-items: start;
    }

    .sticky-summary {
        position: sticky;
        top: 92px;
    }

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

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

    .featured-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-inner {
        grid-template-columns: 1fr auto;
        align-items: center;
    }
}

@media (min-width: 1120px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
