:root {
    --ink: #102026;
    --muted: #677174;
    --line: #dfe7e2;
    --paper: #fffdf8;
    --wash: #f8f5ef;
    --primary: #0b6b61;
    --primary-dark: #07453f;
    --accent: #f08a5d;
    --gold: #f8c15b;
    --danger: #bc3b3b;
    --success: #1f7a4c;
    --shadow: 0 14px 40px rgba(16, 32, 38, 0.10);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--wash);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    background: rgba(255, 253, 248, 0.94);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 850;
    letter-spacing: 0;
    white-space: nowrap;
}

.brand span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: white;
    background: var(--primary);
}

.search-shell {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    min-width: 0;
    overflow: visible;
    background: white;
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(16, 32, 38, 0.06);
}

.search-shell input {
    min-width: 0;
    height: 42px;
    padding: 0 12px 0 16px;
    border: 0;
    outline: 0;
    background: transparent;
}

.search-shell button {
    width: 38px;
    height: 38px;
    margin-right: 2px;
    border: 0;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    cursor: pointer;
}

.search-shell .mic-button {
    background: #f3ece2;
    color: var(--ink);
}

.suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.suggestions a {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 9px;
    border-bottom: 1px solid var(--line);
}

.suggestions img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 8px;
}

.suggestions span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 0 10px;
    border-radius: 999px;
    color: white;
    background: var(--ink);
}

.cart-pill strong {
    display: grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--ink);
}

.app-shell {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 14px 14px 94px;
}

.hero-slider {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 86%;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin: 4px -14px 22px;
    padding: 0 14px;
}

.hero-slider::-webkit-scrollbar {
    display: none;
}

.hero-slide {
    min-height: 215px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    padding: 22px;
    border-radius: 8px;
    color: white;
    background:
        linear-gradient(120deg, rgba(11, 107, 97, 0.93), rgba(16, 32, 38, 0.72)),
        url("https://images.unsplash.com/photo-1556742502-ec7c0e9f34b1?auto=format&fit=crop&w=1200&q=80") center/cover;
    background-position: center;
    background-size: cover;
    scroll-snap-align: start;
}

.hero-slide.accent {
    background:
        linear-gradient(120deg, rgba(240, 138, 93, 0.92), rgba(16, 32, 38, 0.70)),
        url("https://images.unsplash.com/photo-1607083206968-13611e3d76db?auto=format&fit=crop&w=1200&q=80") center/cover;
}

.hero-slide p,
.section-head p,
.page-title p,
.admin-top p {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.hero-slide p {
    color: rgba(255, 255, 255, 0.80);
}

.hero-slide h1,
.hero-slide h2,
.page-title h1,
.section-head h2 {
    margin: 0;
    letter-spacing: 0;
}

.hero-slide h1,
.hero-slide h2 {
    max-width: 560px;
    font-size: clamp(1.7rem, 7vw, 3.5rem);
    line-height: 1.03;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    font-weight: 800;
    cursor: pointer;
}

.btn:hover {
    background: var(--primary-dark);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.btn-secondary {
    background: #e8efe9;
    color: var(--ink);
}

.btn-secondary:hover {
    background: #dbe8e2;
}

.btn-small {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.9rem;
}

.section-head,
.page-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-end;
    margin: 24px 0 12px;
}

.section-head a {
    color: var(--primary);
    font-weight: 800;
}

.page-title {
    align-items: flex-start;
    flex-direction: column;
}

.page-title h1 {
    font-size: clamp(1.8rem, 8vw, 3.4rem);
}

.category-scroll {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 10px;
    overflow-x: auto;
    margin: 0 -14px;
    padding: 0 14px 4px;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px 0 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--paper);
    font-weight: 800;
}

.category-chip span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e8efe9;
    color: var(--primary);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(16, 32, 38, 0.07);
}

.product-image {
    position: relative;
    aspect-ratio: 1.18 / 1;
    background: #edf3ef;
    overflow: hidden;
}

.product-image::after {
    display: none;
}

.product-image-link,
.product-image img {
    display: block;
    width: 100%;
    height: 100%;
}

.product-image img {
    object-fit: cover;
}

.product-rating {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 2;
    box-shadow: 0 6px 14px rgba(16, 32, 38, 0.12);
}

.product-image-panel {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 2;
    display: grid;
    gap: 7px;
}

.product-rate-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-end;
    color: white;
}

.image-price {
    display: flex;
    gap: 5px;
    align-items: baseline;
    flex-wrap: wrap;
    justify-content: flex-end;
    text-align: right;
    font-size: 0.92rem;
    line-height: 1;
}

.badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 3px 7px;
    border-radius: 4px;
    background: var(--gold);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.01em;
}

.badge-discount {
    background: #e53935;
    color: #fff;
}

.product-copy {
    display: grid;
    gap: 8px;
    padding: 10px;
    flex: 1;
    align-content: start;
}

.product-title {
    min-height: 0;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-weight: 850;
    line-height: 1.24;
}

.rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    width: max-content;
    min-height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #8a5c00;
    font-size: 0.78rem;
    font-weight: 800;
}

.price-row,
.detail-price {
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
}

.card-actions {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: 6px;
    margin: 0;
}

.card-actions .btn {
    min-height: 34px;
    padding: 0 9px;
    font-size: 0.82rem;
    white-space: nowrap;
}

.price-row span,
.detail-price span,
.price-row .price-original,
.image-price .price-original {
    color: var(--muted);
    text-decoration: line-through;
    font-size: 0.82rem;
}

.image-price .price-original {
    color: rgba(255, 255, 255, 0.76);
}

.price-row .price-sale,
.image-price .price-sale,
.detail-price .price-sale {
    color: var(--primary);
    text-decoration: none;
}

.image-price strong,
.image-price .price-sale {
    color: white;
}

.filter-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.filter-bar input,
.filter-bar select,
.big-search input,
.checkout-form input,
.checkout-form textarea,
.checkout-form select,
.auth-card input,
.auth-card textarea,
.admin-form input,
.admin-form textarea,
.admin-form select,
.mini-admin-form input,
.mini-admin-form select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    outline-color: var(--primary);
}

.big-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.product-detail {
    display: grid;
    gap: 18px;
    margin-top: 16px;
}

.detail-gallery {
    overflow: hidden;
    border-radius: 8px;
    background: #eef4ef;
}

.detail-gallery img {
    width: 100%;
    height: clamp(320px, 58vh, 620px);
    object-fit: cover;
}

.detail-copy {
    display: grid;
    gap: 12px;
    align-self: start;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 10px 28px rgba(16, 32, 38, 0.06);
}

.detail-copy h1 {
    margin: 0;
    font-size: clamp(1.7rem, 8vw, 3rem);
}

.detail-price strong {
    font-size: 1.55rem;
}

.detail-price .price-original {
    font-size: 1.05rem;
}

.stock-line {
    display: inline-flex;
    width: max-content;
    min-height: 30px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: #e8efe9;
    color: var(--primary);
    font-weight: 850;
}

.sticky-buy {
    position: sticky;
    bottom: 74px;
    z-index: 20;
    display: grid;
    grid-template-columns: 68px 1fr 1fr auto;
    gap: 8px;
    padding: 10px;
    margin: 8px -4px 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.95);
    backdrop-filter: blur(14px);
}

.detail-actions {
    margin-top: 4px;
}

.sticky-buy input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: center;
}

.icon-btn {
    width: 44px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    font-size: 1.3rem;
}

.cart-layout,
.checkout-layout {
    display: grid;
    gap: 14px;
}

.cart-items {
    display: grid;
    gap: 10px;
}

.cart-item,
.order-card {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.cart-item img {
    width: 78px;
    height: 78px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item h2,
.order-card h2 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.cart-item p,
.order-card p {
    margin: 0;
    color: var(--muted);
}

.qty-form {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.qty-form input {
    width: 64px;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: center;
}

.qty-form button,
.coupon-form button,
.actions button,
.mini-admin-form button {
    border: 0;
    border-radius: 8px;
    background: var(--ink);
    color: white;
    min-height: 36px;
    padding: 0 10px;
    cursor: pointer;
}

.summary-card,
.auth-card,
.install-card,
.admin-panel {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 10px 28px rgba(16, 32, 38, 0.06);
}

.summary-card h2,
.auth-card h1,
.install-card h1,
.admin-panel h2 {
    margin-top: 0;
}

.summary-card dl {
    display: grid;
    gap: 10px;
}

.summary-card dl div,
.mini-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.summary-card dd {
    margin: 0;
    font-weight: 850;
}

.link-button {
    margin-top: 10px;
    border: 0;
    background: transparent;
    color: var(--danger);
    font-weight: 800;
}

.checkout-form,
.auth-card form,
.admin-form {
    display: grid;
    gap: 12px;
}

.checkout-form label,
.auth-card label,
.admin-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-weight: 750;
}

.form-grid {
    display: grid;
    gap: 10px;
}

.payment-options {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfaf5;
}

.sticky-submit {
    position: sticky;
    bottom: 74px;
    z-index: 20;
}

.coupon-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin: 12px 0;
}

.coupon-form input {
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.dashboard-grid,
.admin-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.stat-card,
.admin-stats article {
    display: grid;
    gap: 6px;
    min-height: 104px;
    align-content: center;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--paper);
}

.stat-card span,
.admin-stats span {
    font-size: 1.55rem;
    font-weight: 900;
    color: var(--primary);
}

.order-card {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 10px;
}

.order-card span {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
}

.empty-state {
    padding: 28px 16px;
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.7);
    color: var(--muted);
    font-weight: 750;
}

.flash {
    margin: 10px 0;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: white;
    font-weight: 750;
}

.flash.success {
    border-color: #b7ddc4;
    color: var(--success);
    background: #effaf3;
}

.flash.error {
    border-color: #ecc0c0;
    color: var(--danger);
    background: #fff1f1;
}

.flash.info {
    border-color: #c9d9ef;
    color: #295b91;
    background: #f1f6ff;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 8px max(8px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
    background: rgba(255, 253, 248, 0.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.bottom-nav a {
    display: grid;
    justify-items: center;
    gap: 3px;
    min-width: 0;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.bottom-nav span {
    font-size: 1.15rem;
}

.bottom-nav .active {
    color: var(--primary);
}

.install-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 18px;
}

.install-card {
    width: min(520px, 100%);
}

code {
    padding: 2px 5px;
    border-radius: 6px;
    background: #edf1ee;
}

.admin-body {
    display: grid;
    min-height: 100vh;
    background: #f6f4ed;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    align-items: center;
    padding: 10px;
    background: var(--ink);
    color: white;
}

.admin-brand span {
    background: var(--gold);
    color: var(--ink);
}

.admin-sidebar nav {
    display: flex;
    gap: 6px;
}

.admin-sidebar a {
    white-space: nowrap;
    padding: 10px 12px;
    border-radius: 8px;
    color: white;
    font-weight: 800;
}

.admin-sidebar nav a {
    background: rgba(255, 255, 255, 0.09);
}

.admin-main {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 14px;
}

.admin-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 14px;
}

.admin-top h1 {
    margin: 0;
    font-size: clamp(1.6rem, 6vw, 2.8rem);
}

.admin-grid-two {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 11px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.table-img,
.admin-thumb,
.admin-banner-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.admin-thumb {
    width: 110px;
    height: 110px;
}

.admin-banner-thumb {
    width: min(440px, 100%);
    height: 150px;
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.actions form {
    margin: 0;
}

.actions a {
    color: var(--primary);
    font-weight: 850;
}

.status {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 0 9px;
    border-radius: 999px;
    background: #eef2ef;
    font-size: 0.82rem;
    font-weight: 850;
}

.status.delivered {
    background: #e6f7ec;
    color: var(--success);
}

.status.payment-paid {
    background: #e6f7ec;
    color: var(--success);
}

.status.failed {
    background: #fff0f0;
    color: var(--danger);
}

.status.payment-failed {
    background: #fff0f0;
    color: var(--danger);
}

.status.in_progress {
    background: #fff7df;
    color: #8a5c00;
}

.status.payment-pending {
    background: #fff7df;
    color: #8a5c00;
}

.order-status-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: -4px 0 14px;
}

.order-extra {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    background: #f4f0e8;
}

.order-extra p {
    margin: 0;
    color: var(--ink);
}

.inline-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.check-label {
    display: flex !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px !important;
}

.mini-admin-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wallet-mini-form {
    min-width: 420px;
}

.order-admin-meta {
    padding: 12px 0;
    color: var(--muted);
}

.gateway-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #fbfaf5;
}

.gateway-actions p {
    margin: 0;
}

.skeleton {
    min-height: 16px;
    border-radius: 8px;
    background: linear-gradient(90deg, #edf1ee 25%, #f9fbf8 37%, #edf1ee 63%);
    background-size: 400% 100%;
    animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

@media (max-width: 420px) {
    .brand {
        font-size: 0;
    }

    .brand span {
        font-size: 1rem;
    }

    .cart-pill span {
        display: none;
    }

    .product-title {
        font-size: 0.94rem;
    }

    .sticky-buy {
        grid-template-columns: 58px 1fr 1fr 44px;
    }
}

@media (min-width: 520px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 720px) {
    .app-shell {
        padding-bottom: 34px;
    }

    .hero-slider {
        grid-auto-columns: calc(50% - 7px);
    }

    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .product-image {
        aspect-ratio: 1.18 / 1;
    }

    .card-actions {
        grid-template-columns: 1fr 1fr;
    }

    .filter-bar {
        grid-template-columns: 1.2fr repeat(4, 1fr) auto;
    }

    .product-detail,
    .cart-layout,
    .checkout-layout {
        grid-template-columns: minmax(0, 1.05fr) 0.95fr;
        align-items: start;
    }

    .detail-copy {
        position: sticky;
        top: 92px;
    }

    .form-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .bottom-nav {
        display: none;
    }

    .admin-body {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .admin-sidebar {
        min-height: 100vh;
        align-items: stretch;
        flex-direction: column;
        overflow: visible;
    }

    .admin-sidebar nav {
        flex-direction: column;
        width: 100%;
    }

    .admin-grid-two {
        grid-template-columns: 1fr 1fr;
    }

    .admin-main {
        padding: 24px;
    }
}

@media (min-width: 1040px) {
    .product-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
