/* =========================================================
   LURAN — Storefront module additions
   Variant-aware product cards, badges, and detail layout.
   This file is loaded after the existing app.css/components.css
   so it acts as a polish layer.
   ========================================================= */

/* =========================================================
   LURAN — Storefront module additions
   Variant-aware product cards, badges, and detail layout.
   This file is loaded after the existing app.css/components.css
   so it acts as a polish layer.
   ========================================================= */

/* ---------- Variant chips on product cards ---------- */
.variant-attrs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 8px;
}

.variant-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border: 1px solid var(--border-color, #e8e8f0);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    background: rgba(var(--brand-rgb, 183 132 116), 0.06);
    color: var(--text-primary, #2a2a3a);
    line-height: 1.3;
    white-space: nowrap;
}

.variant-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

/* ---------- Badge layout on product card image ----------
   Stack badges in two columns (start/end) using logical properties
   so RTL mirrors automatically. Solves the bug where sale-badge,
   variant-badge, oos-badge and wishlist all sat at top:12px and
   visually collided. Only structural — colors stay theme-driven. */
.product-card-img { position: relative; }

.product-card-img .badge-stack-start {
    position: absolute; top: 12px;
    inset-inline-start: 12px;
    display: flex; flex-direction: column; gap: 6px;
    z-index: 2; pointer-events: none;
}
.product-card-img .badge-stack-end {
    position: absolute; top: 12px;
    inset-inline-end: 12px;
    display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
    z-index: 2;
}
.product-card-img .badge-stack-start > * { pointer-events: auto; }

/* The sale-badge in app.css is absolute-positioned; reset that here
   so it flows inside the badge-stack-start container. */
.product-card-img .badge-stack-start .sale-badge {
    position: static;
    top: auto;
    left: auto;
    right: auto;
}

.variant-badge,
.oos-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 0.3px;
    backdrop-filter: blur(6px);
}
.variant-badge { background: rgba(var(--brand-rgb, 183 132 116), 0.92); color: #fff; }
.oos-badge { background: rgba(220, 53, 69, 0.92); color: #fff; }

/* Wishlist form sits as a flex item inside badge-stack-end — strip
   any earlier absolute positioning from the form/button. */
.product-card-img .wishlist-form { display: contents; }
.product-card-img .wishlist-form .product-card-wishlist {
    position: static;
    width: 36px; height: 36px;
}

/* ---------- Price in cards ---------- */
.product-card-price .price-current {
    font-weight: 700;
    color: var(--brand, #b78474);
    font-size: 1.05rem;
    margin-inline-end: 8px;
}

.product-card-price .price-old {
    text-decoration: line-through;
    color: var(--text-secondary, #888);
    font-size: 0.85rem;
}

/* ---------- Product detail responsive grid ---------- */
.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

@media (max-width: 880px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

/* ---------- Cart 2-column responsive ---------- */
.cart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 880px) {
    .cart-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Subtle hover lift for variant cards (so they feel discoverable) ---------- */
.product-card[data-variant-id]:not([data-variant-id=""]):not([data-variant-id="0"]):hover {
    transform: translateY(-3px);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.12);
}

/* ─────────────── Flash message fade ─────────────── */
#flash-message {
    transition: opacity 0.6s ease, transform 0.6s ease;
    scroll-margin-top: 90px;
}
#flash-message.flash-fade-out {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

/* ─────────────── Cart line variant chips (theme-aware) ─────────────── */
.cart-variant-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 10px;
}
.cart-variant-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 8px;
    border-radius: 999px;
    background: linear-gradient(
        135deg,
        rgba(var(--brand-rgb), 0.10) 0%,
        rgba(var(--brand-rgb), 0.18) 100%
    );
    border: 1px solid rgba(var(--brand-rgb), 0.22);
    font-size: 0.78rem;
    line-height: 1.2;
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.cart-variant-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(var(--brand-rgb), 0.18);
}
.cart-variant-chip-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cart-variant-chip-value {
    font-weight: 700;
    color: var(--brand);
}
.cart-variant-chip-swatch {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.18),
        inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* When chip starts with a swatch, tighten left padding so the swatch sits flush with the pill edge */
.cart-variant-chip:has(.cart-variant-chip-swatch) {
    padding-inline-start: 4px;
}

/* RTL */
[dir="rtl"] .cart-variant-chip-label {
    letter-spacing: 0;
}

/* ─────────────── Variant attribute selectors (theme-aware) ─────────────── */
.variant-attr-group {
    margin-bottom: 18px;
}
.variant-attr-label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.variant-attr-name {
    font-weight: 600;
}
.variant-attr-chosen {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.88rem;
}
.variant-attr-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.variant-attr-options--color {
    gap: 12px;
}

/* Text/size option button */
.variant-option-btn {
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    min-width: 48px;
    cursor: pointer;
    background: var(--bg-elevated, var(--bg-section));
    color: var(--text-primary);
    border: 1.5px solid rgba(var(--brand-rgb), 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.variant-option-btn:hover {
    border-color: var(--brand);
    color: var(--text-primary);
    transform: translateY(-1px);
}
.variant-option-btn.is-selected {
    border-color: var(--brand);
    background: rgba(var(--brand-rgb), 0.18);
    color: var(--brand);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.12);
}
.variant-option-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* Color swatch button (when attribute type === 'color') */
.variant-swatch-btn {
    --swatch-size: 38px;
    width: var(--swatch-size);
    height: var(--swatch-size);
    padding: 0;
    border-radius: 50%;
    background: transparent;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.variant-swatch-btn:hover { transform: scale(1.06); }
.variant-swatch-btn.is-selected {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.18);
}
.variant-swatch-color {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.variant-swatch-btn.is-selected .variant-swatch-color::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.78rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ─────────────── Review form card (theme-aware) ─────────────── */
.review-section {
    margin-top: 56px;
    scroll-margin-top: 90px;
}

.review-form-card {
    max-width: 720px;
    background: var(--bg-card);
    border: 1px solid rgba(var(--brand-rgb), 0.18);
    border-radius: 18px;
    padding: 32px 32px 28px;
    box-shadow: var(--shadow-md, 0 10px 25px rgba(0, 0, 0, 0.25));
    position: relative;
    overflow: hidden;
}
.review-form-card::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--brand), var(--brand-dark));
}

.review-form-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(var(--brand-rgb), 0.18);
}
.review-form-header > i {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(var(--brand-rgb), 0.14);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.review-form-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text-primary);
}
.review-form-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.55;
}

.review-field {
    margin-bottom: 18px;
}
.review-field label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}
.review-field input[type="text"],
.review-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid rgba(var(--brand-rgb), 0.25);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--bg-elevated, var(--bg-section));
    color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.review-field input[type="text"]::placeholder,
.review-field textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}
.review-field input[type="text"]:focus,
.review-field textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(var(--brand-rgb), 0.18);
}
.review-field textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.55;
}
.review-field-hint {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-align: end;
}

.review-rating-picker {
    display: flex;
    align-items: center;
    gap: 6px;
}
.review-star {
    background: none;
    border: none;
    padding: 4px;
    font-size: 1.7rem;
    color: rgba(var(--brand-rgb), 0.25);
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
    line-height: 1;
}
.review-star:hover { transform: scale(1.12); }
.review-star.is-active { color: #f5b73c; }
.review-rating-label {
    margin-inline-start: 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.review-submit {
    margin-top: 8px;
    min-width: 180px;
}

.review-form-card--guest {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
}
.review-form-card--guest > i {
    color: var(--brand);
    font-size: 1.6rem;
    opacity: 0.85;
}
.review-form-card--guest p {
    margin: 0;
    color: var(--text-secondary);
}
.review-form-card--guest a {
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
}
.review-form-card--guest a:hover { text-decoration: underline; }

/* RTL polish */
[dir="rtl"] .review-rating-picker { direction: ltr; }
[dir="rtl"] .review-field-hint { text-align: start; }

@media (max-width: 600px) {
    .review-form-card { padding: 22px 18px; border-radius: 14px; }
    .review-form-header { flex-direction: column; gap: 10px; }
    .review-form-header > i { width: 40px; height: 40px; font-size: 1.05rem; }
}

/* ═══════════════════════════════════════════════════════
   LURAN — Cart page polish (v2)
   Wider cart lines, structured product card, per-item note,
   stepper quantity, sticky summary.
   ═══════════════════════════════════════════════════════ */
.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.cart-count-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg,
        rgba(var(--brand-rgb), 0.10),
        rgba(var(--brand-rgb), 0.18));
    border: 1px solid rgba(var(--brand-rgb), 0.22);
    border-radius: 999px;
    font-weight: 600;
    color: var(--brand);
    font-size: 0.9rem;
}
.cart-count-pill i { font-size: 0.95rem; }

.cart-lines {
    display: grid;
    gap: 18px;
}

/* Outer cart line — overrides the legacy flat .cart-item from components.css.
   We keep the same class name for backwards-compatibility but switch to a
   richer body layout that hosts the per-item note panel. */
.cart-grid .cart-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 18px;
    padding: 20px;
    background: var(--bg-main);
    border: 1px solid rgba(var(--brand-rgb), 0.10);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    align-items: stretch;
}
.cart-grid .cart-item:hover {
    border-color: rgba(var(--brand-rgb), 0.25);
    box-shadow: 0 8px 24px -10px rgba(var(--brand-rgb), 0.18);
}
.cart-grid .cart-item-img {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-section);
}
.cart-grid .cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.cart-grid .cart-item:hover .cart-item-img img { transform: scale(1.04); }

.cart-item-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.cart-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.cart-grid .cart-item-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}
.cart-item-sku {
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: var(--bg-section);
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.cart-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px dashed rgba(var(--brand-rgb), 0.18);
    border-bottom: 1px dashed rgba(var(--brand-rgb), 0.18);
}
.cart-item-unit {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.92rem;
}
.cart-item-unit small {
    color: var(--text-muted);
    font-weight: 500;
    margin-inline-start: 4px;
}
.cart-item-row-total {
    font-weight: 800;
    color: var(--brand);
    font-size: 1.2rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.cart-qty-form {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cart-qty-control {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid rgba(var(--brand-rgb), 0.25);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-main);
}
.cart-qty-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.cart-qty-btn:hover {
    background: rgba(var(--brand-rgb), 0.12);
    color: var(--brand);
}
.cart-qty-input {
    width: 52px;
    height: 36px;
    border: 0;
    border-inline: 1.5px solid rgba(var(--brand-rgb), 0.20);
    text-align: center;
    font-weight: 700;
    color: var(--text-primary);
    background: transparent;
    -moz-appearance: textfield;
}
.cart-qty-input::-webkit-outer-spin-button,
.cart-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-qty-update i { font-size: 0.85rem; }
.cart-qty-update span { display: none; }
@media (min-width: 600px) { .cart-qty-update span { display: inline; } }

.cart-grid .cart-item-remove {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1.5px solid transparent;
    color: var(--danger, #d33);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.cart-grid .cart-item-remove:hover {
    background: rgba(var(--danger-rgb, 211 51 51), 0.10);
    border-color: rgba(var(--danger-rgb, 211 51 51), 0.30);
}

/* ── Per-item note panel ─────────────────────────────── */
.cart-item-note {
    margin-top: 4px;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg,
        rgba(var(--brand-rgb), 0.04),
        rgba(var(--brand-rgb), 0.09));
    border: 1px dashed rgba(var(--brand-rgb), 0.30);
    transition: border-color 0.2s ease, background 0.2s ease;
}
.cart-item-note.has-note {
    border-style: solid;
    border-color: rgba(var(--brand-rgb), 0.45);
    background: linear-gradient(135deg,
        rgba(var(--brand-rgb), 0.06),
        rgba(var(--brand-rgb), 0.14));
}
.cart-item-note-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
}
.cart-item-note-label i {
    color: var(--brand);
    font-size: 0.95rem;
}
.cart-item-note-product {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.cart-item-note-help {
    margin: 4px 0 10px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.5;
}
.cart-item-note-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cart-item-note textarea {
    width: 100%;
    min-height: 64px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1.5px solid rgba(var(--brand-rgb), 0.25);
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cart-item-note textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.12);
}
.cart-item-note-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.cart-item-note-counter {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.4px;
}
.cart-item-note-save i { font-size: 0.85rem; }

/* Sticky order-summary on the cart page (desktop) */
@media (min-width: 881px) {
    .cart-summary-sticky {
        position: sticky;
        top: 90px;
    }
}

/* ── Checkout: per-item note shown under each line ─────── */
.checkout-summary-line + .checkout-summary-line { margin-top: 4px; }
.checkout-summary-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 4px 0 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(var(--brand-rgb), 0.08);
    border-inline-start: 3px solid var(--brand);
    color: var(--text-primary);
    font-size: 0.82rem;
    line-height: 1.5;
}
.checkout-summary-note i {
    color: var(--brand);
    margin-top: 2px;
    flex-shrink: 0;
}

/* ── Order details: per-item note shown under each order line ── */
.order-item-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(var(--brand-rgb), 0.07);
    border-inline-start: 3px solid var(--brand);
    color: var(--text-primary);
    font-size: 0.86rem;
    line-height: 1.55;
    word-break: break-word;
}
.order-item-note i {
    color: var(--brand);
    margin-top: 3px;
    flex-shrink: 0;
    font-size: 0.85rem;
}

/* ── Visually hidden helper (label for screen-readers) ── */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Mobile cart line — collapse the image column */
@media (max-width: 560px) {
    .cart-grid .cart-item {
        grid-template-columns: 80px 1fr;
        padding: 14px;
    }
    .cart-grid .cart-item-img {
        width: 80px;
        height: 80px;
    }
    .cart-grid .cart-item-name { font-size: 0.98rem; }
    .cart-item-row-total { font-size: 1.05rem; }
    .cart-qty-update span { display: none; }
    .cart-item-actions { gap: 8px; }
    .cart-grid .cart-item-remove span { display: none; }
}

/* =================================================================
   Cart-line customization editor
   Renders for every cart line whose product has enable_customization=1.
   Editable inputs with debounced AJAX save; shows a tiny status pill
   ("Saving…" / "Saved") next to the title.
   ================================================================= */
.cart-item-customization {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(
        135deg,
        rgba(var(--brand-rgb), 0.06) 0%,
        rgba(var(--brand-rgb), 0.12) 100%
    );
    border: 1px solid rgba(var(--brand-rgb), 0.20);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.cart-item-customization.is-saving {
    border-color: rgba(var(--brand-rgb), 0.45);
}
.cart-item-customization.is-saved {
    border-color: rgba(40, 167, 69, 0.55);
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.10);
}
.cart-item-customization.is-error {
    border-color: rgba(220, 53, 69, 0.55);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.10);
}

.cart-item-customization-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}
.cart-item-customization-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--brand);
    font-weight: 600;
    font-size: 0.9rem;
}
.cart-item-customization-status {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    min-width: 60px;
    text-align: end;
}
.cart-item-customization.is-saving .cart-item-customization-status {
    color: var(--brand);
}
.cart-item-customization.is-saved .cart-item-customization-status {
    color: rgb(40, 167, 69);
}
.cart-item-customization.is-saved .cart-item-customization-status::before {
    content: '✓';
    margin-inline-end: 4px;
}
.cart-item-customization.is-error .cart-item-customization-status {
    color: rgb(220, 53, 69);
}

.cart-item-customization-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.85;
}
.cart-item-customization-hint i { font-size: 0.85rem; }

.cart-item-customization-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (max-width: 720px) {
    .cart-item-customization-fields { grid-template-columns: 1fr; }
}

.cart-item-customization-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cart-item-customization-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.cart-item-customization-field input,
.cart-item-customization-field textarea {
    width: 100%;
    padding: 9px 12px;
    border-radius: 9px;
    border: 1.5px solid rgba(var(--brand-rgb), 0.20);
    background: var(--bg-card, #fff);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cart-item-customization-field textarea {
    resize: vertical;
    min-height: 64px;
}
.cart-item-customization-field input:focus,
.cart-item-customization-field textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.18);
}

/* ─────────────── Review sort toggle pills ─────────────── */
.reviews-sort-pill {
    padding: 6px 14px;
    border-radius: 999px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
    background: transparent;
    border: none;
}
.reviews-sort-pill:hover { color: var(--text-primary); }
.reviews-sort-pill.is-active-pill {
    background: var(--brand);
    color: #fff;
}

/* ─────────────── Address picker pills on checkout ─────────────── */
.address-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--bg-section);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.address-pill:hover {
    border-color: var(--brand);
    transform: translateY(-1px);
}
.address-pill.is-selected {
    background: rgba(var(--brand-rgb), 0.14);
    border-color: var(--brand);
    color: var(--brand);
    font-weight: 700;
}
.address-pill i { color: var(--brand); font-size: 0.85rem; }
.address-pill.is-selected i { color: inherit; }

/* =========================================================
   Catalog listing — single-column layout with horizontal
   brand strip, top toolbar, and collapsible filter panel.
   Used by /products and /categories/{slug}.
   ========================================================= */

/* ---- Horizontal brand strip ---- */
.brand-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
    padding: 14px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e8e8f0);
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(15, 12, 25, 0.04);
}
.brand-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    background: var(--bg-section, #fafafa);
    border: 1px solid var(--border-color, #e8e8f0);
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.16s ease;
    white-space: nowrap;
}
.brand-pill:hover {
    border-color: var(--brand);
    color: var(--brand);
    transform: translateY(-1px);
}
.brand-pill.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 600;
}
.brand-pill-count {
    display: inline-block;
    min-width: 22px; text-align: center;
    padding: 1px 8px;
    background: rgba(var(--brand-rgb, 183 132 116), 0.18);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
}
.brand-pill.is-active .brand-pill-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* ---- Collapsible filter panel ---- */
.filter-panel {
    flex: 0 0 100%;
    width: 100%;
    margin-top: 14px;
    padding: 18px;
    background: var(--bg-section, #fafafa);
    border: 1px solid var(--border-color, #e8e8f0);
    border-radius: 12px;
}
[x-cloak] { display: none !important; }

.filter-panel-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 1fr) minmax(220px, 1fr) auto;
    gap: 18px;
    align-items: end;
}
.filter-panel-block { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.filter-panel-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
}
.filter-panel-select {
    padding: 9px 12px;
    border: 1px solid var(--border-color, #e8e8f0);
    border-radius: 8px;
    background: var(--bg-card, #fff);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}
.filter-panel-select:focus,
.filter-panel-select:hover {
    border-color: var(--brand);
    outline: none;
}
.filter-panel-checks { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 4px; }
.filter-check {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 4px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-primary);
}
.filter-check input[type="checkbox"] {
    accent-color: var(--brand);
    width: 16px; height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}
.filter-check-label { user-select: none; }

.filter-price-row {
    display: flex; align-items: center; gap: 8px;
}
.filter-price-input {
    flex: 1; min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--border-color, #e8e8f0);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--bg-card, #fff);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.filter-price-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 183 132 116), 0.12);
}
.filter-price-dash { color: var(--text-secondary); font-weight: 600; }

.filter-panel-actions {
    flex-direction: row;
    gap: 8px;
    align-items: stretch;
}
.filter-panel-actions .btn { white-space: nowrap; }

.catalog-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; flex-wrap: wrap;
    padding: 14px 18px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e8e8f0);
    border-radius: 14px;
    margin-bottom: 16px;
}
.catalog-toolbar-left { display: flex; flex-direction: column; gap: 2px; }
.catalog-title {
    font-size: 1.4rem; font-weight: 700; margin: 0;
    color: var(--text-primary); letter-spacing: -0.3px;
}
.catalog-count { font-size: 0.85rem; color: var(--text-secondary); margin: 0; }
.catalog-count strong { color: var(--brand); font-weight: 700; }

.catalog-toolbar-right { display: flex; align-items: center; gap: 10px; }
.catalog-filters-btn { display: none; }
.catalog-sort-form { margin: 0; }
.catalog-sort-select {
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    border: 1px solid var(--border-color, #e8e8f0);
    background: var(--bg-section, #fafafa);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 500;
    transition: border-color 0.15s ease;
}
.catalog-sort-select:hover { border-color: var(--brand); }
.catalog-sort-select:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 183 132 116), 0.12);
}

/* ---- Active filter chips ---- */
.active-filter-chips {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: rgba(var(--brand-rgb, 183 132 116), 0.05);
    border: 1px dashed rgba(var(--brand-rgb, 183 132 116), 0.3);
    border-radius: 12px;
}
.active-filter-chips-label {
    font-size: 0.8rem; font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.4px;
}
.filter-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e8e8f0);
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.15s ease;
}
.filter-chip:hover {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
    transform: translateY(-1px);
}
.filter-chip i { font-size: 0.7rem; opacity: 0.7; }
.filter-chip-clear {
    font-size: 0.78rem;
    color: #e11d2e;
    text-decoration: underline;
    margin-inline-start: auto;
    font-weight: 600;
}
.filter-chip-clear:hover { color: #b8141e; }

/* ---- Empty state ---- */
.catalog-empty {
    text-align: center;
    padding: 80px 24px;
    background: var(--bg-card, #fff);
    border: 1px dashed var(--border-color, #e8e8f0);
    border-radius: 16px;
}
.catalog-empty i {
    font-size: 3rem;
    color: var(--text-secondary);
    opacity: 0.4;
    margin-bottom: 16px;
}
.catalog-empty h2 {
    font-size: 1.4rem; font-weight: 700;
    margin: 0 0 8px; color: var(--text-primary);
}
.catalog-empty p { color: var(--text-secondary); margin: 0 0 20px; }

/* ---- Pagination wrapper ---- */
.catalog-pagination { margin-top: 28px; }

/* =========================================================
   Category hero + subcategory strip (used on /categories/{slug})
   ========================================================= */

.category-hero {
    position: relative;
    margin-bottom: 24px;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(var(--brand-rgb, 183 132 116), 0.08), rgba(var(--brand-rgb, 183 132 116), 0.02));
    padding: 36px 32px;
}
.category-hero.has-image { padding: 0; min-height: 220px; }
.category-hero.has-image .category-hero-content {
    position: relative; z-index: 2;
    padding: 36px 32px;
    color: #fff;
}
.category-hero-image { position: absolute; inset: 0; z-index: 1; }
.category-hero-image img { width: 100%; height: 100%; object-fit: cover; }
.category-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(15, 12, 25, 0.2), rgba(15, 12, 25, 0.65));
}
.category-hero-title {
    margin: 0 0 8px;
    font-size: 2rem; font-weight: 700;
    letter-spacing: -0.5px;
}
.category-hero-desc {
    margin: 0;
    max-width: 720px;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    opacity: 0.95;
}
.category-hero.has-image .category-hero-title { color: #fff; }
.category-hero.has-image .category-hero-desc { color: rgba(255, 255, 255, 0.92); }

.subcategory-strip {
    display: flex; flex-wrap: wrap; gap: 10px;
    margin-bottom: 24px;
}
.subcategory-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px 8px 8px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e8e8f0);
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.18s ease;
}
.subcategory-pill img {
    width: 28px; height: 28px;
    border-radius: 50%;
    object-fit: cover;
}
.subcategory-pill:hover {
    border-color: var(--brand);
    color: var(--brand);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--brand-rgb, 183 132 116), 0.18);
}

/* =========================================================
   Catalog filter-toggle button state when panel is open
   ========================================================= */
.catalog-filter-toggle.is-active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

/* =========================================================
   Section heading row (used on home for brands/featured/etc.)
   Title + subtitle on the left, "View all" link on the right.
   ========================================================= */
.section-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    margin-bottom: 28px;
}
.section-head-text { text-align: start; flex: 1; min-width: 220px; }
.section-head-text .section-title,
.section-head-text .section-subtitle { text-align: start; }
.section-head-link {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--brand);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(var(--brand-rgb, 183 132 116), 0.32);
    transition: all 0.18s ease;
    white-space: nowrap;
}
.section-head-link:hover {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

/* =========================================================
   Premium brand tiles on the home page — replaces the old
   grayscale logo-only cards. Each tile is a clickable link
   that lands on /products?brands[]=ID, with logo + name +
   product count and a subtle arrow that animates on hover.
   ========================================================= */
.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.brand-tile {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 18px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e8e8f0);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: all 0.22s ease;
    position: relative;
    overflow: hidden;
}
.brand-tile::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(var(--brand-rgb, 183 132 116), 0.12), transparent 60%);
    opacity: 0; transition: opacity 0.22s ease;
    pointer-events: none;
}
.brand-tile:hover {
    border-color: var(--brand);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(var(--brand-rgb, 183 132 116), 0.18);
}
.brand-tile:hover::before { opacity: 1; }
.brand-tile-logo {
    width: 56px; height: 56px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--bg-section, #fafafa);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border-color, #ececf2);
}
.brand-tile-logo img {
    max-width: 80%; max-height: 80%;
    object-fit: contain;
    filter: grayscale(40%);
    transition: filter 0.22s ease, transform 0.22s ease;
}
.brand-tile:hover .brand-tile-logo img {
    filter: grayscale(0);
    transform: scale(1.06);
}
.brand-tile-body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.brand-tile-name {
    margin: 0 0 2px;
    font-size: 0.98rem; font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand-tile-count {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.brand-tile-arrow {
    color: var(--brand);
    opacity: 0.4;
    font-size: 0.85rem;
    transition: all 0.22s ease;
    position: relative; z-index: 1;
}
.brand-tile:hover .brand-tile-arrow {
    opacity: 1;
    transform: translateX(4px);
}
[dir="rtl"] .brand-tile:hover .brand-tile-arrow {
    transform: translateX(-4px);
}

/* =========================================================
   Brands directory page (/brands) — large logo buttons in a
   responsive grid. Each card lands the buyer on a filtered
   /products view for that brand.
   ========================================================= */
.brands-page-header {
    text-align: center;
    margin: 16px 0 36px;
}
.brands-page-title {
    margin: 0 0 8px;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}
.brands-page-subtitle {
    margin: 0 auto;
    max-width: 600px;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.brands-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.brand-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 28px 20px 20px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e8e8f0);
    border-radius: 18px;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(.2, .8, .2, 1);
    box-shadow: 0 2px 12px rgba(15, 12, 25, 0.04);
}
.brand-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 0%, rgba(var(--brand-rgb, 183 132 116), 0.14), transparent 60%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
.brand-button:hover {
    border-color: var(--brand);
    transform: translateY(-4px);
    box-shadow: 0 18px 38px rgba(var(--brand-rgb, 183 132 116), 0.22);
}
.brand-button:hover::before { opacity: 1; }

.brand-button-logo-wrap {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--bg-section, #fafafa), #fff);
    border: 1px solid var(--border-color, #ececf2);
    display: flex; align-items: center; justify-content: center;
    padding: 18px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
    z-index: 1;
}
.brand-button-logo-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(20%);
    transition: filter 0.25s ease, transform 0.3s ease;
}
.brand-button:hover .brand-button-logo-wrap {
    transform: rotate(-3deg) scale(1.04);
    box-shadow: 0 12px 28px rgba(15, 12, 25, 0.10);
}
.brand-button:hover .brand-button-logo-wrap img {
    filter: grayscale(0);
    transform: scale(1.05);
}

.brand-button-info {
    z-index: 1;
    min-width: 0;
    width: 100%;
}
.brand-button-name {
    margin: 0 0 4px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand-button-meta {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.brand-button-count {
    display: inline-block;
    color: var(--brand);
    font-weight: 700;
    font-size: 1rem;
    margin-inline-end: 2px;
}

.brand-button-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 999px;
    background: rgba(var(--brand-rgb, 183 132 116), 0.10);
    color: var(--brand);
    font-size: 0.9rem;
    transition: all 0.22s ease;
    z-index: 1;
}
.brand-button:hover .brand-button-cta {
    background: var(--brand);
    color: #fff;
    transform: translateX(4px);
}
[dir="rtl"] .brand-button:hover .brand-button-cta {
    transform: translateX(-4px);
}

@media (max-width: 640px) {
    .brands-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .brand-button { padding: 20px 14px 16px; }
    .brand-button-logo-wrap { width: 90px; height: 90px; padding: 12px; }
    .brand-button-name { font-size: 0.95rem; }
    .brands-page-title { font-size: 1.5rem; }
}

/* =========================================================
   Responsive — filter panel
   ========================================================= */

@media (max-width: 992px) {
    .filter-panel-grid {
        grid-template-columns: 1fr 1fr;
    }
    .filter-panel-actions { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    .brand-strip { padding: 10px; }
    .brand-pill { padding: 6px 12px; font-size: 0.82rem; }
    .filter-panel-grid { grid-template-columns: 1fr; gap: 14px; }
    .catalog-toolbar { padding: 12px; }
    .catalog-toolbar-left { width: 100%; }
    .catalog-toolbar-right { width: 100%; justify-content: space-between; }
    .catalog-title { font-size: 1.2rem; }
    .category-hero { padding: 24px 18px; }
    .category-hero.has-image .category-hero-content { padding: 24px 18px; }
    .category-hero-title { font-size: 1.5rem; }
    .section-head-link { font-size: 0.85rem; padding: 6px 12px; }
}
