/* ============================================================
   חוט השני — Shared Stylesheet
   All pages link to this file. Page-specific styles live in
   a small <style> block within each HTML file.
   ============================================================ */

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
    --color-gold: #C5A880;
    --color-gold-hover: #A68A5E;
    --color-primary: #FF5A5F;
    --color-ink: #222222;
    --color-body: #3f3f3f;
    --color-muted: #6a6a6a;
    --color-hairline: #dddddd;
    --color-canvas: #ffffff;
    --color-surface: #f7f7f7;
    --color-whatsapp: #25D366;
    --rounded-sm: 6px;
    --rounded-md: 12px;
    --rounded-lg: 24px;
    --rounded-full: 9999px;
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
    --transition-base: 0.2s ease;
    --max-width: 1600px;
    --header-height: 80px;
}

/* ── RESET & BASE ────────────────────────────────────────── */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: clip;
}

body {
    font-family: 'Heebo', sans-serif;
    color: var(--color-body);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: var(--header-height);
}

img {
    max-width: 100%;
    display: block;
}

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

button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

p {
    line-height: 1.6;
}

/* ── HEADER ──────────────────────────────────────────────── */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    overflow: visible;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-bottom: none;
    box-shadow: none;
    transition: height 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

/* Gold shimmer line at bottom */
.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--color-gold) 30%, #e8d5b0 50%, var(--color-gold) 70%, transparent 100%);
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

/* Scrolled state — compact + elevated shadow */
.header.scrolled {
    height: 62px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 24px rgba(197, 168, 128, 0.12), 0 1px 0 rgba(197, 168, 128, 0.15);
}
.header.scrolled::after {
    opacity: 1;
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}
.header-logo:hover {
    transform: scale(1.03);
}

.header-logo img {
    height: 50px;
    width: auto;
    transition: height 0.3s ease;
    filter: drop-shadow(0 2px 6px rgba(197, 168, 128, 0.25));
}
.header.scrolled .header-logo img {
    height: 40px;
}

.header-nav {
    display: flex;
    gap: 32px;
}

.header-nav a {
    color: var(--color-ink);
    font-weight: 500;
    position: relative;
    transition: color var(--transition-base);
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    right: 0;
    left: 0;
    height: 1.5px;
    background: var(--color-gold);
    transform: scaleX(0);
    transition: transform 0.25s ease;
    transform-origin: right;
}

.header-nav a:hover::after,
.header-nav a.active::after {
    transform: scaleX(1);
}

.header-nav a:hover,
.header-nav a.active {
    color: var(--color-gold);
}

.header-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.header-actions button,
.header-actions a {
    color: var(--color-ink);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.header-actions a:hover,
.header-actions button:hover {
    background: rgba(197, 168, 128, 0.12);
    color: var(--color-gold);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(197, 168, 128, 0.25);
}
.header-actions a:active,
.header-actions button:active {
    transform: translateY(0) scale(0.93);
}

.header-actions svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    transition: stroke 0.2s ease;
}

/* Cart badge — gold pill */
.cart-badge-wrapper {
    position: relative;
}
.cart-badge {
    position: absolute;
    top: 3px;
    left: 3px;
    min-width: 17px;
    height: 17px;
    background: linear-gradient(135deg, var(--color-gold), #a8854a);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 1.5px solid white;
    box-shadow: 0 1px 4px rgba(197,168,128,0.5);
    line-height: 1;
}

/* ── FOOTER ──────────────────────────────────────────────── */
.footer {
    background: var(--color-ink);
    color: white;
    padding: 60px 32px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #ccc;
    transition: color var(--transition-base);
}

.footer-links a:hover {
    color: white;
}

.footer-copy {
    color: #888;
    font-size: 14px;
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn-gold {
    background: var(--color-gold);
    color: white;
    padding: 16px 40px;
    border-radius: var(--rounded-full);
    font-size: 18px;
    font-weight: 500;
    transition: background var(--transition-base);
    display: inline-block;
}

.btn-gold:hover {
    background: var(--color-gold-hover);
}

.btn-outline {
    border: 2px solid var(--color-gold);
    color: var(--color-gold);
    padding: 12px 32px;
    border-radius: var(--rounded-full);
    font-weight: 500;
    display: inline-block;
    transition: background var(--transition-base), color var(--transition-base);
}

.btn-outline:hover {
    background: var(--color-gold);
    color: white;
}

/* ── PRODUCT CARD ────────────────────────────────────────── */
.product-card {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    margin-bottom: 24px;
}

.image-ratio {
    position: relative;
    aspect-ratio: 4/5;
    border-radius: var(--rounded-md);
    overflow: hidden;
    background: var(--color-surface);
    margin-bottom: 16px;
}

.image-ratio img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
    position: absolute;
    inset: 0;
}

.img-hover {
    opacity: 0;
}

@media (hover: hover) {
    .product-card:hover .img-hover {
        opacity: 1;
    }
}

.badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--rounded-full);
}

.badge.pink {
    background: var(--color-primary);
}

.badge.dark,
.badge:not(.pink) {
    background: var(--color-ink);
}

.heart-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    outline: none;
    transition: background var(--transition-base);
}

.heart-btn:hover {
    background: white;
}

@keyframes heart-float-out {
    0%   { opacity: 1; transform: translate(0, 0) scale(0.5); }
    35%  { opacity: 1; transform: translate(calc(var(--dx) * .45), calc(var(--dy) * .45)) scale(1.25); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); }
}

.heart-btn svg {
    width: 16px;
    height: 16px;
    stroke: var(--color-ink);
    fill: none;
    stroke-width: 1.5;
    transition: fill 0.2s, stroke 0.2s;
}
.heart-btn.active svg {
    fill: var(--color-gold);
    stroke: var(--color-gold);
}
.heart-btn.active {
    background: white;
}

/* Heart button inside carousel items — always above the hover image layer */
.carousel-item { position: relative; }
.carousel-item .heart-btn {
    top: 10px;
    left: 10px;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.2s, background var(--transition-base);
}
/* Always visible on hover or when liked — stays visible even while image is swapping */
.carousel-item:hover .heart-btn,
.carousel-item .heart-btn.active { opacity: 1; }

/* ── CARD QUICK-ADD OVERLAY (shared by product.html carousel & index.html) ── */
.card-quick-add {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 16px;
    background: linear-gradient(0deg, rgba(26, 18, 7, 0.85) 0%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 4;
}
.product-card:hover .card-quick-add,
.carousel-item:hover .card-quick-add { opacity: 1; transform: translateY(0); }
.card-quick-add.in-cart { opacity: 1; transform: translateY(0); }

.card-quick-add-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #1a1207;
    border: none;
    border-radius: 50px;
    padding: 9px 22px;
    font-family: 'Heebo', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    outline: none;
}
.card-quick-add-btn:hover { background: var(--color-gold); color: #fff; }
.card-quick-add-btn svg { stroke: currentColor; flex-shrink: 0; }
.card-quick-add-btn.in-cart { background: var(--color-gold); color: #fff; }
.card-quick-add-btn.in-cart:hover { background: #a8845e; color: #fff; }
.card-quick-add-btn .qa-add { display: flex; align-items: center; gap: 7px; }
.card-quick-add-btn .qa-remove { display: none; align-items: center; gap: 7px; }
.card-quick-add-btn.in-cart .qa-add { display: none; }
.card-quick-add-btn.in-cart .qa-remove { display: flex; }

/* Heart button hidden by default on product-cards, show on hover or active */
.product-card .heart-btn { opacity: 0; transition: opacity 0.2s, background var(--transition-base); }
.product-card:hover .heart-btn,
.product-card .heart-btn.active { opacity: 1; }

/* Mobile: always show */
@media (max-width: 768px) {
    .product-card .heart-btn { opacity: 1; }
    .card-quick-add { opacity: 1; transform: translateY(0); }
}

.product-details {
    text-align: right;
}

.product-name {
    font-size: 18px;
    font-weight: 500;
    color: var(--color-ink);
}

.product-price {
    font-size: 16px;
    color: var(--color-muted);
    margin-top: 4px;
}

/* ── FILTER SIDEBAR ──────────────────────────────────────── */
.sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--color-hairline);
    padding-bottom: 8px;
}

.filter-header h3 {
    font-size: 18px;
    color: var(--color-ink);
}

.filter-reset {
    font-size: 14px;
    text-decoration: underline;
    color: var(--color-muted);
    cursor: pointer;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group h4 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--color-ink);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 15px;
    cursor: pointer;
}

.checkbox-item input {
    width: 16px;
    height: 16px;
    accent-color: var(--color-gold);
}

.item-count {
    color: var(--color-muted);
    font-size: 13px;
}

.color-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--color-hairline);
    cursor: pointer;
}

/* ── LAYOUT UTILITIES ────────────────────────────────────── */
.section {
    padding: 80px 32px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-title {
    font-size: 32px;
    color: var(--color-ink);
    text-align: center;
    margin-bottom: 40px;
}

.main-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
    padding: 32px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.page-title {
    padding: 40px 32px 0;
    font-size: 32px;
    color: var(--color-ink);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.loader {
    text-align: center;
    padding: 40px;
    color: var(--color-muted);
    font-size: 16px;
    grid-column: 1 / -1;
}

/* ── FORM ELEMENTS ───────────────────────────────────────── */
.input-field {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-sm);
    font-size: 15px;
    font-family: inherit;
    margin-bottom: 15px;
    transition: border-color var(--transition-base);
    outline: none;
}

.input-field:focus {
    border-color: var(--color-gold);
}

textarea.input-field {
    resize: vertical;
    min-height: 100px;
}

/* ── TYPOGRAPHY UTILITIES ────────────────────────────────── */
.text-gold {
    color: var(--color-gold);
}

.text-muted {
    color: var(--color-muted);
}

.text-ink {
    color: var(--color-ink);
}

/* ── DESIGN POLISH ───────────────────────────────────────── */
.blog-card {
    display: block;
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-md);
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.blog-card:hover {
    box-shadow: var(--shadow-card);
    transform: translateY(-2px);
}

.blog-card-img {
    height: 240px;
    background: var(--color-surface);
    overflow: hidden;
}

.blog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-card:hover .blog-card-img img {
    transform: scale(1.04);
}

.blog-card-content {
    padding: 24px;
}

.blog-card h3 {
    font-size: 20px;
    color: var(--color-ink);
    margin-bottom: 12px;
}

.blog-card p {
    color: var(--color-muted);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-link {
    color: var(--color-gold);
    font-weight: 500;
    text-decoration: underline;
}

/* Mobile filters toggle button (hidden on desktop) */
.show-filters-btn {
    display: none;
    padding: 10px 24px;
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-full);
    font-size: 15px;
    color: var(--color-ink);
    background: white;
    cursor: pointer;
    margin: 16px 32px 0;
    transition: border-color var(--transition-base);
}

.show-filters-btn:hover {
    border-color: #ccc;
}

.show-filters-btn.active {
    background: rgba(197,168,128,0.1);
    border-color: var(--color-gold);
    color: var(--color-gold);
}
.show-filters-btn.active:hover {
    background: rgba(197,168,128,0.18);
}

/* ── RESPONSIVE — TABLET ─────────────────────────────────── */
@media (max-width: 1024px) {
    .header {
        padding: 0 20px;
    }

    .header-nav {
        gap: 20px;
    }

    .main-container {
        grid-template-columns: 200px 1fr;
        gap: 24px;
        padding: 20px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .process-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section {
        padding: 60px 24px;
    }

    /* Checkout stacks on tablet */
    .checkout-wrapper {
        flex-direction: column;
    }

    .left-col,
    .right-col {
        width: 100%;
    }
}

/* ── MOBILE HAMBURGER BUTTON ─────────────────────────────── */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.2s ease;
}
.mobile-menu-btn:hover { background: var(--color-surface); }
.mobile-menu-btn .mhb {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-ink);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
                opacity 0.2s ease,
                width 0.3s ease;
    transform-origin: center;
}
.mobile-menu-btn.is-open .mhb:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.is-open .mhb:nth-child(2) { opacity: 0; width: 0; }
.mobile-menu-btn.is-open .mhb:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE DRAWER ───────────────────────────────────────── */
#mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 850;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
}
#mobile-drawer.md-open {
    visibility: visible;
    pointer-events: auto;
}
.md-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 10, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}
#mobile-drawer.md-open .md-backdrop { opacity: 1; }

.md-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(300px, 88vw);
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: -12px 0 48px rgba(0,0,0,0.14);
    overflow-y: auto;
    overflow-x: hidden;
}
#mobile-drawer.md-open .md-panel { transform: translateX(0); }

.md-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #f0e8d8;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}
.md-logo { height: 36px; width: auto; }
.md-close {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #f5f0e8;
    border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: #555;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.md-close:hover { background: #fde9b8; color: var(--color-gold); }

.md-nav { flex: 1; padding: 10px 0; }
.md-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    font-family: 'Assistant', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    border-right: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s, padding-right 0.15s;
    position: relative;
}
.md-link:hover, .md-link.md-active {
    background: #fdf8ee;
    color: var(--color-gold);
    border-right-color: var(--color-gold);
    padding-right: 26px;
}
.md-link svg { flex-shrink: 0; stroke: currentColor; fill: none; }
.md-sep { height: 1px; background: #f5efe3; margin: 4px 20px; }

.md-foot {
    padding: 16px 20px calc(env(safe-area-inset-bottom, 0px) + 24px);
    border-top: 1px solid #f0e8d8;
}
.md-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background: var(--color-gold);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: 'Assistant', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.15s;
}
.md-auth-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.md-auth-btn.md-account {
    background: transparent;
    color: var(--color-gold);
    border: 2px solid var(--color-gold);
}
.md-auth-btn.md-account:hover { background: #fdf8ee; transform: translateY(-1px); }

/* ── RESPONSIVE — MOBILE ─────────────────────────────────── */
@media (max-width: 768px) {
    body { padding-top: 62px; }
    /* Show hamburger, switch header to 3-zone grid */
    .mobile-menu-btn { display: flex; }

    .header {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        padding: 0 8px 0 12px;
        gap: 0;
        height: 62px;
    }
    .header.scrolled {
        height: 54px;
    }
    .header-logo {
        grid-column: 2; grid-row: 1;
        display: flex; justify-content: center; align-items: center;
    }
    .header-logo img {
        height: 42px !important;
    }
    .header.scrolled .header-logo img {
        height: 36px !important;
    }
    .header-nav { display: none !important; }
    .header-actions {
        grid-column: 3; grid-row: 1;
        justify-content: flex-end;
        justify-self: end;
        gap: 0;
    }
    .header-actions button,
    .header-actions a {
        width: 36px;
        height: 36px;
    }
    .header-actions svg {
        width: 18px;
        height: 18px;
    }
    .mobile-menu-btn {
        grid-column: 1; grid-row: 1;
        justify-self: start;
        width: 36px;
        height: 36px;
    }

    /* Override the previous rule that hid all action icons */
    .header-actions a { display: flex !important; }
    .header-actions .profile-dropdown-wrap { display: inline-flex !important; }
    /* Hide dropdown menu on touch devices */
    .profile-dropdown { display: none !important; }

    .header-actions a:not([href="checkout.html"]) {
        display: flex;
    }

    .show-filters-btn {
        display: inline-block;
    }

    .sidebar {
        display: none;
        position: static;
        margin-bottom: 24px;
    }

    .sidebar--open {
        display: block;
    }

    .main-container {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .process-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 48px 16px;
    }

    .page-title {
        padding: 24px 16px 0;
        font-size: 26px;
    }

    .section-title {
        font-size: 26px;
    }

    .btn-gold {
        padding: 14px 28px;
        font-size: 16px;
    }

    /* Left col comes second on mobile (order: summary below form) */
    .checkout-wrapper {
        flex-direction: column-reverse;
    }

    .left-col,
    .right-col {
        width: 100%;
        padding: 24px 16px;
    }

    .right-col {
        padding-top: 32px;
    }

    .footer-links {
        gap: 20px;
    }

    .footer {
        padding: 40px 16px;
    }

    /* Hearts always visible on mobile — no hover on touch screens */
    .carousel-item .heart-btn { opacity: 1; }
}