/* =============================================================
   ENTERCARTS storefront
   Brand colours (--brand, --accent) are injected from admin settings.
   ============================================================= */

:root {
    --brand: #111111;
    --accent: #F5A623;
    --wa: #15803D;
    --wa-hover: #166534;
    --ink: #111111;
    --muted: #6B7280;
    --line: #E8E8E8;
    --bg: #FAFAFA;
    --surface: #FFFFFF;
    --danger: #B91C1C;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(17, 24, 39, .05);
    --shadow-md: 0 12px 28px -12px rgba(17, 24, 39, .22);
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-head: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    --header-h: 128px;
}

* { -webkit-tap-highlight-color: transparent; }

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    font-size: .95rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .brand-name, .footer-brand {
    font-family: var(--font-head);
    letter-spacing: -.01em;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--accent); }

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2000;
    background: var(--brand);
    color: #fff;
    padding: .5rem 1rem;
    border-radius: 8px;
}

/* ---------- Buttons ---------- */

.btn-brand {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: color-mix(in srgb, var(--brand) 85%, #000);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--brand) 85%, #000);
    --bs-btn-active-bg: color-mix(in srgb, var(--brand) 75%, #000);
    --bs-btn-active-color: #fff;
    font-weight: 600;
}

.btn-whatsapp {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--wa);
    --bs-btn-border-color: var(--wa);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--wa-hover);
    --bs-btn-hover-border-color: var(--wa-hover);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--wa-hover);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 var(--accent);
}

.header-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.25rem;
    padding: .85rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: var(--brand);
    min-width: 0;
}

.brand:hover { color: var(--brand); }

.brand-logo {
    display: block;
    height: 36px;
    width: auto;
    max-width: min(220px, 48vw);
    object-fit: contain;
    object-position: left center;
}

@media (min-width: 768px) {
    .brand-logo { height: 42px; max-width: 280px; }
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--brand);
    color: var(--accent);
    font-size: 1.15rem;
}

.brand-name {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: .06em;
}

.header-search {
    position: relative;
    display: flex;
    max-width: 640px;
    width: 100%;
    justify-self: center;
}

.header-search .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.header-search .form-control {
    height: 46px;
    padding-left: 2.6rem;
    border-radius: 999px 0 0 999px;
    border: 1px solid var(--line);
    background: #F5F5F4;
    font-size: .95rem;
}

.header-search .form-control:focus {
    background: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 15%, transparent);
}

.header-search .btn {
    border-radius: 0 999px 999px 0;
    padding: 0 1.25rem;
}

.header-wa {
    height: 46px;
    border-radius: 999px;
    padding: 0 1.1rem;
}

.header-wa .bi { font-size: 1.15rem; }

/* Category navigation */

.category-nav { border-top: 1px solid var(--line); }

.category-list {
    display: flex;
    gap: .35rem;
    list-style: none;
    margin: 0;
    padding: .55rem 0;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}

.category-list::-webkit-scrollbar { display: none; }

.cat-link {
    display: inline-block;
    padding: .42rem .95rem;
    border-radius: 999px;
    color: var(--ink);
    font-weight: 500;
    font-size: .88rem;
    white-space: nowrap;
    scroll-snap-align: start;
    transition: background-color .15s, color .15s;
}

.cat-link:hover { background: #F0EEEB; color: var(--ink); }

.cat-link.active {
    background: var(--brand);
    color: #fff;
}

/* ---------- Catalogue ---------- */

.site-main { min-height: 60vh; }

.catalogue { padding-top: 1.5rem; padding-bottom: 3rem; }

.catalogue-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.catalogue-heading h1 {
    font-size: clamp(1.25rem, 2.4vw, 1.65rem);
    font-weight: 800;
    margin: 0;
    word-break: break-word;
}

.catalogue-summary { margin: .15rem 0 0; color: var(--muted); font-size: .875rem; }

.catalogue-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
}

.filter-chips { display: flex; flex-wrap: wrap; gap: .4rem; }

.chip {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    border-radius: 999px;
    padding: .35rem .85rem;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color .15s, border-color .15s, color .15s;
}

.chip:hover { border-color: var(--brand); }

.chip.active {
    background: color-mix(in srgb, var(--accent) 16%, #fff);
    border-color: var(--accent);
    color: var(--ink);
}

.filter-selects { display: flex; gap: .5rem; }

.filter-selects .form-select {
    border-radius: 999px;
    border-color: var(--line);
    min-width: 150px;
    font-size: .85rem;
    padding-top: .4rem;
    padding-bottom: .4rem;
}

.catalogue-results { transition: opacity .2s; }
.catalogue.is-loading .catalogue-results { opacity: .45; pointer-events: none; }

/* Product grid: 2 / 3 / 4 / 5 columns */

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

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

@media (min-width: 992px) {
    .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
}

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

/* Product card */

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}

@media (hover: hover) {
    .product-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
        border-color: transparent;
    }
    .product-card:hover .product-media img { transform: scale(1.04); }
}

.product-media {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    background: #F3F2EF;
    overflow: hidden;
}

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

.product-badges {
    position: absolute;
    top: .6rem;
    left: .6rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .3rem;
}

.badge-tag {
    display: inline-block;
    padding: .2rem .5rem;
    border-radius: 6px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.3;
}

.badge-new { background: var(--brand); color: #fff; }

.stock-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: .35rem;
    background: rgba(17, 24, 39, .78);
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
    text-align: center;
}

.product-card.is-out .product-media img { filter: grayscale(.6); opacity: .8; }

.product-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: .8rem .85rem .9rem;
}

.product-category {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--accent);
}

.product-category:hover { color: var(--brand); }

.product-title {
    font-family: var(--font-body);
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.35;
    margin: .25rem 0 .2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
}

.product-title a { color: var(--ink); }
.product-title a:hover { color: var(--brand); }

.product-sku { font-size: .75rem; color: var(--muted); }
.product-sku span { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.product-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .2rem .5rem;
    margin: .5rem 0 .75rem;
}

.product-price .price { font-size: 1.08rem; font-weight: 700; color: var(--ink); }
.product-price .mrp { font-size: .8rem; color: var(--muted); }

.product-body .btn-whatsapp {
    margin-top: auto;
    border-radius: var(--radius-sm);
    padding: .5rem .5rem;
    font-size: .82rem;
}

/* Empty state */

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

.empty-state h1, .empty-state h2 { color: var(--ink); margin-top: 1rem; }

.empty-icon {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 15%, #fff);
    color: var(--accent);
    font-size: 1.6rem;
}

/* Pagination */

.catalogue-pagination { margin-top: 2rem; }

.pagination { gap: .3rem; }

.pagination .page-link {
    border-radius: 10px !important;
    border-color: var(--line);
    color: var(--ink);
    min-width: 40px;
    text-align: center;
}

.pagination .page-item.active .page-link {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* ---------- Product details ---------- */

.product-page { padding-top: 1.25rem; padding-bottom: 3rem; }

.breadcrumb { font-size: .85rem; margin-bottom: 1.25rem; }
.breadcrumb-item.active { color: var(--muted); }

.product-detail {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(1rem, 3vw, 2rem);
}

.gallery-main {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: #F3F2EF;
}

.gallery-main img,
.gallery-main iframe { width: 100%; height: 100%; border: 0; }
.gallery-main img { object-fit: cover; }
.gallery-main.is-video { aspect-ratio: 16 / 9; background: #111; }

.video-play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 68px;
    height: 68px;
    border: 0;
    border-radius: 50%;
    background: rgba(17, 17, 17, .78);
    color: #fff;
    font-size: 2rem;
    display: grid;
    place-items: center;
    padding-left: 4px;
    cursor: pointer;
}

.video-play:hover { background: var(--accent); color: #111; }

.gallery-thumb-video {
    display: grid;
    place-items: center;
    background: #111;
    color: #fff;
    font-size: 1.6rem;
}

.gallery-thumb-video.active { color: var(--accent); }

.gallery-badge { position: absolute; top: 1rem; left: 1rem; font-size: .8rem; }

.gallery-thumbs {
    display: flex;
    gap: .6rem;
    margin-top: .75rem;
    overflow-x: auto;
    padding-bottom: .25rem;
}

.gallery-thumb {
    flex: 0 0 72px;
    height: 72px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    background: #F3F2EF;
}

.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { border-color: var(--brand); }

.detail-info { position: sticky; top: calc(var(--header-h) + 1rem); }

.detail-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    margin: .35rem 0 .75rem;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    color: var(--muted);
    font-size: .88rem;
}

.detail-meta strong { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.stock-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .65rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: .8rem;
}

.stock-pill .bi { font-size: .5rem; }
.stock-in { background: #DCFCE7; color: #166534; }
.stock-low { background: #FEF3C7; color: #92400E; }
.stock-out { background: #FEE2E2; color: #991B1B; }

.detail-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .35rem .85rem;
    margin-top: 1.25rem;
}

.detail-price .price { font-size: 2rem; font-weight: 800; font-family: var(--font-head); }
.detail-price .mrp { color: var(--muted); }
.detail-price .save { color: #166534; font-weight: 600; font-size: .9rem; }

.tax-note { color: var(--muted); font-size: .8rem; margin: .1rem 0 1rem; }

.detail-short { color: #374151; }

.detail-cta { border-radius: 12px; padding: .85rem 1rem; margin: .5rem 0 1.25rem; }

.detail-perks {
    list-style: none;
    padding: 1rem 0 0;
    margin: 0;
    border-top: 1px solid var(--line);
    display: grid;
    gap: .55rem;
    font-size: .88rem;
    color: #374151;
}

.detail-perks .bi { color: var(--accent); margin-right: .4rem; }

.detail-description {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.detail-description h2, .related h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; }
.description-body { color: #374151; max-width: 75ch; }

.related { margin-top: 2.5rem; }

/* ---------- Footer ---------- */

.site-footer {
    background: var(--brand);
    color: rgba(255, 255, 255, .78);
    padding: 3rem 0 1.25rem;
    font-size: .9rem;
}

.site-footer a { color: rgba(255, 255, 255, .85); }
.site-footer a:hover { color: var(--accent); }

.footer-brand {
    display: inline-flex;
    align-items: center;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: .06em;
    color: #fff !important;
}

.footer-logo-wrap {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border-radius: 10px;
    padding: .4rem .7rem;
}

.footer-logo {
    display: block;
    height: 32px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.footer-text { margin: .5rem 0 1rem; max-width: 34ch; }

.footer-heading {
    font-family: var(--font-body);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--accent);
    margin-bottom: .9rem;
}

.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.footer-contact li { display: flex; gap: .55rem; align-items: flex-start; }
.footer-contact .bi { color: var(--accent); margin-top: .15rem; }
.footer-contact a, .footer-contact span { word-break: break-word; }

.footer-social { display: flex; gap: .5rem; }

.footer-social a {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    font-size: 1.05rem;
}

.footer-social a:hover { background: var(--accent); color: var(--brand); }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5rem;
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .12);
    font-size: .8rem;
}

.wa-float {
    position: fixed;
    right: 1.1rem;
    bottom: 1.1rem;
    z-index: 1020;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    font-size: 1.6rem;
    box-shadow: 0 10px 24px -6px rgba(21, 128, 61, .55);
    transition: transform .2s;
}

.wa-float:hover { color: #fff; transform: scale(1.07); }

/* ---------- Responsive ---------- */

@media (max-width: 767.98px) {
    :root { --header-h: 160px; }

    .header-main {
        grid-template-columns: 1fr auto;
        gap: .65rem 1rem;
        padding: .65rem 0 .6rem;
    }

    .header-search { grid-column: 1 / -1; order: 3; max-width: none; }
    .header-search .form-control { height: 42px; font-size: 16px; }
    .header-search .btn { display: none; }
    .header-search .form-control { border-radius: 999px; }

    .header-wa { height: 44px; width: 44px; padding: 0; min-width: 44px; }
    .brand-name { font-size: 1.15rem; }
    .brand-mark { width: 34px; height: 34px; }

    .catalogue { padding-top: 1rem; }
    .catalogue-toolbar { align-items: stretch; flex-direction: column; }
    .catalogue-filters { flex-direction: column; align-items: stretch; }
    .filter-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .filter-chips::-webkit-scrollbar { display: none; }
    .chip { white-space: nowrap; }
    .filter-selects .form-select { min-width: 0; flex: 1; font-size: 16px; }

    .product-body { padding: .65rem .65rem .75rem; }
    .product-title { font-size: .85rem; }
    .product-price .price { font-size: 1rem; }

    .detail-info { position: static; }
    .detail-price .price { font-size: 1.65rem; }
    .wa-float { width: 50px; height: 50px; font-size: 1.45rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
