/* =============================================
   Birbilisim Portal — Frontend CSS (Responsive)
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:   #2563eb;
    --primary-d: #1d4ed8;
    --dark:      #0f172a;
    --text:      #1e293b;
    --muted:     #64748b;
    --border:    #e2e8f0;
    --bg:        #f8fafc;
    --white:     #ffffff;
    --radius:    10px;
    --shadow:    0 2px 12px rgba(0,0,0,.08);
    --header-h:  64px;
    --max-w:     1200px;
}

body { font-family: 'Segoe UI', system-ui, sans-serif; font-size: 15px; color: var(--text); background: var(--white); line-height: 1.6; }

a { color: inherit; text-decoration: none; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; width: 100%; box-sizing: border-box; }

/* ── HEADER ─────────────────────────────── */
.page-product-pdp .site-header {
    box-shadow: none !important;
    border-bottom: none !important;
}
.site-header {
    position: sticky; top: 0; z-index: 500;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 8px rgba(0,0,0,.06);
    height: var(--header-h);
    overflow: visible;
}
.header-inner {
    height: var(--header-h);
    display: flex; align-items: center; gap: 12px;
    min-width: 0;
    width: 100%;
}
.site-logo {
    display: flex; align-items: center; gap: 10px;
    min-width: 0; flex-shrink: 1; order: 0;
    overflow: hidden;
}
.site-logo img { max-width: 100%; height: auto; object-fit: contain; }
.logo-text  { font-size: 20px; font-weight: 800; color: var(--primary); letter-spacing: -.5px; }

/* Nav sits in the center via margin auto trick */
.site-nav { display: flex; align-items: center; gap: 4px; order: 1; flex: 1; justify-content: center; min-width: 0; }
.nav-link {
    padding: 7px 12px; border-radius: 6px;
    font-size: 14px; font-weight: 500; color: var(--muted);
    transition: color .2s, background .2s; white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--bg); }
.nav-link.nav-btn {
    background: var(--primary); color: var(--white); padding: 7px 18px;
}
.nav-link.nav-btn:hover { background: var(--primary-d); }

/* User+Cart always right */
.hdr-user-wrap {
    display: flex; align-items: center; gap: 6px;
    flex-shrink: 0; order: 2; margin-left: auto;
    min-width: 0;
}
.hdr-search-wrap { flex-shrink: 1; min-width: 0; }
.hdr-search-wrap.hdr-search-bar .hdr-search-form { min-width: 0; flex: 1; }
.hdr-search-wrap.hdr-search-bar .hdr-search-inp { min-width: 0; }

.nav-toggle {
    display: none; flex-direction: column; gap: 5px; flex-shrink: 0;
    background: none; border: none; cursor: pointer; padding: 4px;
}
/* nav-toggle inside hdr-user-wrap: no fixed order, follows flex flow */
.hdr-user-wrap .nav-toggle { order: unset; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* ── HERO ────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: var(--white);
    padding: 80px 0 90px;
    text-align: center;
}
.hero-title { font-size: clamp(28px,5vw,52px); font-weight: 800; margin-bottom: 16px; letter-spacing: -.5px; }
.hero-desc  { font-size: clamp(15px,2.5vw,20px); opacity: .85; max-width: 640px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-hero {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 13px 28px; border-radius: 10px; font-size: 15px; font-weight: 600;
    background: var(--primary); color: #fff; border: none; cursor: pointer;
    font-family: inherit; text-decoration: none;
    transition: background .2s, transform .1s, box-shadow .2s;
}
.btn-hero:hover { background: var(--primary-d); box-shadow: 0 4px 16px rgba(37,99,235,.3); transform: translateY(-1px); }
.btn-hero:active { transform: translateY(0); }
@keyframes fadeIn { from { opacity:0; transform:scale(.97); } to { opacity:1; transform:scale(1); } }
.btn-hero-outline {
    background: transparent; border: 2px solid rgba(255,255,255,.6); color: var(--white);
}
.btn-hero-outline:hover { background: rgba(255,255,255,.1); }

/* ── SECTIONS ────────────────────────────── */
.section     { padding: 64px 0; }
.section-alt { background: var(--bg); }
.section-title { font-size: 26px; font-weight: 700; margin-bottom: 32px; color: var(--dark); }

/* ── PRODUCTS ────────────────────────────── */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 20px; }
.product-card-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}
.product-card {
    background: var(--white); border-radius: var(--radius);
    border: 1px solid var(--border); overflow: hidden;
    box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s;
}
.product-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.12); transform: translateY(-2px); }
/* Ürün kartı görseli: mağaza en-boy oranı (--product-img-aspect-*) layout’tan gelir */
.product-img-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    aspect-ratio: var(--product-img-aspect-w, 1) / var(--product-img-aspect-h, 1);
    max-height: var(--product-list-max-h, 440px);
    background: var(--bg);
}
.product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: var(--product-list-object-fit, cover);
    display: block;
}
.product-card-list-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    z-index: 1;
    border-radius: 3px;
}
.product-img-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    background: var(--bg);
    color: var(--muted);
}
.product-info   { padding: 14px 16px; }
.product-name   { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.product-price  { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.btn-product {
    display: inline-block; padding: 8px 20px; border-radius: 6px; font-size: 13px; font-weight: 600;
    background: var(--primary); color: var(--white); transition: background .2s;
}
.btn-product:hover { background: var(--primary-d); }

/* ── CAMPAIGNS ───────────────────────────── */
.campaign-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 20px; }
.campaign-card  {
    background: var(--white); border-radius: var(--radius); padding: 22px;
    border: 1px solid var(--border); box-shadow: var(--shadow);
}
.campaign-title    { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.progress-bar-wrap { background: var(--border); border-radius: 99px; height: 10px; overflow: hidden; margin-bottom: 8px; }
.progress-bar      { background: var(--primary); height: 100%; border-radius: 99px; transition: width .6s ease; }
.campaign-stats    { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.raised            { font-weight: 700; color: var(--primary); }
.percent           { font-weight: 700; color: var(--muted); }
.campaign-deadline { font-size: 12px; color: var(--muted); margin-bottom: 14px; }

/* ── FOOTER ──────────────────────────────── */
.site-footer { background: var(--dark); color: #94a3b8; padding: 40px 0 24px; margin-top: 64px; }
.footer-inner { display: grid; grid-template-columns: 1fr auto auto; align-items: start; gap: 32px; }
.footer-brand .logo-text { color: var(--white); font-size: 18px; }
.footer-brand p { margin-top: 8px; font-size: 13px; max-width: 320px; line-height: 1.6; }
.footer-social  { display: flex; gap: 10px; align-items: flex-start; }
.social-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 6px;
    background: rgba(255,255,255,.08); color: #cbd5e1; font-size: 11px; font-weight: 700;
    transition: background .2s;
}
.social-link:hover { background: var(--primary); color: var(--white); }
.footer-copy    { color: #64748b; font-size: 12px; align-self: end; white-space: nowrap; }

/* ── PRODUCT CARD (tıklanabilir) ──────── */
a.product-card {
    display:flex; flex-direction:column; text-decoration:none; color:inherit;
    -webkit-tap-highlight-color: transparent;
}
.product-card-wrap > a.product-card {
    flex: 1 1 auto;
    min-height: 0;
}
.product-card-wrap a.product-wish-btn {
    -webkit-tap-highlight-color: transparent;
}
a.product-card:hover { box-shadow:0 8px 24px rgba(0,0,0,.12); transform:translateY(-2px); }
a.product-card:focus,
a.product-card:focus-visible { outline: none; }
.product-img-wrap {
    position: relative;
    contain: layout;
    overflow: hidden;
    border-radius: 10px;
}
/* Favori: kart sarmalayıcı üzerinde; ürün linki ile iç içe <a> olmaz */
.product-card-wrap .product-wish-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 6;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: color 0.2s, background 0.2s, transform 0.15s;
}
.product-card-wrap .product-wish-btn:hover,
.product-card-wrap .product-wish-btn.in-wishlist {
    color: #dc2626;
    background: #fff;
}
.product-card-wrap .product-wish-btn.in-wishlist {
    box-shadow: 0 0 0 2px #fecaca, 0 4px 14px rgba(220, 38, 38, 0.18);
}
.product-price-wrap { display:flex; align-items:baseline; gap:8px; }
.product-price-old  { text-decoration:line-through; color:#94a3b8; font-size:13px; }
.product-price.sale { color:#16a34a; }
.product-category-tag { display:inline-block; font-size:11px; color:#64748b; background:#f1f5f9; padding:3px 8px; border-radius:6px; margin-bottom:6px; }

/* ── SHOP PAGE ────────────────────────── */
.shop-header { background:var(--bg); border-bottom:1px solid var(--border); padding:24px 0; }
.shop-filters { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.shop-filters .form-control { padding:8px 12px; border:1px solid var(--border); border-radius:6px; font-size:14px; background:var(--white); }
.shop-filters .btn-product { padding:9px 18px; }

/* ── CART ICON ────────────────────────── */
.cart-icon { position:relative; display:inline-flex; align-items:center; padding:6px 8px; }
.cart-badge { position:absolute; top:0; right:0; background:#ef4444; color:#fff; font-size:10px; font-weight:700; min-width:16px; height:16px; border-radius:8px; display:flex; align-items:center; justify-content:center; padding:0 3px; }

/* ── COLOR SWATCHES — yuvarlatılmış dikdörtgen ────────── */
.color-swatch { width:52px; height:52px; border-radius:10px; border:2px solid #e2e8f0; overflow:hidden; display:inline-flex; flex-direction:column; align-items:center; text-decoration:none; transition:border-color .2s,transform .15s,box-shadow .15s; flex-shrink:0; position:relative; }
.color-swatch img { width:100%; height:100%; object-fit:cover; }
.color-swatch:hover { border-color:var(--primary); transform:translateY(-2px); box-shadow:0 4px 12px rgba(37,99,235,.18); }
.color-swatch.active { border-color:var(--primary); box-shadow:0 0 0 3px rgba(37,99,235,.2); }
.color-swatch small { position:absolute; bottom:-20px; left:50%; transform:translateX(-50%); font-size:10px; white-space:nowrap; color:#64748b; }
@media (max-width: 900px) {
    .footer-inner { grid-template-columns: 1fr; gap: 20px; }
}



/* ── Breadcrumb ─────────────────────────────── */
.breadcrumb-bar { background: #f8fafc; border-bottom: 1px solid #e2e8f0; padding: 10px 0; }
.breadcrumb-list { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.breadcrumb-list li { display: flex; align-items: center; }
.breadcrumb-list a { color: #64748b; text-decoration: none; transition: color .15s; }
.breadcrumb-list a:hover { color: var(--primary); }
.breadcrumb-list svg { color: #cbd5e1; margin: 0 2px; }
.breadcrumb-list .current { color: #1e293b; font-weight: 500; }
.page-product-pdp .breadcrumb-bar {
    background: transparent;
    border-bottom: none;
    box-shadow: none;
    padding: 0 0 12px;
}

/* ── Responsive — Tüm sayfalar ─────────────── */
@media (max-width: 900px) {
    .footer-inner { grid-template-columns: 1fr; gap: 24px; }
    .footer-brand p { max-width: 100%; }
}

@media (max-width: 768px) {
    /* Header */
    .site-header { position: relative; overflow: visible; }
    .site-header .container { padding-left: 12px; padding-right: 12px; }
    .header-inner { gap: 6px; }
    .site-logo { max-width: min(140px, 45vw); }
    .site-logo img { max-height: 40px !important; object-fit: contain; }
    .site-nav {
        display: none; flex-direction: column; align-items: stretch; flex: unset;
        position: absolute; top: var(--header-h); left: 0; right: 0;
        background: var(--white); border-bottom: 1px solid var(--border);
        padding: 12px 20px; gap: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.1);
        z-index: 600; order: 99;
    }
    .site-nav.open { display: flex; }
    .nav-toggle { display: flex; flex-shrink: 0; }
    /* hdr-user-wrap stays visible, compact */
    .hdr-user-wrap { order: 2; margin-left: auto; gap: 4px; flex-shrink: 0; }
    .hdr-btn-label { display: none; }
    .hdr-oturum-btn { padding: 6px 8px; gap: 4px; font-size: .82rem; min-width: 0; }
    .hdr-cart-btn, .hdr-search-expand-btn { width: 36px; height: 36px; }
    /* Bar style search: full width on mobile */
    .hdr-search-wrap.hdr-search-bar { flex: 1; min-width: 0; }
    .hdr-search-wrap.hdr-search-bar .hdr-search-form { width: 100%; flex: 1; }
    .hdr-search-wrap.hdr-search-bar .hdr-search-inp { width: 100% !important; min-width: 0; flex: 1; }
    /* Prevent body overflow on mobile */
    body { overflow-x: hidden; max-width: 100vw; }
    /* body bottom padding for mobile footer menu */
    body.has-mobile-menu { padding-bottom: 68px; }
    /* Hide desktop-only label on mobile, but keep cart visible */
    .hdr-cart-desktop { display: flex !important; }
    .hdr-btn-label { display: none; }

    /* Hero */
    .hero { padding: 56px 0 60px; }
    .section { padding: 44px 0; }

    /* Products */
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 14px; }
    .campaign-grid { grid-template-columns: 1fr; }

    /* Auth pages */
    .auth-page-wrap { padding: 24px 16px 48px; }
    .auth-card { max-width: 100%; }
    .auth-body { padding: 20px; }
    .auth-header { padding: 24px 20px 20px; }

    /* Cart */
    .cart-wrap { padding: 20px 12px 48px; }
    .cart-layout { grid-template-columns: 1fr !important; }
    .cart-summary { position: static !important; }
    .cart-item { flex-wrap: wrap; gap: 12px; }
    .cart-item-right { width: 100%; justify-content: space-between; margin-left: 96px; }
    .cart-title { font-size: 20px; }

    /* Checkout */
    .co-wrap { padding: 20px 12px 48px; }
    .co-layout { grid-template-columns: 1fr !important; }
    .co-summary { position: static !important; display: none !important; }
    #mobileSummary { display: block !important; }
    .co-form-row { grid-template-columns: 1fr !important; }
    .auth-tabs-header { font-size: 13px; }
    .auth-tab-btn { padding: 12px 8px; font-size: 13px; }
    .co-steps { font-size: 12px; }
    .co-step-num { width: 22px; height: 22px; font-size: 11px; }

    /* Checkout 3-col address row */
    [style*="grid-template-columns:1fr 1fr 120px"] { grid-template-columns: 1fr 1fr !important; }

    /* Footer cols */
    .footer-inner { grid-template-columns: 1fr !important; }
    .footer-social { margin-bottom: 10px; }
    .footer-copy { align-self: flex-start; }
    
    /* General Responsive Fixes */
    img { max-width: 100%; height: auto; }
    .container { padding: 0 16px; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr 1fr; }
    .hero-title   { font-size: 26px; }

    /* Cart compact */
    .cart-item-img, .cart-item-img-ph { width: 60px; height: 60px; }
    .cart-item-right { margin-left: 72px; }
    .qty-wrap { scale: .9; }

    /* Auth tab icons — sadece text */
    .auth-tab-btn svg { display: none; }

    /* Checkout */
    .co-greeting { flex-wrap: wrap; }
    [style*="grid-template-columns:1fr 1fr 1fr"] { grid-template-columns: 1fr !important; }
}
