/**
 * LocalDesign Catalog — catalog.css
 *
 * ⚠ MIRROR COPY. Canonical source: theme-localdesign-client/assets/css/catalog.css
 * This copy is loaded ONLY by the editor preview (Site_Renderer::render via LD_CORE_URL),
 * because the preview iframe is served from the SaaS theme and cannot resolve the client
 * theme asset URL. Keep both files in sync when editing catalog styles.
 *
 * Colours: all catalog UI uses --ld-c-primary (a full CSS hex colour scoped to
 * .ld-catalog-page). This variable is injected by render_catalog_page() using
 * the site's actual primary_color hex, so the catalog always shows the site's
 * own brand colour — not the SaaS platform default.
 * --ld-primary (RGB channels for Tailwind) is NOT used directly here.
 *
 * Shape tokens (radius, shadow, lift) are driven by --ld-r, --ld-r-btn,
 * --ld-r-modal, --ld-shadow, --ld-lift — set per archetype via
 * data-archetype on .ld-catalog-page.
 */

/* ─── Reset / base ────────────────────────────────────────────────────────── */
.ld-catalog-page *,
.ld-catalog-page *::before,
.ld-catalog-page *::after { box-sizing: border-box; }

/* ─── Page wrapper ────────────────────────────────────────────────────────── */
.ld-catalog-page {
    min-height: 60vh;
    background: rgb(var(--ld-surface, 249 250 251));
    padding-bottom: 6rem;
}
.ld-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* ARCHETYPE DESIGN TOKENS                                                     */
/* Defaults = "modern"; overrides below per data-archetype.                    */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-catalog-page {
    --ld-r:       1rem;
    --ld-r-btn:   9999px;
    --ld-r-modal: 1.25rem;
    --ld-shadow:  0 8px 25px rgba(0,0,0,.1);
    --ld-lift:    -2px;
    /*
     * --ld-c-primary is the resolved primary colour for catalog UI elements.
     * It is always a full CSS colour (hex), injected as a scoped inline style
     * by render_catalog_page() with the site's actual primary hex.
     * This fallback is only used if that injection is absent (e.g. local preview).
     */
    --ld-c-primary: #2563eb;
}
.ld-catalog-page[data-archetype="warm"],
.ld-catalog-page[data-archetype="health"] {
    --ld-r:       1rem;
    --ld-r-btn:   9999px;
    --ld-r-modal: 1.25rem;
    --ld-shadow:  0 8px 25px rgba(0,0,0,.1);
    --ld-lift:    -2px;
}
.ld-catalog-page[data-archetype="elegant"],
.ld-catalog-page[data-archetype="local"] {
    --ld-r:       0.75rem;
    --ld-r-btn:   0.75rem;
    --ld-r-modal: 1rem;
    --ld-shadow:  0 8px 25px rgba(0,0,0,.08);
    --ld-lift:    -2px;
}
.ld-catalog-page[data-archetype="minimal"],
.ld-catalog-page[data-archetype="professional"] {
    --ld-r:       0.5rem;
    --ld-r-btn:   0.5rem;
    --ld-r-modal: 0.75rem;
    --ld-shadow:  0 4px 12px rgba(0,0,0,.06);
    --ld-lift:    -1px;
}
.ld-catalog-page[data-archetype="bold"],
.ld-catalog-page[data-archetype="creative"] {
    --ld-r:       0;
    --ld-r-btn:   0;
    --ld-r-modal: 0;
    --ld-shadow:  none;
    --ld-lift:    0;
}
.ld-catalog-page[data-archetype="luxury"] {
    --ld-r:       0.25rem;
    --ld-r-btn:   0.25rem;
    --ld-r-modal: 0.5rem;
    --ld-shadow:  0 4px 16px rgba(0,0,0,.06);
    --ld-lift:    -1px;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* INTRO (title + subtitle scroll with the content; store header is the navbar) */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-catalog-intro {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.75rem 1rem .35rem;
}
.ld-catalog-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    margin: 0;
}
.ld-catalog-subtitle {
    color: #6b7280;
    margin: .4rem 0 0;
    font-size: 1rem;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* TOOLBAR: contextual catalog controls (categories + filters + view toggle)    */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-catalog-toolbar {
    position: relative;
    z-index: 30;
    background: transparent;
    border: 0;
    padding: 1.5rem 1rem .35rem;
}
.ld-catalog-toolbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 3.25rem;
    padding: 0 .75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid #edf0f3;
    border-radius: var(--ld-r);
    background: rgba(255, 255, 255, .88);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}
.ld-view-toggle {
    display: flex;
    flex-shrink: 0;
    border: 1px solid #d1d5db;
    border-radius: var(--ld-r);
    overflow: hidden;
    height: 2.25rem;
    align-items: stretch;
}
/* When categories are hidden the toggle is the only toolbar item → keep it right */
.ld-catalog-toolbar .ld-view-toggle { margin-left: auto; }
.ld-view-btn {
    background: #fff;
    border: none;
    cursor: pointer;
    padding: 0 .65rem;
    color: #9ca3af;
    transition: background .15s, color .15s;
    display: flex;
    align-items: center;
    height: 100%;
}
.ld-view-btn svg { width: 1.125rem; height: 1.125rem; }
.ld-view-btn.active,
.ld-view-btn:hover { background: var(--ld-c-primary); color: #fff; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* CATEGORY TABS                                                                */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-catalog-tabs-wrap {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.ld-catalog-tabs-wrap::-webkit-scrollbar { display: none; }
.ld-catalog-tabs {
    display: flex;
    gap: .25rem;
    white-space: nowrap;
    align-items: center;
}
.ld-cat-tab {
    background: none;
    border: none;
    cursor: pointer;
    min-height: 3.25rem;
    padding: 0 1rem;
    font-size: .9rem;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
    display: inline-flex;
    align-items: center;
    gap: .375rem;
}
.ld-cat-tab:hover { color: var(--ld-c-primary); }
.ld-cat-tab-active { color: var(--ld-c-primary); border-bottom-color: var(--ld-c-primary); }
.ld-cat-badge {
    background: #f3f4f6;
    color: #6b7280;
    font-size: .75rem;
    padding: .1rem .45rem;
    border-radius: 9999px;
    font-weight: 600;
}
.ld-cat-tab-active .ld-cat-badge {
    background: color-mix(in srgb, var(--ld-c-primary) 12%, transparent);
    color: var(--ld-c-primary);
}
.ld-filter-open-btn {
    flex-shrink: 0;
    min-height: 2.35rem;
    padding: 0 .95rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--ld-r-btn);
    background: #fff;
    color: #374151;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    font-size: .875rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: border-color .15s, color .15s, background .15s;
}
.ld-filter-open-btn:hover,
.ld-filter-open-btn.ld-filter-open-active {
    border-color: color-mix(in srgb, var(--ld-c-primary) 30%, #e5e7eb);
    color: var(--ld-c-primary);
    background: color-mix(in srgb, var(--ld-c-primary) 8%, #fff);
}
.ld-filter-active-count {
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 .25rem;
    border-radius: 9999px;
    background: var(--ld-c-primary);
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* "Más" category dropdown (holds categories beyond the first 4) */
.ld-cat-more { position: relative; flex-shrink: 0; }
.ld-cat-more-btn {
    background: none;
    border: none;
    cursor: pointer;
    min-height: 4.25rem;
    padding: 0 .75rem;
    font-size: .9rem;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    white-space: nowrap;
}
.ld-cat-more-btn:hover,
.ld-cat-more.ld-cat-more-active .ld-cat-more-btn { color: var(--ld-c-primary); }
.ld-cat-more.ld-cat-more-active .ld-cat-more-btn { border-bottom-color: var(--ld-c-primary); }
.ld-cat-more-chevron { width: 1rem; height: 1rem; transition: transform .15s; }
.ld-cat-more.ld-cat-more-open .ld-cat-more-chevron { transform: rotate(180deg); }
.ld-cat-more-menu {
    position: absolute;
    top: calc(100% + .25rem);
    right: 0;
    min-width: 12rem;
    max-height: 60vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--ld-r, .75rem);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
    padding: .35rem;
    display: none;
    z-index: 60;
}
.ld-cat-more.ld-cat-more-open .ld-cat-more-menu { display: block; }
.ld-cat-more-menu .ld-cat-tab {
    width: 100%;
    justify-content: space-between;
    min-height: 0;
    border-bottom: none;
    border-radius: calc(var(--ld-r, .75rem) - .25rem);
    padding: .55rem .75rem;
}
.ld-cat-more-menu .ld-cat-tab:hover { background: rgb(var(--ld-surface, 249 250 251)); }
.ld-cat-more-menu .ld-cat-tab-active {
    background: color-mix(in srgb, var(--ld-c-primary) 10%, transparent);
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* FILTER MODAL                                                                 */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-filter-modal {
    position: fixed;
    inset: var(--ld-overlay-top, var(--ld-preview-bar-h, 0px)) 0 0 0;
    z-index: 9200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.ld-filter-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 17, 21, .45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.ld-filter-panel {
    position: relative;
    width: 100%;
    max-height: min(86dvh, 720px);
    background: #fff;
    border-radius: var(--ld-r-modal) var(--ld-r-modal) 0 0;
    box-shadow: 0 -18px 60px rgba(15, 23, 42, .22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ld-slide-up .22s ease;
}
@media (min-width: 640px) {
    .ld-filter-modal { align-items: center; padding: 1rem; }
    .ld-filter-panel {
        width: min(560px, calc(100vw - 2rem));
        border-radius: var(--ld-r-modal);
        animation: ld-fade-in .18s ease;
    }
}
.ld-filter-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem .9rem;
    border-bottom: 1px solid #f1f3f5;
}
.ld-filter-header h2 {
    margin: 0;
    color: #111827;
    font-size: 1.25rem;
    line-height: 1.15;
}
.ld-filter-header p {
    margin: .2rem 0 0;
    color: #9ca3af;
    font-size: .875rem;
}
.ld-filter-close {
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 9999px;
    background: #f3f4f6;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.ld-filter-close svg { width: 1rem; height: 1rem; }
.ld-filter-body {
    overflow-y: auto;
    padding: 1rem 1.25rem;
}
.ld-filter-section + .ld-filter-section { margin-top: 1.15rem; }
.ld-filter-section h3 {
    margin: 0 0 .65rem;
    color: #374151;
    font-size: .9375rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}
.ld-filter-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.ld-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 2.25rem;
    padding: 0 .85rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--ld-r-btn);
    background: #fff;
    color: #374151;
    cursor: pointer;
    font-size: .875rem;
    font-weight: 700;
    transition: background .15s, color .15s, border-color .15s;
}
.ld-filter-chip:hover,
.ld-filter-chip.ld-filter-chip-active {
    border-color: var(--ld-c-primary);
    background: var(--ld-c-primary);
    color: #fff;
}
.ld-filter-chip-count {
    opacity: .68;
    font-size: .75rem;
}
.ld-filter-price-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}
.ld-filter-price-input,
.ld-filter-select {
    width: 100%;
    min-height: 2.75rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--ld-r);
    background: #fff;
    color: #111827;
    font-size: .95rem;
    padding: 0 .8rem;
    outline: none;
}
.ld-filter-price-input:focus,
.ld-filter-select:focus {
    border-color: var(--ld-c-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ld-c-primary) 14%, transparent);
}
.ld-filter-hint {
    margin: .45rem 0 0;
    color: #9ca3af;
    font-size: .78rem;
}
.ld-filter-actions {
    display: flex;
    gap: .75rem;
    padding: .9rem 1.25rem calc(.9rem + env(safe-area-inset-bottom));
    border-top: 1px solid #f1f3f5;
    background: #fff;
}
.ld-filter-clear,
.ld-filter-apply {
    flex: 1;
    min-height: 2.75rem;
    border-radius: var(--ld-r-btn);
    cursor: pointer;
    font-size: .95rem;
    font-weight: 800;
}
.ld-filter-clear {
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
}
.ld-filter-apply {
    border: 1px solid var(--ld-c-primary);
    background: var(--ld-c-primary);
    color: #fff;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* RESULTS BAR                                                                  */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-catalog-results-bar {
    max-width: 1200px;
    margin: .55rem auto 0;
    padding: 0 1rem;
}
.ld-results-count {
    font-size: .875rem;
    color: #9ca3af;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* BODY / GRID                                                                  */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-catalog-body {
    max-width: 1200px;
    margin: .85rem auto 0;
    padding: 0 1rem;
}

/* Grid view — columns driven by --ld-cols (injected per-site, default 4).
   Tablet (≥640px) uses --ld-cols-md (= min(3, --ld-cols)) so layout stays readable.
   Layout variants below keep their own spacing, but still honour the column setting. */
.ld-product-grid.ld-view-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}
@media (min-width: 640px) {
    .ld-product-grid.ld-view-grid { grid-template-columns: repeat(var(--ld-cols-md, 3), 1fr); }
}
@media (min-width: 1024px) {
    .ld-product-grid.ld-view-grid { grid-template-columns: repeat(var(--ld-cols, 4), 1fr); }
}

/* wide layout: bigger photos — also honoured by --ld-cols */
.ld-catalog-page[data-layout="wide"] .ld-product-grid.ld-view-grid {
    grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) {
    .ld-catalog-page[data-layout="wide"] .ld-product-grid.ld-view-grid { grid-template-columns: repeat(var(--ld-cols-md, 3), 1fr); }
}
@media (min-width: 1024px) {
    .ld-catalog-page[data-layout="wide"] .ld-product-grid.ld-view-grid { grid-template-columns: repeat(var(--ld-cols, 4), 1fr); }
}

/* Contextual cart button in catalog header. The FAB remains as mobile/fallback. */
.ld-catalog-cart-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    border: 1px solid color-mix(in srgb, var(--ld-c-primary) 24%, transparent);
    background: color-mix(in srgb, var(--ld-c-primary) 10%, #fff);
    color: var(--ld-c-primary);
    border-radius: var(--ld-r-btn);
    height: 2.5rem;
    padding: 0 .9rem;
    font-size: .875rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s, transform .15s;
    white-space: nowrap;
}
.ld-catalog-cart-btn:hover {
    background: var(--ld-c-primary);
    color: #fff;
    transform: translateY(-1px);
}
.ld-catalog-cart-btn svg { width: 1.05rem; height: 1.05rem; }
.ld-catalog-cart-count {
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 .25rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    font-size: .7rem;
    line-height: 1;
}
@media (min-width: 768px) {
    .ld-catalog-cart-btn { display: inline-flex; }
}

/* Hide category tabs when data-show-cats="false" (CSS guard for the PHP conditional render) */
[data-show-cats="false"] .ld-catalog-tabs-wrap { display: none !important; }

/* List view */
.ld-product-grid.ld-view-list {
    display: flex;
    flex-direction: column;
    gap: .625rem;
}

/* ─── Loading spinner ─────────────────────────────────────────────────────── */
.ld-catalog-loading {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 4rem 0;
}
.ld-loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid #e5e7eb;
    border-top-color: var(--ld-c-primary);
    border-radius: 50%;
    animation: ld-spin .7s linear infinite;
}
@keyframes ld-spin { to { transform: rotate(360deg); } }

/* ─── No results ─────────────────────────────────────────────────────────── */
.ld-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 1rem;
    color: #9ca3af;
}
.ld-no-results-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    opacity: .5;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* PRODUCT CARDS                                                                */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-product-card {
    background: #fff;
    border-radius: var(--ld-r);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow .2s, transform .2s;
    position: relative;
    border: 1px solid #f3f4f6;
}
.ld-product-card:hover {
    box-shadow: var(--ld-shadow);
    transform: translateY(var(--ld-lift));
}
.ld-product-card:focus-visible {
    outline: 2px solid var(--ld-c-primary);
    outline-offset: 2px;
}
.ld-card-unavailable { opacity: .6; }

/* Grid card */
.ld-card-grid { display: flex; flex-direction: column; }
.ld-card-grid .ld-card-photo-wrap {
    position: relative;
    aspect-ratio: var(--ld-img-ratio, 1);
    overflow: hidden;
    background: rgb(var(--ld-surface, 249 250 251));
}
.ld-card-grid .ld-card-photo-wrap.ld-has-img::before,
.ld-card-list-photo.ld-has-img::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(90deg, #f2f3f5 25%, #e7e9ee 50%, #f2f3f5 75%);
    background-size: 800px 100%;
    animation: ld-shimmer 1.4s infinite linear;
    opacity: 1;
    transition: opacity .18s ease;
}
.ld-card-grid .ld-card-photo-wrap.ld-img-loaded::before,
.ld-card-list-photo.ld-img-loaded::before {
    opacity: 0;
}
.ld-product-img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .18s ease, transform .4s;
}
.ld-product-img.ld-img-ready { opacity: 1; }
.ld-card-grid:hover .ld-product-img { transform: scale(1.05); }
.ld-product-img-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: #f3f4f6;
    font-size: 2.5rem;
    font-weight: 700;
    color: #d1d5db;
}
.ld-card-grid .ld-card-body {
    padding: .9rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    flex: 1;
}

/* Small category label above the product name */
.ld-product-cat {
    font-size: .7rem;
    color: #9ca3af;
    letter-spacing: .02em;
}

/* Grid card bottom row: price (left) + CTA (right), aligned to the bottom */
.ld-card-foot {
    margin-top: auto;
    padding-top: .75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.ld-card-foot .ld-product-price { margin: 0; }
.ld-card-foot .ld-add-btn,
.ld-card-foot .ld-qty-controls { margin-top: 0; }

/* List card */
.ld-card-list {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    padding: .75rem;
    border-radius: var(--ld-r);
}
.ld-card-list-photo {
    width: 104px;
    align-self: stretch;
    min-height: 104px;
    flex-shrink: 0;
    border-radius: var(--ld-r);
    overflow: hidden;
    position: relative;
    background: #f3f4f6;
}
.ld-card-list-photo .ld-product-img { width: 100%; height: 100%; object-fit: cover; }
.ld-card-list-photo .ld-product-img-placeholder { width: 100%; height: 100%; font-size: 1.75rem; }
.ld-card-list-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: .2rem; }
.ld-card-list-end {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: .5rem;
    text-align: right;
}
.ld-card-list-end .ld-product-price { margin: 0; }
.ld-card-list-cta { flex-shrink: 0; }

/* Shared text */
.ld-product-name {
    font-weight: 600;
    color: #111827;
    font-size: 1.125rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}
.ld-product-desc {
    font-size: .9375rem;
    color: #6b7280;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ld-product-price {
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
    color: #374151;
}

/* Badges — always pill (small indicators) */
.ld-product-badge,
.ld-soldout-badge {
    position: absolute;
    top: .5rem;
    left: .5rem;
    font-size: .7rem;
    font-weight: 700;
    padding: .2rem .5rem;
    border-radius: 9999px;
    color: #171717;
    background: color-mix(in srgb, var(--ld-c-primary) 13%, #fff);
    z-index: 1;
    letter-spacing: .02em;
}
.ld-soldout-badge {
    background: #f3f4f6 !important;
    color: #6b7280 !important;
}
.ld-card-list .ld-product-badge,
.ld-card-list .ld-soldout-badge { position: static; display: inline-block; width: fit-content; align-self: flex-start; margin-bottom: .25rem; }

/* Add / Qty buttons */
.ld-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: .875rem;
    border-radius: var(--ld-r-btn);
    padding: .5rem 1rem;
    color: #fff;
    transition: opacity .15s;
    margin-top: .375rem;
    white-space: nowrap;
}
.ld-add-btn:hover { opacity: .88; }
.ld-card-variant-cta {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-top: .375rem;
    flex-shrink: 0;
}
.ld-card-foot .ld-card-variant-cta { margin-top: 0; }
.ld-card-cart-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.45rem;
    height: 1.45rem;
    padding: 0 .35rem;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--ld-c-primary) 12%, #fff);
    color: #171717;
    font-size: .72rem;
    font-weight: 800;
    border: 1px solid color-mix(in srgb, var(--ld-c-primary) 18%, transparent);
}
.ld-add-btn-disabled {
    background: #d1d5db !important;
    color: #9ca3af !important;
    cursor: not-allowed;
}
.ld-qty-controls {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    margin-top: .375rem;
    background: #f3f4f6;
    border-radius: var(--ld-r-btn);
    padding: .2rem .375rem;
}
.ld-qty-btn {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    color: #374151;
    line-height: 1;
    transition: background .15s;
}
.ld-qty-btn:last-child { color: #fff; }
.ld-qty-num { font-weight: 700; font-size: .875rem; min-width: 1.5rem; text-align: center; color: #111827; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* LOAD MORE                                                                    */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-loadmore-wrap { text-align: center; margin-top: 3rem; }
.ld-loadmore-btn {
    background: none;
    border: 2px solid var(--ld-c-primary);
    color: var(--ld-c-primary);
    font-weight: 600;
    padding: .7rem 2.1rem;
    border-radius: var(--ld-r-btn);
    cursor: pointer;
    font-size: 1rem;
    transition: background .15s, color .15s;
}
.ld-loadmore-btn:hover { background: var(--ld-c-primary); color: #fff; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* PRODUCT MODAL                                                                */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-product-modal {
    position: fixed;
    inset: var(--ld-overlay-top, var(--ld-preview-bar-h, 0px)) 0 0 0;
    z-index: 9000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-top: env(safe-area-inset-top);
}
@media (min-width: 640px) { .ld-product-modal { align-items: center; } }
.ld-product-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
}
.ld-product-modal-content {
    position: relative;
    background: #fff;
    border-radius: var(--ld-r-modal) var(--ld-r-modal) 0 0;
    max-height: calc(100dvh - var(--ld-overlay-top, var(--ld-preview-bar-h, 0px)));
    overflow: hidden;
    width: 100%;
    max-width: 560px;
    padding: 1rem 1rem 0;
    animation: ld-slide-up .25s ease;
    box-shadow: 0 -12px 40px rgba(0,0,0,.18);
}
@media (min-width: 640px) {
    .ld-product-modal-content {
        border-radius: var(--ld-r-modal);
        max-height: calc(100dvh - var(--ld-overlay-top, var(--ld-preview-bar-h, 0px)) - 2rem);
        animation: ld-fade-in .2s ease;
    }
}
@media (min-width: 900px) {
    .ld-product-modal {
        align-items: center;
        padding: 1rem;
    }
    .ld-product-modal-content {
        width: min(100%, 980px);
        max-width: 980px;
        padding: 1rem;
    }
}
@keyframes ld-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes ld-fade-in  { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }

.ld-product-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    z-index: 3;
}
.ld-product-modal-close svg { width: 1rem; height: 1rem; }
.ld-product-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: inherit;
    overflow-y: auto;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    scrollbar-width: thin;
}
@media (min-width: 900px) {
    .ld-product-modal-body {
        display: grid;
        grid-template-columns: minmax(0, .95fr) minmax(320px, 1fr);
        gap: 1.5rem;
        overflow: hidden;
        padding-bottom: 0;
    }
}

.ld-modal-photo-wrap {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--ld-r);
    overflow: hidden;
    background: #f3f4f6;
    max-height: min(38dvh, 320px);
}
.ld-modal-photo { width: 100%; height: 100%; object-fit: contain; background: #f8fafc; }
.ld-modal-photo-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 5rem; font-weight: 700; color: #d1d5db;
}
.ld-modal-badge {
    display: inline-block;
    align-self: flex-start;
    width: fit-content;
    max-width: max-content;
    font-size: .75rem;
    font-weight: 700;
    padding: .2rem .6rem;
    border-radius: 9999px;
    color: #fff;
    margin-bottom: .25rem;
}
.ld-modal-title { font-size: clamp(1.375rem, 2.2vw, 1.9rem); font-weight: 700; color: #111827; margin: 0; line-height: 1.15; }
.ld-modal-desc  { font-size: 1.0625rem; color: #4b5563; line-height: 1.6; margin: 0; }
.ld-modal-price { font-size: 1.375rem; font-weight: 700; margin: 0; }
.ld-modal-info  {
    display: flex;
    flex-direction: column;
    gap: .625rem;
    min-width: 0;
}
@media (min-width: 900px) {
    .ld-modal-photo-wrap {
        max-height: none;
        height: min(72dvh, 640px);
    }
    .ld-modal-info {
        overflow-y: auto;
        padding: .5rem .25rem .5rem 0;
    }
}

/* Variants */
.ld-modal-variants-label { font-size: .9375rem; font-weight: 600; color: #374151; margin: 0 0 .5rem; }
.ld-modal-variants-grid  { display: flex; flex-wrap: wrap; gap: .5rem; }
.ld-variant-btn {
    border: 2px solid #e5e7eb;
    background: #fff;
    border-radius: var(--ld-r);
    padding: .5rem .85rem;
    cursor: pointer;
    font-size: .9375rem;
    font-weight: 600;
    color: #374151;
    transition: border-color .15s, background .15s, color .15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .1rem;
}
.ld-variant-btn:hover { border-color: var(--ld-c-primary); }
.ld-variant-btn.active { border-color: var(--ld-c-primary); background: var(--ld-c-primary); color: #fff; }
.ld-variant-price { font-size: .75rem; font-weight: 400; }
.ld-variant-disabled { opacity: .4; cursor: not-allowed; }
@keyframes ld-shake {
    0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)}
}
.ld-shake { animation: ld-shake .35s ease; }

/* Quantity block */
.ld-modal-quantity {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
}
.ld-modal-quantity-label {
    font-size: .9375rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: #374151;
    margin: 0;
}
.ld-modal-quantity .ld-modal-qty { margin: 0; }

/* Modal actions */
.ld-modal-actions {
    display: flex;
    gap: .75rem;
    align-items: center;
    flex-wrap: nowrap;
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: .5rem -1rem 0;
    padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
    background: linear-gradient(to top, #fff 82%, rgba(255,255,255,.88));
    border-top: 1px solid #f3f4f6;
}
.ld-modal-qty { display: flex; align-items: center; gap: .375rem; background: #f3f4f6; border-radius: var(--ld-r-btn); padding: .25rem .5rem; }
.ld-modal-qty-btn {
    width: 1.875rem; height: 1.875rem;
    border: none; border-radius: 50%;
    cursor: pointer; font-size: 1.1rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    background: #e5e7eb; color: #374151;
    line-height: 1; transition: background .15s;
}
.ld-modal-qty-btn:last-child { color: #fff; }
.ld-modal-qty-num { font-weight: 700; min-width: 2rem; text-align: center; color: #111827; }
.ld-modal-add-btn {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    border: none; border-radius: var(--ld-r-btn);
    padding: .75rem 1.65rem;
    font-size: 1.125rem; font-weight: 700;
    color: #fff; cursor: pointer;
    transition: opacity .15s;
}
.ld-modal-add-btn:hover { opacity: .88; }
@media (min-width: 900px) {
    .ld-modal-actions {
        margin: auto 0 0;
        padding: 1rem 0 0;
        background: #fff;
    }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* CART FAB — always circular (standard FAB pattern)                           */
/* Matches the WhatsApp FAB size/position system from fab.css                  */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-cart-fab {
    position: fixed;
    /* Stack ABOVE the WhatsApp FAB using the same token system as fab.css */
    bottom: calc(var(--ld-fab-offset-y, 24px) + var(--ld-fab-size, 64px) + var(--ld-fab-gap, 14px));
    right: var(--ld-fab-offset-x, 24px);
    z-index: 8000;
    width: var(--ld-fab-size, 64px);
    height: var(--ld-fab-size, 64px);
    border-radius: 50%;
    border: none;
    background: var(--ld-c-primary);
    color: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s, box-shadow .2s;
}
.ld-cart-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(0,0,0,.3); }
.ld-cart-icon { width: 1.5rem; height: 1.5rem; }
.ld-cart-count {
    position: absolute;
    top: -.125rem;
    right: -.125rem;
    background: #ef4444;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    min-width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 .25rem;
    border: 2px solid #fff;
}
@media (min-width: 768px) {
    .ld-cart-fab.ld-cart-has-header { display: none !important; }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* CART MODAL                                                                   */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-cart-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
@media (min-width: 640px) { .ld-cart-modal { align-items: center; } }
.ld-cart-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.55);
}
.ld-cart-modal-content {
    position: relative;
    background: #fff;
    border-radius: var(--ld-r-modal) var(--ld-r-modal) 0 0;
    max-height: 92dvh;
    overflow-y: auto;
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    animation: ld-slide-up .25s ease;
}
@media (min-width: 640px) {
    .ld-cart-modal-content { border-radius: var(--ld-r-modal); max-height: 88dvh; animation: ld-fade-in .2s ease; }
}
.ld-cart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 1.25rem .75rem;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}
.ld-cart-title { font-size: 1.25rem; font-weight: 700; color: #111827; margin: 0; }
.ld-cart-subtitle { color: #9ca3af; font-size: .875rem; margin: .125rem 0 0; }
.ld-cart-close {
    background: #f3f4f6; border: none; border-radius: 50%;
    width: 2rem; height: 2rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #6b7280; flex-shrink: 0;
}
.ld-cart-close svg { width: 1rem; height: 1rem; }

.ld-cart-items { padding: .75rem 1.25rem; flex: 1; overflow-y: auto; }

/* Cart item */
.ld-cart-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 0;
    border-bottom: 1px solid #f3f4f6;
}
.ld-cart-item:last-child { border-bottom: none; }
.ld-cart-item-photo-wrap { flex-shrink: 0; }
.ld-cart-item-photo {
    width: 3rem; height: 3rem;
    border-radius: var(--ld-r);
    object-fit: cover;
}
.ld-cart-item-photo-placeholder {
    width: 3rem; height: 3rem;
    border-radius: var(--ld-r);
    background: #f3f4f6;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.25rem; color: #d1d5db;
}
.ld-cart-item-info { flex: 1; min-width: 0; }
.ld-cart-item-name {
    font-weight: 600; font-size: .875rem; color: #111827;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin: 0;
}
.ld-cart-variant-label { font-weight: 400; color: #6b7280; font-size: .8125rem; }
.ld-cart-item-unitprice { font-size: .75rem; color: #9ca3af; margin: .125rem 0 0; }
.ld-cart-item-controls {
    display: flex; align-items: center; gap: .25rem;
    background: #f3f4f6; border-radius: var(--ld-r-btn); padding: .2rem .375rem;
    flex-shrink: 0;
}
.ld-cart-qty-btn {
    width: 1.5rem; height: 1.5rem;
    border-radius: 50%; border: none; cursor: pointer;
    font-size: .9rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    background: transparent; color: var(--ld-c-primary);
    transition: background .15s;
}
.ld-cart-qty-btn:last-child { color: #fff !important; border-radius: 50%; }
.ld-cart-qty-num { font-weight: 700; font-size: .875rem; min-width: 1.25rem; text-align: center; color: #111827; }
.ld-cart-item-subtotal {
    font-weight: 700;
    font-size: .9375rem;
    flex-shrink: 0;
    min-width: 3.5rem;
    text-align: right;
}
.ld-cart-item-remove {
    background: none; border: none; cursor: pointer;
    color: #d1d5db; padding: .25rem;
    display: flex; align-items: center;
    transition: color .15s; flex-shrink: 0;
}
.ld-cart-item-remove:hover { color: #ef4444; }
.ld-cart-item-remove svg { width: 1rem; height: 1rem; }

/* Cart footer */
.ld-cart-footer {
    padding: .75rem 1.25rem 1.25rem;
    border-top: 1px solid #f3f4f6;
    flex-shrink: 0;
}
.ld-cart-totals { margin-bottom: 1rem; }
.ld-cart-total-row {
    display: flex; justify-content: space-between;
    font-size: .9375rem; color: #374151;
    padding: .25rem 0;
}
.ld-cart-total-main { font-weight: 700; font-size: 1.125rem; color: #111827; border-top: 1px solid #e5e7eb; margin-top: .25rem; padding-top: .5rem; }

.ld-whatsapp-btn {
    display: flex; align-items: center; justify-content: center; gap: .625rem;
    width: 100%;
    background: #25d366; color: #fff;
    border: none; border-radius: var(--ld-r-btn);
    font-size: 1rem; font-weight: 700;
    padding: .875rem;
    cursor: pointer;
    transition: background .15s;
}
.ld-whatsapp-btn:hover { background: #22bf5b; }

/* Cart empty state */
.ld-cart-empty {
    padding: 3rem 1.25rem;
    text-align: center;
    display: flex; flex-direction: column; align-items: center;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* ADDED FEEDBACK                                                               */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-toast {
    position: fixed;
    bottom: 5.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(1rem);
    background: #111827;
    color: #fff;
    font-size: .875rem;
    font-weight: 500;
    padding: .5rem 1.25rem;
    border-radius: 9999px;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    z-index: 10000;
    opacity: 0;
    transition: opacity .2s, transform .2s;
    pointer-events: none;
    white-space: nowrap;
}
.ld-toast.ld-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ld-added-overlay {
    position: fixed;
    inset: var(--ld-overlay-top, var(--ld-preview-bar-h, 0px)) 0 0 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(255, 255, 255, .72);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease;
}
.ld-added-overlay.ld-added-show { opacity: 1; }
.ld-added-overlay-modal {
    position: absolute;
    inset: 0;
    z-index: 20;
    border-radius: inherit;
    background: rgba(255, 255, 255, .78);
}
.ld-added-card {
    min-width: min(280px, calc(100vw - 2rem));
    padding: 1.5rem 1.75rem;
    border-radius: var(--ld-r-modal, 1rem);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 20px 60px rgba(15, 23, 42, .18);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    color: #111827;
    font-weight: 800;
    text-align: center;
    transform: translateY(.5rem) scale(.98);
    transition: transform .16s ease;
}
.ld-added-overlay.ld-added-show .ld-added-card {
    transform: translateY(0) scale(1);
}
.ld-added-check {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    background: #16a34a;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(22, 163, 74, .28);
}
.ld-added-check svg {
    width: 1.65rem;
    height: 1.65rem;
    stroke-width: 3;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* EYEBROW (header badge — mirrors the showcase catalog header)                 */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-catalog-eyebrow {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ld-c-primary);
    background: color-mix(in srgb, var(--ld-c-primary) 12%, transparent);
    padding: .25rem .6rem;
    border-radius: 9999px;
    margin-bottom: .5rem;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* MAIN WRAP (toolbar + content)                                                */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-catalog-main-wrap { display: block; }
.ld-catalog-content { display: block; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* LAYOUT: MASONRY (lookbook columns)                                           */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-catalog-page[data-layout="masonry"] .ld-product-grid.ld-view-grid {
    display: block;
    column-count: 2;
    column-gap: 1rem;
    grid-template-columns: none;
}
@media (min-width: 640px) {
    .ld-catalog-page[data-layout="masonry"] .ld-product-grid.ld-view-grid { column-count: var(--ld-cols-md, 3); }
}
@media (min-width: 1024px) {
    .ld-catalog-page[data-layout="masonry"] .ld-product-grid.ld-view-grid { column-count: var(--ld-cols, 4); }
}
.ld-catalog-page[data-layout="masonry"] .ld-product-grid.ld-view-grid .ld-product-card {
    break-inside: avoid;
    width: 100%;
    margin-bottom: 1rem;
    display: inline-block;
}
.ld-catalog-page[data-layout="masonry"] .ld-card-grid .ld-card-photo-wrap { aspect-ratio: 3 / 4; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* LAYOUT: EDITORIAL (roomy, bordered minimal cards)                            */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-catalog-page[data-layout="editorial"] .ld-product-grid.ld-view-grid {
    grid-template-columns: repeat(1, 1fr);
    gap: clamp(1.25rem, 2vw, 2rem);
    max-width: 72rem;
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 640px) {
    .ld-catalog-page[data-layout="editorial"] .ld-product-grid.ld-view-grid { grid-template-columns: repeat(var(--ld-cols-md, 3), 1fr); }
}
@media (min-width: 1024px) {
    .ld-catalog-page[data-layout="editorial"] .ld-product-grid.ld-view-grid { grid-template-columns: repeat(var(--ld-cols, 4), 1fr); }
}
.ld-catalog-page[data-layout="editorial"] .ld-product-card {
    box-shadow: none;
    border: 1px solid #e5e7eb;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* LAYOUT: SIDEBAR                                                              */
/* Desktop: categories/filter controls become a left rail and stay sticky.      */
/* ─────────────────────────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
    .ld-catalog-page[data-layout="sidebar"] .ld-catalog-main-wrap {
        max-width: 1200px;
        margin: 0 auto;
        padding: 1rem;
        display: grid;
        grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
        gap: 1.25rem;
        align-items: start;
    }
    .ld-catalog-page[data-layout="sidebar"] .ld-catalog-toolbar {
        position: sticky;
        top: calc(var(--ld-cat-top, var(--ld-navbar-h, 0px)) + 1rem);
        padding: 0;
    }
    .ld-catalog-page[data-layout="sidebar"] .ld-catalog-toolbar-inner {
        max-width: none;
        min-height: 0;
        margin: 0;
        padding: .75rem;
        flex-direction: column;
        align-items: stretch;
        gap: .75rem;
    }
    .ld-catalog-page[data-layout="sidebar"] .ld-catalog-tabs-wrap {
        overflow: visible;
    }
    .ld-catalog-page[data-layout="sidebar"] .ld-catalog-tabs {
        flex-direction: column;
        align-items: stretch;
        white-space: normal;
        gap: .25rem;
    }
    .ld-catalog-page[data-layout="sidebar"] .ld-cat-tab {
        width: 100%;
        min-height: 2.5rem;
        padding: 0 .75rem;
        justify-content: space-between;
        border-bottom: 0;
        border-radius: calc(var(--ld-r) - .25rem);
    }
    .ld-catalog-page[data-layout="sidebar"] .ld-cat-tab-active {
        background: color-mix(in srgb, var(--ld-c-primary) 10%, #fff);
    }
    .ld-catalog-page[data-layout="sidebar"] .ld-filter-open-btn,
    .ld-catalog-page[data-layout="sidebar"] .ld-view-toggle {
        width: 100%;
    }
    .ld-catalog-page[data-layout="sidebar"] .ld-filter-open-btn {
        justify-content: center;
    }
    .ld-catalog-page[data-layout="sidebar"] .ld-view-toggle {
        margin-left: 0;
    }
    .ld-catalog-page[data-layout="sidebar"] .ld-view-btn {
        flex: 1;
        justify-content: center;
    }
    .ld-catalog-page[data-layout="sidebar"] .ld-catalog-results-bar,
    .ld-catalog-page[data-layout="sidebar"] .ld-catalog-body {
        max-width: none;
        padding-left: 0;
        padding-right: 0;
    }
    .ld-catalog-page[data-layout="sidebar"] .ld-catalog-results-bar {
        margin-top: 0;
    }
    .ld-catalog-page[data-layout="sidebar"] .ld-product-grid.ld-view-grid {
        grid-template-columns: repeat(var(--ld-cols-sidebar, 2), 1fr);
    }
}
@media (min-width: 1280px) {
    .ld-catalog-page[data-layout="sidebar"] .ld-product-grid.ld-view-grid {
        grid-template-columns: repeat(var(--ld-cols-sidebar-xl, 3), 1fr);
    }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* LAYOUT: FEATURED BANNER                                                      */
/* Rendered inside .ld-catalog-content, after the category tabs.               */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-catalog-featured-wrap {
    max-width: 1200px;
    margin: 1.25rem auto 1.25rem;
    padding: 0 1rem;
}
.ld-catalog-featured {
    position: relative;
    border-radius: var(--ld-r);
    overflow: hidden;
    cursor: pointer;
    min-height: 16rem;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    background-color: var(--ld-c-primary);
    box-shadow: var(--ld-shadow);
}
.ld-feat-inner {
    position: relative;
    z-index: 1;
    padding: 1.5rem 1.75rem;
    max-width: 32rem;
    color: #fff;
}
.ld-feat-badge {
    display: inline-block;
    background: var(--ld-c-primary);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: .2rem .55rem;
    border-radius: 9999px;
    margin-bottom: .5rem;
    letter-spacing: .02em;
}
.ld-feat-title { font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 700; margin: 0; color: #fff; }
.ld-feat-desc { color: rgba(255,255,255,.85); margin: .4rem 0 0; font-size: .95rem; }
.ld-feat-row { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
.ld-feat-price { font-size: 1.25rem; font-weight: 700; color: #fff; }
.ld-feat-btn {
    background: #fff;
    color: #111827;
    border: none;
    border-radius: var(--ld-r-btn);
    padding: .6rem 1.25rem;
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    transition: opacity .15s;
}
.ld-feat-btn:hover { opacity: .9; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* DARK SCHEME (bold / creative archetypes)                                     */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-catalog-page[data-scheme="dark"] { background: #0f1115; }
.ld-catalog-page[data-scheme="dark"] .ld-catalog-toolbar {
    background: transparent;
}
.ld-catalog-page[data-scheme="dark"] .ld-catalog-toolbar-inner {
    background: rgba(21, 24, 30, .88);
    border-color: rgba(255,255,255,.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.ld-catalog-page[data-scheme="dark"] .ld-catalog-title { color: #fff; }
.ld-catalog-page[data-scheme="dark"] .ld-catalog-subtitle { color: rgba(255,255,255,.6); }
.ld-catalog-page[data-scheme="dark"] .ld-cat-tab { color: rgba(255,255,255,.6); }
.ld-catalog-page[data-scheme="dark"] .ld-filter-open-btn {
    background: #1f242c;
    border-color: rgba(255,255,255,.12);
    color: rgba(255,255,255,.75);
}
.ld-catalog-page[data-scheme="dark"] .ld-filter-open-btn:hover,
.ld-catalog-page[data-scheme="dark"] .ld-filter-open-btn.ld-filter-open-active {
    background: color-mix(in srgb, var(--ld-c-primary) 18%, #1f242c);
    color: #fff;
}
.ld-catalog-page[data-scheme="dark"] .ld-cat-more-btn { color: rgba(255,255,255,.6); }
.ld-catalog-page[data-scheme="dark"] .ld-cat-more-menu {
    background: #15181e;
    border-color: rgba(255,255,255,.1);
}
.ld-catalog-page[data-scheme="dark"] .ld-cat-badge { background: rgba(255,255,255,.1); color: rgba(255,255,255,.7); }
.ld-catalog-page[data-scheme="dark"] .ld-results-count { color: rgba(255,255,255,.5); }
.ld-catalog-page[data-scheme="dark"] .ld-view-btn { background: #1f242c; color: rgba(255,255,255,.5); }
.ld-catalog-page[data-scheme="dark"] .ld-view-btn.active,
.ld-catalog-page[data-scheme="dark"] .ld-view-btn:hover { background: var(--ld-c-primary); color: #fff; }
.ld-catalog-page[data-scheme="dark"] .ld-view-toggle { border-color: rgba(255,255,255,.12); }
.ld-catalog-page[data-scheme="dark"][data-layout="sidebar"] .ld-cat-tab-active {
    background: color-mix(in srgb, var(--ld-c-primary) 18%, #1f242c);
}
.ld-catalog-page[data-scheme="dark"] .ld-product-card {
    background: #1b1f26;
    border-color: rgba(255,255,255,.08);
}
.ld-catalog-page[data-scheme="dark"] .ld-product-name { color: #fff; }
.ld-catalog-page[data-scheme="dark"] .ld-product-desc { color: rgba(255,255,255,.6); }
.ld-catalog-page[data-scheme="dark"] .ld-product-cat { color: rgba(255,255,255,.45); }
.ld-catalog-page[data-scheme="dark"] .ld-card-list-photo,
.ld-catalog-page[data-scheme="dark"] .ld-card-grid .ld-card-photo-wrap,
.ld-catalog-page[data-scheme="dark"] .ld-product-img-placeholder { background: #272c34; }
.ld-catalog-page[data-scheme="dark"] .ld-product-img-placeholder { color: #4b5563; }
.ld-catalog-page[data-scheme="dark"] .ld-editorial .ld-product-card,
.ld-catalog-page[data-scheme="dark"][data-layout="editorial"] .ld-product-card { border-color: rgba(255,255,255,.12); }

/* ─────────────────────────────────────────────────────────────────────────── */
/* RESPONSIVE TWEAKS                                                            */
/* ─────────────────────────────────────────────────────────────────────────── */
@media (max-width: 639px) {
    .ld-catalog-title { font-size: 1.5rem; }
    .ld-catalog-intro { padding-top: 1.25rem; }
    .ld-catalog-toolbar { padding: .75rem .75rem .25rem; }
    .ld-catalog-toolbar-inner {
        min-height: 3rem;
        padding: 0 .5rem;
        gap: .5rem;
    }
    .ld-cat-tab {
        min-height: 3rem;
        padding: 0 .75rem;
    }
    .ld-filter-open-btn {
        min-height: 2.15rem;
        padding: 0 .75rem;
    }
    .ld-modal-actions { flex-direction: column; }
    .ld-modal-add-btn { width: 100%; }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* SKELETON LOADER (shown while fetching catalog.json in large-catalog mode)   */
/* ─────────────────────────────────────────────────────────────────────────── */
@keyframes ld-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}
.ld-skeleton {
    border-radius: 6px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 800px 100%;
    animation: ld-shimmer 1.4s infinite linear;
}
/* Grid skeleton */
.ld-skeleton-card.ld-card-grid .ld-skeleton-photo {
    width: 100%;
    aspect-ratio: 1;
}
.ld-skeleton-card.ld-card-grid .ld-card-body {
    padding: .9rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.ld-skeleton-line { height: .875rem; border-radius: 4px; }
.ld-skeleton-title { width: 70%; }
.ld-skeleton-desc  { width: 90%; margin-top: .25rem; }
.ld-skeleton-price { width: 40%; height: 1rem; }
.ld-skeleton-btn   { width: 5.5rem; height: 2rem; border-radius: var(--ld-r-btn, 9999px); margin-left: auto; }
/* List skeleton */
.ld-skeleton-card.ld-card-list .ld-skeleton-photo-list {
    width: 104px;
    min-height: 104px;
    height: 100%;
    border-radius: var(--ld-r, 8px);
    flex-shrink: 0;
}
/* Dark scheme */
.ld-catalog-page[data-scheme="dark"] .ld-skeleton {
    background: linear-gradient(90deg, #2d3748 25%, #3d4a5c 50%, #2d3748 75%);
    background-size: 800px 100%;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* SEARCH OVERLAY (store-wide product search; opened from the navbar trigger)    */
/* ─────────────────────────────────────────────────────────────────────────── */
.ld-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding-top: max(8vh, calc(var(--ld-overlay-top, 0px) + 4rem));
}
.ld-search-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 17, 21, .55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.ld-search-overlay-panel {
    position: relative;
    width: min(640px, calc(100vw - 2rem));
    max-height: 76vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--ld-r-modal, 1rem);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
    overflow: hidden;
}
.ld-search-overlay-bar {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid #eef0f2;
}
.ld-search-overlay-icon { width: 1.25rem; height: 1.25rem; color: #9ca3af; flex-shrink: 0; }
.ld-search-overlay-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    color: #111827;
    background: transparent;
    min-width: 0;
}
.ld-search-overlay-close {
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ld-search-overlay-close svg { width: 1.1rem; height: 1.1rem; }
.ld-search-overlay-close:hover { background: #e5e7eb; }
.ld-search-overlay-results { overflow-y: auto; padding: .4rem; }
.ld-search-empty { padding: 2rem 1rem; text-align: center; color: #9ca3af; font-size: .95rem; }
.ld-search-section-title {
    padding: .75rem .65rem .35rem;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #9ca3af;
}
.ld-search-result {
    display: flex;
    align-items: center;
    gap: .8rem;
    width: 100%;
    padding: .55rem .65rem;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: .65rem;
    text-align: left;
}
.ld-search-result:hover { background: rgb(var(--ld-surface, 249 250 251)); }
.ld-search-result-photo,
.ld-search-result-photo-ph {
    width: 48px;
    height: 48px;
    border-radius: .5rem;
    object-fit: cover;
    flex-shrink: 0;
    background: #f3f4f6;
}
.ld-search-result-photo-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #d1d5db;
}
.ld-search-result-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ld-search-result-cat { font-size: .7rem; color: #9ca3af; }
.ld-search-result-name {
    font-size: .95rem;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ld-search-result-price { font-weight: 700; font-size: .95rem; flex-shrink: 0; }
