/* ═══════════════════════════════════════════════════════════════════════════
   TAJIR STOREFRONT — Professional CSS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset / base ──────────────────────────────────────────────────────── */
.sf-body { scroll-behavior: smooth; }

/* ── Product Card ──────────────────────────────────────────────────────── */
.sf-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    border: 1px solid rgba(0,0,0,.06);
    transition: box-shadow .25s ease, transform .25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.sf-card:hover {
    box-shadow: 0 10px 36px rgba(0,0,0,.14);
    transform: translateY(-4px);
}
.sf-card-img {
    position: relative;
    overflow: hidden;
    height: 220px;
    background: #f5f6f8;
    flex-shrink: 0;
}
.sf-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
    display: block;
}
.sf-card:hover .sf-card-img img { transform: scale(1.08); }
.sf-card-img .placeholder-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 3rem;
}

/* Badges */
.sf-badge-tl {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}
.sf-badge-tr {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}
[dir="rtl"] .sf-badge-tl { left: auto; right: 10px; }
[dir="rtl"] .sf-badge-tr { right: auto; left: 10px; }

/* Add-to-cart hover overlay */
.sf-atc-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 10px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,.72));
    transform: translateY(100%);
    transition: transform .3s ease;
    z-index: 3;
    display: flex;
    gap: 8px;
}
.sf-card:hover .sf-atc-overlay { transform: translateY(0); }

/* Card body */
.sf-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.sf-card-cat {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #aaa;
    margin-bottom: 4px;
    font-weight: 500;
}
.sf-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
.sf-card-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #888;
}
.sf-card-rating i { font-size: 12px; }
.sf-card-price {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.sf-price-main {
    font-size: 18px;
    font-weight: 700;
    color: var(--store-primary);
    line-height: 1;
}
.sf-price-old {
    font-size: 13px;
    color: #bbb;
    text-decoration: line-through;
}

/* ── Navbar ────────────────────────────────────────────────────────────── */
.sf-navbar {
    background: #fff !important;
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
    padding: 0;
}
.sf-navbar .container { padding-top: 12px; padding-bottom: 12px; }
.sf-navbar-brand { font-size: 18px; font-weight: 700; text-decoration: none; }
.sf-nav-link {
    font-size: 14px;
    font-weight: 500;
    color: #555 !important;
    padding: 6px 12px !important;
    border-radius: 8px;
    transition: color .2s, background .2s;
    text-decoration: none;
}
.sf-nav-link:hover, .sf-nav-link.active { color: var(--store-primary) !important; background: rgba(var(--store-primary-rgb,.1,.1,.1), .08); }

/* Cart button */
.sf-cart-trigger {
    position: relative;
    background: none;
    border: 1.5px solid rgba(0,0,0,.12);
    border-radius: 50%;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    color: #444;
}
.sf-cart-trigger:hover { border-color: var(--store-primary); background: var(--store-primary); color: #fff; }
.sf-cart-badge {
    position: absolute;
    top: -4px; right: -4px;
    background: var(--store-primary);
    color: #fff;
    border-radius: 50%;
    width: 18px; height: 18px;
    font-size: 10px; font-weight: 700;
    display: none;
    align-items: center; justify-content: center;
    border: 2px solid #fff;
}
.sf-cart-badge.visible { display: flex; }
[dir="rtl"] .sf-cart-badge { right: auto; left: -4px; }

/* ── Category filter bar ───────────────────────────────────────────────── */
.sf-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 18px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    border: 1.5px solid rgba(0,0,0,.12);
    background: #fff;
    color: #555;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
}
.sf-cat-pill:hover { border-color: var(--store-primary); color: var(--store-primary); background: #fff; }
.sf-cat-pill.active { background: var(--store-primary); border-color: var(--store-primary); color: #fff; }
.sf-cat-pill .sf-pill-count { font-size: 11px; opacity: .75; }

/* ── Section title ─────────────────────────────────────────────────────── */
.sf-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sf-section-title::before {
    content: '';
    display: block;
    width: 4px; height: 22px;
    background: var(--store-primary);
    border-radius: 4px;
    flex-shrink: 0;
}

/* ── Hero ──────────────────────────────────────────────────────────────── */
.sf-hero {
    position: relative;
    min-height: 340px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--store-primary) 0%, var(--store-secondary) 100%);
}
.sf-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: .18;
}
.sf-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,.1), rgba(0,0,0,.3));
}
.sf-hero-content { position: relative; z-index: 1; }

/* ── Empty state ───────────────────────────────────────────────────────── */
.sf-empty { text-align: center; padding: 60px 24px; color: #aaa; }
.sf-empty i { font-size: 3.5rem; display: block; margin-bottom: 12px; opacity: .5; }
.sf-empty p { font-size: 15px; margin: 0; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.sf-footer { margin-top: 0; }
.sf-footer-social a {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    transition: background .2s;
    font-size: 16px;
}
.sf-footer-social a:hover { background: rgba(255,255,255,.3); }

/* ── Cart Drawer (Offcanvas) ───────────────────────────────────────────── */
.sf-offcanvas { width: 380px !important; }
@media (max-width: 480px) { .sf-offcanvas { width: 100vw !important; } }

.sf-cart-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #f2f2f2;
    align-items: flex-start;
}
.sf-cart-item-img {
    width: 68px; height: 68px;
    border-radius: 10px;
    object-fit: cover;
    background: #f5f6f8;
    flex-shrink: 0;
    border: 1px solid #eee;
}
.sf-cart-item-img.placeholder {
    display: flex; align-items: center; justify-content: center;
    color: #ccc; font-size: 1.5rem;
}
.sf-cart-item-info { flex: 1; min-width: 0; }
.sf-cart-item-name { font-size: 13px; font-weight: 600; color: #1a1a1a; line-height: 1.3; margin-bottom: 4px; }
.sf-cart-item-price { font-size: 14px; font-weight: 700; color: var(--store-primary); }
.sf-cart-qty {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}
.sf-cart-qty button {
    width: 26px; height: 26px;
    border: 1.5px solid #e0e0e0;
    background: #fff;
    border-radius: 6px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .2s, background .2s;
}
.sf-cart-qty button:hover { border-color: var(--store-primary); color: var(--store-primary); }
.sf-cart-qty span { min-width: 24px; text-align: center; font-size: 13px; font-weight: 600; }
.sf-cart-remove { color: #ccc; border: none; background: none; cursor: pointer; padding: 4px; transition: color .2s; }
.sf-cart-remove:hover { color: #e53e3e; }

.sf-cart-empty { text-align: center; padding: 48px 20px; color: #aaa; }
.sf-cart-empty i { font-size: 3rem; display: block; margin-bottom: 12px; opacity: .4; }

.sf-cart-footer { border-top: 1px solid #f2f2f2; padding-top: 16px; }
.sf-cart-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sf-cart-total-label { font-size: 15px; color: #666; }
.sf-cart-total-price { font-size: 22px; font-weight: 800; color: var(--store-primary); }

/* ── Toast notification ────────────────────────────────────────────────── */
.sf-toast-container { position: fixed; bottom: 24px; z-index: 9999; pointer-events: none; }
.sf-toast-container.ltr { right: 24px; }
.sf-toast-container.rtl { left: 24px; }
.sf-toast {
    background: #1a1a2e;
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    display: flex; align-items: center; gap: 8px;
    animation: sfToastIn .3s ease forwards;
    margin-top: 8px;
}
.sf-toast.removing { animation: sfToastOut .3s ease forwards; }
@keyframes sfToastIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sfToastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(16px); } }
.sf-toast i { font-size: 16px; color: #4ade80; }

/* ── Product grid pagination ──────────────────────────────────────────── */
.sf-pagination-list .page-link {
    color: var(--store-primary);
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 10px;
    margin: 0 4px;
    min-width: 42px;
    text-align: center;
    font-weight: 600;
    transition: all .2s ease;
}

.sf-pagination-list .page-item.active .page-link {
    background: var(--store-primary);
    border-color: var(--store-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

.sf-pagination-list .page-link:hover {
    border-color: var(--store-primary);
}

.sf-pagination-list .page-item.disabled .page-link {
    opacity: .5;
}

.sf-pagination-list .page-link:focus {
    box-shadow: none;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .sf-card-img { height: 180px; }
    .sf-hero { min-height: 260px; }
    .sf-section-title { font-size: 17px; }
}

/* ============================================================================
   PREMIUM LAYER (Amazon/Noon style) — appended. Applies to every theme via the
   shared _StoreTopBar utility bar + card/typography refinements.
   ============================================================================ */

/* ── Premium utility top bar ─────────────────────────────────────────────── */
.sf-topbar { background: var(--store-secondary, #14243b); color:#fff; position:sticky; top:0; z-index:1035; box-shadow:0 2px 14px rgba(0,0,0,.14); }
.sf-topbar-inner { max-width:1240px; margin:0 auto; display:flex; align-items:center; gap:16px; padding:10px 16px; }
.sf-tb-logo { color:#fff; font-weight:800; font-size:1.15rem; display:flex; align-items:center; gap:8px; white-space:nowrap; text-decoration:none; }
.sf-tb-logo:hover { color:#fff; }
.sf-tb-logo img { height:32px; }
.sf-tb-search { flex:1; display:flex; max-width:620px; }
.sf-tb-search input { border:none; border-radius:10px 0 0 10px; padding:.58rem .9rem; width:100%; font-size:.95rem; color:#1f2937; }
.sf-tb-search input:focus { outline:2px solid var(--store-primary); }
[dir=rtl] .sf-tb-search input { border-radius:0 10px 10px 0; }
.sf-tb-search button { border:none; background:var(--store-primary, #16a34a); color:#fff; padding:0 16px; border-radius:0 10px 10px 0; font-size:1.15rem; cursor:pointer; }
[dir=rtl] .sf-tb-search button { border-radius:10px 0 0 10px; }
.sf-tb-actions { display:flex; align-items:center; gap:4px; margin-inline-start:auto; }
.sf-tb-act { color:#fff; background:transparent; border:none; padding:6px 10px; border-radius:9px; display:flex; align-items:center; gap:6px; font-size:.85rem; line-height:1.12; transition:.15s; text-decoration:none; cursor:pointer; position:relative; }
.sf-tb-act:hover { background:rgba(255,255,255,.13); color:#fff; }
.sf-tb-act > i { font-size:1.35rem; }
.sf-tb-lbl { display:flex; flex-direction:column; text-align:start; }
.sf-tb-lbl small { opacity:.72; font-size:.66rem; }
.sf-tb-lbl b { font-weight:700; }
.sf-tb-badge { position:absolute; top:-2px; inset-inline-end:4px; background:var(--store-primary,#16a34a); color:#fff; border-radius:999px; font-size:.62rem; font-weight:700; min-width:16px; height:16px; display:flex; align-items:center; justify-content:center; padding:0 4px; }
.sf-tb-menu { cursor:pointer; }
.sf-tb-drop { position:absolute; inset-inline-end:0; top:calc(100% + 4px); background:#fff; color:#1f2937; border-radius:12px; box-shadow:0 14px 36px rgba(0,0,0,.20); min-width:210px; padding:6px; display:none; z-index:60; }
.sf-tb-menu:hover .sf-tb-drop, .sf-tb-drop:hover { display:block; }
.sf-tb-drop a { display:flex; align-items:center; gap:9px; padding:9px 12px; border-radius:8px; color:#374151; font-size:.9rem; text-decoration:none; }
.sf-tb-drop a:hover { background:#f3f4f6; color:var(--store-secondary); }
.sf-tb-drop form { margin:0; }
@media (max-width:640px){ .sf-tb-lbl small{display:none;} .sf-tb-lbl b{display:none;} .sf-tb-logo span{display:none;} }

/* ── Product card polish (all themes share .sf-card) ─────────────────────── */
.sf-card { border-radius:16px; border:1px solid #eef1f5; box-shadow:0 1px 3px rgba(16,24,40,.05); transition:transform .22s ease, box-shadow .22s ease; overflow:hidden; background:#fff; }
.sf-card:hover { transform:translateY(-5px); box-shadow:0 16px 32px rgba(16,24,40,.13); }
.sf-card-img img { transition:transform .4s ease; }
.sf-card:hover .sf-card-img img { transform:scale(1.06); }
.sf-card-title { font-weight:600; letter-spacing:-.01em; }
.sf-price-main { color:var(--store-secondary); font-weight:800; }
.sf-cat-pill { transition:transform .15s ease, box-shadow .15s ease; }
.sf-cat-pill:hover { transform:translateY(-2px); }
.sf-section-title { font-weight:800; letter-spacing:-.02em; position:relative; padding-inline-start:14px; }
.sf-section-title::before { content:""; position:absolute; inset-inline-start:0; top:50%; transform:translateY(-50%); width:5px; height:22px; border-radius:4px; background:var(--store-primary); }

/* Hero readability: Bootstrap gives headings a dark --bs-heading-color that beats the parent
   .text-white, so force the hero title/subtitle white (category pills are <a>, unaffected). */
.sf-hero-content h1, .sf-hero-content h2, .sf-hero-content p { color:#fff !important; }
.sf-hero-content h1 { text-shadow:0 2px 12px rgba(0,0,0,.18); }
