/* ═══════════════════════════════════════════════════════════
   storefront.css — shared design system for all listing pages
   brand_products, brands, category, sales, home, checkout
   ═══════════════════════════════════════════════════════════ */

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Body ───────────────────────────────────────────── */
body {
    background: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.84rem;
    color: #444;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ── Typography overrides ───────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #222;
    margin: 0;
}

/* ── Page wrapper ───────────────────────────────────── */
.page-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 14px 48px;
}
@media (max-width: 480px) { .page-wrap { padding: 0 10px 36px; } }

/* ── Page hero (title bar) ──────────────────────────── */
.page-hero {
    padding: 18px 16px 14px;
    background: #fff;
    border-bottom: 1px solid #fce4ec;
    text-align: center;
}
.page-hero h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #e91e63;
    margin: 0 0 3px;
}
.page-hero p {
    font-size: 0.78rem;
    color: #999;
    margin: 0;
}
.page-hero img {
    height: 46px;
    object-fit: contain;
    margin-bottom: 8px;
    border-radius: 8px;
}
@media (max-width: 480px) {
    .page-hero h1 { font-size: 1rem; }
}

/* ═══════════════════════════════════════════════════════
   FILTER BAR (sticky, same pattern as home.php)
   ═══════════════════════════════════════════════════════ */
.filter-bar {
    background: #fff;
    border-bottom: 1px solid #f5e6ec;
    padding: 0 16px;
    position: sticky;
    top: var(--header-h, 60px);
    z-index: 98;
    box-shadow: 0 2px 6px rgba(233,30,99,0.05);
}
.filter-bar-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 9px 0;
    max-width: 1400px;
    margin: 0 auto;
}
.filter-bar-inner::-webkit-scrollbar { display: none; }

.fb-label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #e91e63;
    font-weight: 600;
    font-size: 0.76rem;
    flex-shrink: 0;
    white-space: nowrap;
}
.fb-divider {
    width: 1px;
    height: 16px;
    background: #f5c6d8;
    flex-shrink: 0;
}
.fb-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 5px 24px 5px 11px;
    border: 1.5px solid #f0c0d0;
    border-radius: 30px;
    font-size: 0.74rem;
    font-family: 'Poppins', sans-serif;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='5'%3E%3Cpath d='M0 0l4.5 5L9 0z' fill='%23e91e63'/%3E%3C/svg%3E") no-repeat right 9px center;
    color: #555;
    cursor: pointer;
    flex-shrink: 0;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
.fb-select:focus  { border-color: #e91e63; box-shadow: 0 0 0 3px rgba(233,30,99,0.08); }
.fb-select.fb-active { border-color: #e91e63; background-color: #fff5f9; color: #e91e63; font-weight: 600; }

.fb-clear {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border: 1.5px solid #e91e63;
    border-radius: 30px;
    font-size: 0.72rem;
    font-family: 'Poppins', sans-serif;
    background: transparent;
    color: #e91e63;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    white-space: nowrap;
}
.fb-clear.fb-visible { display: flex; }
.fb-clear:hover { background: #e91e63; color: #fff; }

.fb-count {
    font-size: 0.7rem;
    color: #aaa;
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: auto;
    padding-right: 2px;
}

@media (max-width: 576px) {
    .fb-label-text { display: none; }
    .filter-bar { padding: 0 10px; }
}

/* ═══════════════════════════════════════════════════════
   PRODUCT GRID
   ═══════════════════════════════════════════════════════ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding-top: 14px;
}
@media (min-width: 480px)  { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px)  { .product-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(5, 1fr); gap: 16px; } }
@media (min-width: 1280px) { .product-grid { grid-template-columns: repeat(6, 1fr); } }

/* ═══════════════════════════════════════════════════════
   PRODUCT CARD  (compact — mobile-first)
   ═══════════════════════════════════════════════════════ */
.product-card {
    background: #fff;
    border: 1px solid #f0e6ec;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: box-shadow 0.22s, transform 0.22s;
    position: relative;
}
.product-card:hover {
    box-shadow: 0 8px 22px rgba(233,30,99,0.14);
    transform: translateY(-3px);
}

/* Image */
.product-img {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #faf5f8;
    overflow: hidden;
}
.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.38s ease;
}
.product-card:hover .product-img img { transform: scale(1.06); }

/* Quick-view pill */
.quick-view-btn {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translate(-50%, 6px);
    background: rgba(255,255,255,0.93);
    color: #e91e63;
    border: none;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.66rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.22s cubic-bezier(0.34,1.56,0.64,1);
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    z-index: 5;
}
.product-card:hover .quick-view-btn { opacity: 1; transform: translate(-50%, 0); }
.quick-view-btn:hover { background: #e91e63; color: #fff; }

/* Info block */
.product-info {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}
.product-info h5 {
    font-size: 0.76rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 2.12em;
}

/* Price states */
.price {
    font-size: 0.86rem;
    font-weight: 700;
    color: #e91e63;
    margin: 0;
}
.price-container { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.original-price  { font-size: 0.7rem;  color: #bbb; text-decoration: line-through; margin: 0; }
.discounted-price { font-size: 0.86rem; font-weight: 700; color: #e91e63; margin: 0; }
.savings {
    font-size: 0.65rem;
    color: #16a34a;
    font-weight: 600;
    background: rgba(22,163,74,0.09);
    padding: 2px 7px;
    border-radius: 20px;
    display: inline-block;
    width: fit-content;
}
.promo-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #7b1fa2;
    color: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.64rem;
    font-weight: 700;
    width: fit-content;
    margin-top: 2px;
}
.promo-tag.ship { background: #00796b; }

/* Action row */
.product-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 6px;
}
.btn-wishlist {
    background: transparent;
    border: 1.5px solid #f5c6d8;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #e91e63;
    font-size: 0.8rem;
    flex-shrink: 0;
    transition: all 0.2s;
    padding: 0;
}
.btn-wishlist:hover { background: #e91e63; border-color: #e91e63; color: #fff; }

.btn-cart {
    flex: 1;
    background: #e91e63;
    color: #fff;
    font-weight: 600;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.7rem;
    font-family: 'Poppins', sans-serif;
    line-height: 1.2;
}
.btn-cart:hover { background: #d81b60; }

/* Discount badges */
.discount-badge {
    position: absolute;
    top: 7px;
    left: 7px;
    color: #fff;
    padding: 3px 7px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.63rem;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.discount-badge--pct   { background: #e91e63; }
.discount-badge--fixed { background: #ff6f00; }
.discount-badge--bxgy  { background: #7b1fa2; }
.discount-badge--ship  { background: #00796b; }
.discount-badge--promo { background: #1565c0; }

/* ═══════════════════════════════════════════════════════
   BRAND GRID + CARDS
   ═══════════════════════════════════════════════════════ */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding-top: 14px;
}
@media (min-width: 480px)  { .brand-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 768px)  { .brand-grid { grid-template-columns: repeat(5, 1fr); gap: 14px; } }
@media (min-width: 1024px) { .brand-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 1280px) { .brand-grid { grid-template-columns: repeat(8, 1fr); } }

.brand-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 14px 10px 12px;
    text-align: center;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.brand-card:hover { box-shadow: 0 6px 18px rgba(233,30,99,0.13); transform: translateY(-3px); }
.brand-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    background: #fafafa;
}
.brand-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    word-break: break-word;
}
.no-logo {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 0.68rem;
}

/* ── Section letter heading ──────────────────────── */
.section-letter {
    font-size: 0.86rem;
    font-weight: 700;
    color: #e91e63;
    padding: 16px 0 6px;
    border-bottom: 2px solid #fce4ec;
    margin-bottom: 10px;
}

/* ── Results count bar ───────────────────────────── */
.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0 6px;
    font-size: 0.76rem;
    color: #aaa;
}
.results-bar strong { color: #444; }

/* ═══════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.13);
    width: 270px;
    display: flex;
    align-items: center;
    border-left: 4px solid #e91e63;
    animation: toastIn 0.22s ease;
    overflow: hidden;
    pointer-events: auto;
}
@keyframes toastIn {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.toast-icon    { padding: 11px; background: #fff5f9; color: #e91e63; font-size: 0.88rem; flex-shrink: 0; }
.toast-content { padding: 10px 8px; flex: 1; }
.toast-title   { font-size: 0.76rem; font-weight: 600; color: #333; line-height: 1.3; }
.toast-message { font-size: 0.68rem; color: #999; }
.toast-close   { padding: 11px; color: #ccc; cursor: pointer; font-size: 0.76rem; background: none; border: none; flex-shrink: 0; }
.toast.success { border-left-color: #16a34a; }
.toast.success .toast-icon { background: #f0fdf4; color: #16a34a; }
.toast.error   { border-left-color: #dc2626; }
.toast.error   .toast-icon { background: #fef2f2; color: #dc2626; }
.toast.info    { border-left-color: #2563eb; }
.toast.info    .toast-icon { background: #eff6ff; color: #2563eb; }

/* ═══════════════════════════════════════════════════════
   PRODUCT QUICK-VIEW MODAL
   ═══════════════════════════════════════════════════════ */
.product-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 10000;
    overflow-y: auto;
    animation: fadeIn 0.18s ease;
}
.product-modal.open { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    background: #fff;
    margin: 20px auto;
    border-radius: 16px;
    width: 92%;
    max-width: 460px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    animation: slideUp 0.22s ease;
}
@keyframes slideUp {
    from { transform: translateY(26px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.modal-header {
    padding: 13px 16px;
    border-bottom: 1px solid #f5e6ec;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff5f9;
}
.modal-title  { font-size: 0.86rem; font-weight: 700; color: #e91e63; }
.modal-close  {
    background: none; border: none; font-size: 1rem; color: #e91e63;
    cursor: pointer; width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(233,30,99,0.1); }
.modal-body   { padding: 14px 16px; }
.modal-image  { aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.modal-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-product-name  { font-size: 0.88rem; font-weight: 600; color: #222; margin-bottom: 5px; }
.modal-product-price { font-size: 1.1rem; font-weight: 700; color: #e91e63; margin-bottom: 13px; }
.modal-quantity {
    display: flex; align-items: center; justify-content: space-between;
    background: #f8f8f8; padding: 9px 13px; border-radius: 10px; margin-bottom: 11px;
}
.modal-quantity label { font-size: 0.8rem; font-weight: 500; }
.quantity-controls { display: flex; align-items: center; gap: 10px; }
.quantity-btn {
    width: 26px; height: 26px; border-radius: 50%; border: none;
    background: #e91e63; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 0.88rem;
}
.quantity-btn:hover { background: #d81b60; }
.quantity-input { width: 40px; text-align: center; border: 1px solid #ddd; border-radius: 6px; padding: 4px; font-size: 0.82rem; }
.modal-buttons { display: flex; gap: 8px; }
.modal-btn {
    flex: 1; padding: 10px; border: none; border-radius: 10px;
    font-size: 0.8rem; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    gap: 6px; transition: all 0.2s; font-family: 'Poppins', sans-serif;
}
.modal-btn-cart     { background: #e91e63; color: #fff; }
.modal-btn-cart:hover { background: #d81b60; }
.modal-btn-wishlist { background: transparent; color: #e91e63; border: 1.5px solid #e91e63; }
.modal-btn-wishlist:hover { background: rgba(233,30,99,0.07); }

/* ═══════════════════════════════════════════════════════
   LOADING + FLOATING CART
   ═══════════════════════════════════════════════════════ */
.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(255,255,255,0.75);
    display: flex; align-items: center; justify-content: center;
    z-index: 9998; visibility: hidden; opacity: 0; transition: all 0.2s;
}
.loading-overlay.active { visibility: visible; opacity: 1; }
.loading-spinner {
    width: 38px; height: 38px;
    border: 4px solid rgba(233,30,99,0.14);
    border-radius: 50%; border-top-color: #e91e63;
    animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.floating-cart {
    position: fixed;
    bottom: 22px; right: 16px;
    width: 50px; height: 50px;
    background: #e91e63;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(233,30,99,0.38);
    z-index: 500;
    transition: all 0.22s;
}
.floating-cart:hover { background: #d81b60; transform: scale(1.07); }
.floating-cart .cart-link {
    color: #fff; display: flex; align-items: center;
    justify-content: center; width: 100%; height: 100%;
    position: relative; text-decoration: none;
}
.floating-cart .cart-link i { font-size: 1.15rem; }
.floating-cart .cart-count {
    position: absolute; top: 0; right: 0;
    background: #fff; color: #e91e63;
    font-size: 0.58rem; font-weight: 700;
    width: 15px; height: 15px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1.5px solid #e91e63;
}

/* ═══════════════════════════════════════════════════════
   NO-RESULTS STATE
   ═══════════════════════════════════════════════════════ */
.no-results {
    text-align: center;
    padding: 44px 20px;
    color: #aaa;
    display: none;
}
.no-results.visible, .no-results[style*="block"] { display: block; }
.no-results i { font-size: 2.4rem; color: #f5c6d8; margin-bottom: 12px; display: block; }
.no-results h3 { font-size: 0.95rem; color: #777; margin: 0 0 5px; font-weight: 600; }
.no-results p  { font-size: 0.78rem; margin: 0; }

/* ═══════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .product-card, .brand-card, .btn-cart, .btn-wishlist { transition: none !important; }
    .quick-view-btn { transition: none !important; opacity: 1 !important; transform: translate(-50%, 0) !important; }
}

/* ═══════════════════════════════════════════════════════
   HOME PAGE OVERRIDES (smaller fonts site-wide)
   ═══════════════════════════════════════════════════════ */
.section-heading h2  { font-size: 1.25rem !important; letter-spacing: 0.3px !important; }
.product-carousel-section h2 { font-size: 1.2rem !important; }
.trust-badges .badge-item { font-size: 0.76rem; }
.trust-badges .badge-item i { font-size: 1.1rem; }
.category-item p { font-size: 0.72rem; }
