/* ============================================
   STOREFRONT SHARED — Composants reutilises
   entre storefront, catalogue, produit, checkout
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Cairo:wght@400;600;700;800&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --brand: #6366f1; --brand-light: #818cf8; --brand-dark: #4f46e5;
    --accent: #f59e0b; --accent-light: #fbbf24; --success: #10b981; --danger: #ef4444;
    --bg: #09090b; --bg-card: #141417; --bg-elevated: #1c1c21;
    --border: rgba(255,255,255,0.08); --border-hover: rgba(255,255,255,0.15);
    --text: #fafafa; --text-muted: #a1a1aa; --text-dim: #71717a;
    --radius: 14px; --radius-sm: 8px; --radius-full: 9999px;
    --font: 'Inter', 'Cairo', sans-serif;
}
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }

/* ---- TOP BAR ---- */
.topbar {
    background: var(--brand);
    text-align: center;
    padding: 8px 24px;
    font-size: 0.8rem;
    font-weight: 600;
}
.topbar span { color: var(--accent-light); }

/* ---- HEADER ---- */
.header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(9,9,11,0.85);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    max-width: 1280px; margin: 0 auto; padding: 0 24px;
    height: 68px; display: flex; align-items: center; justify-content: space-between;
}
.logo {
    font-size: 1.6rem; font-weight: 900; letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--brand-light), #38bdf8);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav { display: flex; gap: 28px; align-items: center; }
.nav a {
    font-size: 0.9rem; font-weight: 500; color: var(--text-muted);
    transition: color 0.2s; position: relative;
}
.nav a:hover, .nav a.active { color: var(--text); }
.nav a.active::after {
    content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
    height: 2px; background: var(--brand); border-radius: 1px;
}
.header-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn {
    width: 42px; height: 42px; border-radius: var(--radius-sm);
    background: var(--bg-elevated); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-muted); transition: all 0.2s; position: relative;
}
.icon-btn:hover { border-color: var(--border-hover); color: var(--text); }
.cart-count {
    position: absolute; top: -4px; right: -4px; width: 18px; height: 18px;
    background: var(--brand); border-radius: 50%; font-size: 0.65rem;
    font-weight: 700; display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--bg);
}
.mobile-menu { display: none; background: none; border: none; color: var(--text); cursor: pointer; }

/* ---- FOOTER ---- */
.sf-footer {
    background: var(--bg-card); border-top: 1px solid var(--border);
    padding: 60px 24px 30px;
}
.footer-grid {
    max-width: 1280px; margin: 0 auto;
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px;
}
.footer-brand .logo { margin-bottom: 12px; display: inline-block; }
.footer-brand p { color: var(--text-dim); font-size: 0.85rem; line-height: 1.7; max-width: 280px; }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a {
    width: 38px; height: 38px; border-radius: var(--radius-sm);
    background: var(--bg-elevated); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; transition: all 0.2s;
}
.footer-social a:hover { border-color: var(--brand); background: rgba(99,102,241,0.1); }
.footer-col h4 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 16px; }
.footer-col a { display: block; color: var(--text-muted); font-size: 0.9rem; padding: 5px 0; transition: color 0.2s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
    max-width: 1280px; margin: 0 auto; padding-top: 24px;
    border-top: 1px solid var(--border); display: flex;
    justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--text-dim);
}
.footer-payments { display: flex; gap: 8px; }
.footer-payments span { padding: 4px 10px; background: var(--bg-elevated); border-radius: 4px; font-size: 0.7rem; font-weight: 600; }

/* ---- CART DRAWER ---- */
.cart-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px); z-index: 200;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-drawer {
    position: fixed; top: 0; right: -440px; width: 420px; max-width: 90vw;
    height: 100vh; background: var(--bg-card); border-left: 1px solid var(--border);
    z-index: 201; display: flex; flex-direction: column;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.cart-drawer.open { right: 0; }

.cart-drawer-header {
    padding: 20px 24px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.cart-drawer-header h3 { font-size: 1.1rem; font-weight: 700; }
.cart-close {
    width: 36px; height: 36px; border-radius: 8px; background: var(--bg-elevated);
    border: 1px solid var(--border); display: flex; align-items: center;
    justify-content: center; cursor: pointer; color: var(--text-muted); transition: all 0.15s;
}
.cart-close:hover { color: var(--text); border-color: var(--border-hover); }

.cart-drawer-body { flex: 1; overflow-y: auto; padding: 16px 24px; }
.cart-item {
    display: flex; gap: 14px; padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img { width: 72px; height: 72px; border-radius: var(--radius-sm); flex-shrink: 0; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.cart-item-variant { font-size: 0.78rem; color: var(--text-dim); margin-bottom: 8px; }
.cart-item-bottom { display: flex; justify-content: space-between; align-items: center; }
.cart-item-price { font-weight: 700; font-size: 0.95rem; color: var(--brand-light); }
.cart-qty {
    display: flex; align-items: center; border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
.cart-qty button {
    width: 28px; height: 28px; background: var(--bg-elevated); border: none;
    color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
}
.cart-qty span { width: 32px; text-align: center; font-size: 0.85rem; font-weight: 600; background: var(--bg); }
.cart-remove {
    background: none; border: none; color: var(--text-dim); cursor: pointer;
    font-size: 0.78rem; transition: color 0.15s;
}
.cart-remove:hover { color: var(--danger); }

.cart-drawer-footer {
    padding: 20px 24px; border-top: 1px solid var(--border);
}
.cart-total-row { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.9rem; }
.cart-total-row .label { color: var(--text-muted); }
.cart-total-row.total { font-size: 1.1rem; font-weight: 800; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.cart-checkout-btn {
    width: 100%; padding: 16px; margin-top: 16px; border-radius: var(--radius);
    background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: white;
    border: none; font-family: var(--font); font-size: 1rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: 0 4px 20px rgba(99,102,241,0.3); transition: all 0.2s;
}
.cart-checkout-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(99,102,241,0.4); }
.cart-continue {
    display: block; text-align: center; margin-top: 12px; font-size: 0.85rem;
    color: var(--text-muted); cursor: pointer; background: none; border: none;
    font-family: var(--font); width: 100%; transition: color 0.15s;
}
.cart-continue:hover { color: var(--text); }

/* ---- PRODUCT CARD (reusable) ---- */
.product-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: all 0.3s;
}
.product-card:hover {
    border-color: var(--border-hover); transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}
.product-img { aspect-ratio: 1; overflow: hidden; position: relative; }
.product-badge {
    position: absolute; top: 12px; left: 12px; background: var(--danger);
    color: white; padding: 4px 12px; border-radius: var(--radius-full);
    font-size: 0.7rem; font-weight: 700;
}
.product-badge.new { background: var(--success); }
.product-wishlist {
    position: absolute; top: 12px; right: 12px; width: 36px; height: 36px;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: none; color: var(--text-muted); transition: all 0.2s;
}
.product-wishlist:hover { color: var(--danger); background: rgba(0,0,0,0.7); }
.product-info { padding: 16px; }
.product-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.stars { color: var(--accent); font-size: 0.8rem; }
.reviews { color: var(--text-dim); font-size: 0.8rem; }
.product-price-row { display: flex; align-items: center; justify-content: space-between; }
.product-price { font-size: 1.2rem; font-weight: 800; color: var(--brand-light); }
.product-price .old-price { font-size: 0.85rem; color: var(--text-dim); text-decoration: line-through; font-weight: 400; margin-left: 6px; }
.product-price .currency { font-size: 0.8rem; font-weight: 500; }
.add-to-cart {
    width: 38px; height: 38px; border-radius: var(--radius-sm);
    background: var(--brand); border: none; color: white;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
}
.add-to-cart:hover { background: var(--brand-dark); transform: scale(1.05); }

/* ---- BREADCRUMB ---- */
.breadcrumb {
    max-width: 1280px; margin: 0 auto; padding: 16px 24px;
    display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-dim);
}
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { color: var(--text-dim); }
.breadcrumb .current { color: var(--text-muted); }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .nav { display: none; }
    .mobile-menu { display: block; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .cart-drawer { width: 100%; max-width: 100vw; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
}
