/* ── פלטת צבעים — מ-shneur-ashkenazi.websites.org.il (לפי בקשת רוני) ──────────
   ה-agent גרפיקה ממשיך מעל המשתנים האלה (אייקונים/מוקאפ) — לא דורס אותם. ──── */
:root {
    --primary:      #0f3a44; /* טיל כהה — כותרות, כפתור ראשי */
    --primary-dark: #082027;
    --accent:       #1596ae; /* טורקיז — לינקים, הדגשות */
    --gold:         #c9924f; /* זהב — מבטא, badges */
    --bg:           #f6faf9; /* רקע גלובלי */
    --bg-alt:       #eaf4f4; /* רקע חלופי (כרטיסים/סקשנים) */
    --text:         #1a1a1a;
    --text-soft:    #435356;
    --muted:        #5c7278;
    --border:       #dbe8e8;
    --highlight-bg: #fff6a0;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ──────────────────────────────────────────────────────────────────── */
body {
    font-family: 'Heebo', sans-serif;
    direction: rtl;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ── Header — כהה, כמו הכותרת של shneur-ashkenazi ────────────────────────────── */
.site-header {
    background: var(--primary-dark);
    border-bottom: 1px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
}

.main-nav a {
    margin-inline-start: 1.5rem;
    color: rgba(255,255,255,.82);
    font-weight: 600;
}
.main-nav a:hover { color: var(--gold); }
.nav-cart-icon-light { filter: brightness(0) invert(1); }

/* ── Main ──────────────────────────────────────────────────────────────────── */
.main-content {
    max-width: 1100px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    padding: 2rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-outline  { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-gold     { background: var(--gold); color: #fff; }
.btn-danger   { background: #c0392b; color: #fff; }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
input, textarea, select {
    font-family: inherit;
    font-size: 1rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(21,150,174,.15);
}

label { display: block; font-weight: 600; margin-bottom: 0.35rem; }

.form-group { margin-bottom: 1.25rem; }

/* ── Flash messages ─────────────────────────────────────────────────────────── */
.flash {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: 600;
}
.flash-success { background: #d4edda; color: #155724; }
.flash-error   { background: #f8d7da; color: #721c24; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .nav-container { flex-direction: column; gap: 0.5rem; }
    .main-nav a:first-child { margin-inline-start: 0; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Store track — קטלוג/ספר/עגלה/checkout/תשלום/מעקב הזמנה
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Nav cart badge ────────────────────────────────────────────────────────── */
.nav-cart { position: relative; display: inline-flex; align-items: center; }
.nav-cart-icon { width: 22px; height: 22px; vertical-align: middle; }
.cart-badge {
    position: absolute;
    top: -8px; inset-inline-end: -10px;
    background: var(--gold);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ── Hero card — כרטיס כהה מעוגל עם גרדיאנט, במקום פס בהיר שטוח ─────────────
   שכפול הסגנון מ-shneur-ashkenazi.websites.org.il: כרטיס טיל-כהה עם גרדיאנט
   עדין, אמבלם מוזהב-מוקף, קו מפריד מוזהב, וגריד כרטיסי-פיצ'ר כהים תחתיו. ──── */
.hero-card {
    background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    padding: 3rem 2rem 2.5rem;
    text-align: center;
    color: #fff;
    box-shadow: 0 12px 32px rgba(8,32,39,.28);
    margin: 2rem auto 3rem;
    max-width: 1100px;
}

.hero-emblem {
    width: 92px;
    height: 92px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    border: 2px solid var(--gold);
    box-shadow: 0 0 0 4px rgba(201,146,79,.18), 0 4px 18px rgba(0,0,0,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.04);
}
.hero-emblem-icon { width: 38px; height: 38px; color: var(--gold); }

.hero-card h1 { font-size: 2.1rem; font-weight: 800; margin-bottom: .35rem; }
.hero-tagline { color: rgba(255,255,255,.7); font-size: .95rem; margin-bottom: 1.1rem; }

.hero-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    color: var(--gold);
    font-weight: 700;
    font-size: 1.05rem;
    margin: 0 auto 1.1rem;
    max-width: 420px;
}
.hero-divider span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

.hero-desc {
    color: rgba(255,255,255,.82);
    max-width: 560px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    max-width: 640px;
    margin: 0 auto;
}
.hero-feature-card {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(201,146,79,.35);
    border-radius: 12px;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    color: #fff;
    font-weight: 700;
    transition: background .15s, transform .15s;
}
.hero-feature-card:hover { background: rgba(255,255,255,.1); transform: translateY(-2px); text-decoration: none; }
.hero-feature-icon { width: 28px; height: 28px; color: var(--gold); }

/* ── Catalog grid ──────────────────────────────────────────────────────────── */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}
.book-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: box-shadow 0.15s, transform 0.15s;
}
.book-card:hover { box-shadow: 0 4px 16px rgba(15,58,68,.12); transform: translateY(-2px); text-decoration: none; }
.book-cover-placeholder {
    aspect-ratio: 3 / 4;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    text-align: center;
}
.book-cover-placeholder.large { max-width: 280px; }
.book-cover-icon { width: 42px; height: 42px; opacity: 0.55; }
.book-cover-placeholder span {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.85rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-card-title { font-size: 1rem; color: var(--primary); margin: 0; }
.book-card-author { color: var(--muted); font-size: 0.85rem; margin: 0; }
.book-card-price { color: var(--gold); font-weight: 800; margin: 0; }

/* ── Book detail ───────────────────────────────────────────────────────────── */
.book-detail { display: grid; grid-template-columns: 280px 1fr; gap: 2.5rem; align-items: start; }
.book-detail-info h1 { color: var(--primary); margin-bottom: 0.3rem; }
.book-detail-author { color: var(--muted); margin-bottom: 1rem; }
.book-detail-description { margin: 1rem 0; color: var(--text-soft); }
.book-detail-specs { list-style: none; color: var(--text-soft); margin: 1rem 0; display: flex; flex-direction: column; gap: 0.25rem; }
.book-detail-price { font-size: 1.6rem; font-weight: 800; color: var(--gold); margin: 1rem 0; }
.add-to-cart-form { display: flex; align-items: flex-end; gap: 0.75rem; flex-wrap: wrap; }
.add-to-cart-form label { margin: 0; }
.add-to-cart-form input[type=number] { width: 80px; }
.btn-icon { width: 16px; height: 16px; vertical-align: -2px; filter: brightness(0) invert(1); }

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty-state { color: var(--muted); text-align: center; padding: 3rem 0; }

/* ── Tables (cart/order items) ────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; }
.cart-table, .order-items-table { width: 100%; border-collapse: collapse; background: #fff; }
.cart-table th, .cart-table td, .order-items-table th, .order-items-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: start;
}
.cart-table th, .order-items-table th { color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.cart-qty-form input[type=number] { width: 70px; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.85rem; }

.cart-summary, .order-total { margin-top: 1.5rem; text-align: end; }
.cart-summary p, .order-total p { margin: 0.25rem 0; color: var(--text-soft); }
.cart-total, .order-total-line { font-size: 1.2rem; margin-top: 0.5rem !important; }
.cart-actions { display: flex; gap: 1rem; justify-content: flex-end; margin-top: 1.5rem; flex-wrap: wrap; }

/* ── Checkout ──────────────────────────────────────────────────────────────── */
.checkout-note { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
.checkout-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2.5rem; align-items: start; }
.checkout-form h2 { color: var(--primary); font-size: 1.15rem; margin: 1.5rem 0 1rem; }
.checkout-form h2:first-child { margin-top: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.btn-block { width: 100%; text-align: center; margin-top: 1rem; }
.checkout-summary {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    position: sticky;
    top: 90px;
}
.checkout-summary h2 { color: var(--primary); font-size: 1.1rem; margin-bottom: 0.75rem; }
.checkout-summary p { color: var(--text-soft); margin: 0.25rem 0; }

/* ── Payment (pay.php / checkout_test_pay.php) ────────────────────────────── */
.pay-box, .test-pay-box { max-width: 560px; margin: 0 auto; text-align: center; }
.pay-amount { font-size: 1.3rem; margin: 0.75rem 0 1.25rem; color: var(--text-soft); }
.pay-iframe-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.pay-iframe { width: 100%; height: 640px; border: 0; display: block; }
.pay-note { color: var(--muted); font-size: 0.85rem; margin: 1rem 0; }
.test-pay-banner {
    background: var(--highlight-bg);
    color: var(--primary-dark);
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}
.test-pay-form { margin-top: 1rem; }

/* ── Order confirmation / tracking ────────────────────────────────────────── */
.order-confirmation h1, .order-confirmation h2 { color: var(--primary); }
.order-status { margin: 1rem 0; }
.order-meta { color: var(--muted); margin-top: 1.5rem; }
.flash-icon { width: 18px; height: 18px; vertical-align: -3px; margin-inline-end: 0.35rem; }
.track-order-form { max-width: 500px; margin-bottom: 2rem; }

/* ── Responsive (store) ───────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .book-detail { grid-template-columns: 1fr; }
    .book-detail-cover { max-width: 220px; margin: 0 auto; }
    .checkout-layout { grid-template-columns: 1fr; }
    .checkout-summary { position: static; }
    .form-row { grid-template-columns: 1fr; }
    .pay-iframe { height: 520px; }
}