/* =================================================================
   Sheshet shop & admin shared styles.
   Mirrors the design language of the existing pages (index.html etc):
   gold/cream/brown palette, Frank Ruhl Libre + Cormorant Garamond.
   ================================================================= */

:root {
    --gold: #B5A064;
    --gold-light: #D4C78F;
    --gold-dark: #8A7A4A;
    --cream: #FAF7F2;
    --cream-dark: #F0EBE1;
    --brown: #4A3F35;
    --brown-light: #6B5D4F;
    --white: #FFFFFF;
    --rose: #C4A4A0;
    --rose-light: #E8D5D0;
    --red: #B85450;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Frank Ruhl Libre', serif;
    background-color: var(--cream);
    color: var(--brown);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

a { color: var(--brown); text-decoration: none; }

/* ---------- Navbar — matches the existing bags.html / jewelry.html navbars ---------- */
.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 900;
    padding: 14px 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(250, 247, 242, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}

[lang="en"] .nav-links a,
[lang="en"] body {
    font-family: 'Cormorant Garamond', serif;
}

.lang-switch {
    position: absolute;
    left: 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.8rem;
    color: var(--brown-light);
    letter-spacing: 0.5px;
    padding: 4px 0;
}

.lang-switch:hover { color: var(--gold); }

[dir="ltr"] .lang-switch { left: auto; right: 20px; }

.nav-links {
    display: flex;
    gap: 40px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--brown);
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 1px;
    cursor: pointer;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 0;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width 0.3s ease;
}

[dir="ltr"] .nav-links a::after { right: auto; left: 0; }

.nav-links a:hover { color: var(--gold); }
.nav-links a:hover::after { width: 100%; }

/* --- Dropdown --- */
.nav-dropdown { position: relative; }
.nav-dropdown > a { cursor: pointer; }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 50%;
    transform: translateX(50%);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 12px 0;
    min-width: 180px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    list-style: none;
}

[dir="ltr"] .dropdown-menu { right: auto; left: 50%; transform: translateX(-50%); }

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.open .dropdown-menu { opacity: 1; visibility: visible; }

.dropdown-menu li a {
    display: block;
    padding: 10px 25px;
    font-size: 1rem;
    font-weight: 400;
    color: var(--brown-light);
    white-space: nowrap;
}

.dropdown-menu li a::after { display: none; }

.dropdown-menu li a:hover {
    background: var(--cream);
    color: var(--gold);
}

.dropdown-arrow {
    font-size: 0.7em;
    margin-right: 4px;
    display: inline-block;
    transition: transform 0.3s ease;
}

[dir="ltr"] .dropdown-arrow { margin-right: 0; margin-left: 4px; }

.nav-dropdown:hover .dropdown-arrow,
.nav-dropdown.open .dropdown-arrow { transform: rotate(180deg); }

/* --- Cart icon (shop-only addition).
   Sits on the RTL "start" side (right in Hebrew) so it doesn't crowd
   the lang-switch on the opposite side. */
.nav-cart {
    position: absolute;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--brown);
    font-size: 0.95rem;
}

[dir="ltr"] .nav-cart { right: auto; left: 20px; }

.nav-cart svg { width: 22px; height: 22px; stroke: var(--brown); fill: none; stroke-width: 1.5; }
.nav-cart:hover { color: var(--gold); }
.nav-cart:hover svg { stroke: var(--gold); }

.nav-cart .cart-count {
    background: var(--gold);
    color: var(--white);
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.nav-cart .cart-count:empty { display: none; }

/* ---------- Page header ---------- */
.page-header {
    text-align: center;
    padding: 70px 20px 40px;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--brown);
}

.page-header .accent-line {
    width: 50px;
    height: 1px;
    background: var(--rose);
    margin: 15px auto 25px;
}

.page-header .lead {
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--brown-light);
    font-weight: 300;
}

/* ---------- Product grid (shop.html) ---------- */
.product-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 80px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(74, 63, 53, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    text-align: right;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(74, 63, 53, 0.12);
}

.product-card .img-wrap {
    aspect-ratio: 1 / 1;
    background: var(--cream-dark);
    position: relative;
    overflow: hidden;
}

.product-card .img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .img-wrap img { transform: scale(1.05); }

.product-card .sold-out-overlay {
    position: absolute;
    inset: 0;
    background: rgba(250, 247, 242, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    letter-spacing: 3px;
    color: var(--brown);
    text-transform: uppercase;
}

.product-card .body {
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-card .name {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--brown);
    line-height: 1.4;
}

.product-card .price {
    font-size: 1rem;
    color: var(--gold-dark);
    letter-spacing: 1px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--brown-light);
    font-weight: 300;
    font-size: 1.1rem;
}

/* ---------- Product page (product.html) ---------- */
.product-detail {
    max-width: 1100px;
    margin: 0 auto;
    padding: 50px 20px 80px;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 60px;
    align-items: start;
}

.product-gallery .main-img {
    aspect-ratio: 1 / 1;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(74, 63, 53, 0.08);
}

.product-gallery .main-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-gallery .thumbs {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.product-gallery .thumbs button {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    padding: 0;
    background: var(--cream-dark);
    cursor: pointer;
}

.product-gallery .thumbs button.active { border-color: var(--gold); }
.product-gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

.product-info h1 {
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 1px;
    line-height: 1.3;
    margin-bottom: 18px;
}

.product-info .price {
    font-size: 1.4rem;
    color: var(--gold-dark);
    letter-spacing: 1px;
    margin-bottom: 22px;
}

.product-info .description {
    font-size: 1.05rem;
    line-height: 1.95;
    color: var(--brown-light);
    font-weight: 300;
    white-space: pre-wrap;
    margin-bottom: 28px;
}

/* --- Accordion sections (description / care / shipping) --- */
.product-accordion {
    margin-top: 28px;
    border-top: 1px solid var(--cream-dark);
}

.accordion-item {
    border-bottom: 1px solid var(--cream-dark);
}

.accordion-head {
    width: 100%;
    background: none;
    border: none;
    padding: 18px 0;
    font-family: inherit;
    font-size: 1rem;
    color: var(--brown);
    text-align: right;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 0.5px;
}

.accordion-head:hover { color: var(--gold-dark); }

.accordion-head .chev {
    font-size: 0.85rem;
    color: var(--gold-dark);
    transition: transform 0.3s ease;
    margin-inline-start: 12px;
}

.accordion-item.open .chev { transform: rotate(180deg); }

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    font-size: 0.98rem;
    line-height: 1.9;
    color: var(--brown-light);
    font-weight: 300;
    white-space: pre-wrap;
}

.accordion-item.open .accordion-body {
    max-height: 800px;
    padding: 0 0 20px;
}

.product-info .stock-line {
    font-size: 0.95rem;
    color: var(--brown-light);
    margin-bottom: 22px;
}

.product-info .stock-line.low { color: var(--red); }

.qty-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.qty-row label {
    font-size: 0.95rem;
    color: var(--brown-light);
}

.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--cream-dark);
    border-radius: 6px;
    overflow: hidden;
}

.qty-stepper button {
    width: 36px;
    height: 36px;
    background: var(--white);
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--brown);
}

.qty-stepper button:hover:not(:disabled) { background: var(--cream); }
.qty-stepper button:disabled { opacity: 0.4; cursor: not-allowed; }

.qty-stepper .value {
    min-width: 40px;
    text-align: center;
    font-size: 1rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border: 1px solid var(--gold);
    background: var(--gold);
    color: var(--white);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover:not(:disabled) {
    background: var(--gold-dark);
    border-color: var(--gold-dark);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    color: var(--gold-dark);
}

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

.btn-danger {
    background: var(--red);
    border-color: var(--red);
}

.btn-danger:hover:not(:disabled) {
    background: #8e3e3b;
    border-color: #8e3e3b;
}

.btn-block { width: 100%; }

/* ============================================================
   Cart page
   ============================================================ */
.cart-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px 80px;
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 40px;
    align-items: start;
}

.cart-items {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(74, 63, 53, 0.05);
}

.cart-row {
    display: grid;
    grid-template-columns: 90px 1fr auto auto auto;
    gap: 18px;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--cream-dark);
}

.cart-row:last-child { border-bottom: none; }

.cart-row .thumb {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    background: var(--cream-dark);
    object-fit: cover;
    display: block;
}

.cart-row .info .name {
    font-size: 1.05rem;
    color: var(--brown);
    line-height: 1.4;
    margin-bottom: 4px;
}

.cart-row .info .unit-price {
    font-size: 0.9rem;
    color: var(--brown-light);
}

.cart-row .line-total {
    font-size: 1rem;
    color: var(--gold-dark);
    min-width: 80px;
    text-align: left;
}

.cart-row .remove {
    background: none;
    border: none;
    color: var(--brown-light);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.cart-row .remove:hover { color: var(--red); }

/* Summary sidebar (cart + checkout share this look) */
.summary-card {
    background: var(--white);
    border-radius: 10px;
    padding: 26px 28px;
    box-shadow: 0 4px 16px rgba(74, 63, 53, 0.05);
    position: sticky;
    top: 90px;
}

.summary-card h2 {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 1px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--cream-dark);
}

.summary-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.98rem;
    color: var(--brown-light);
}

.summary-line .v { color: var(--brown); }

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 14px;
    margin-top: 8px;
    border-top: 1px solid var(--cream-dark);
    font-size: 1.15rem;
    color: var(--brown);
}

.summary-total .v {
    font-size: 1.4rem;
    color: var(--gold-dark);
    letter-spacing: 1px;
}

.summary-card .btn {
    margin-top: 22px;
}

.summary-card .back-link {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 0.9rem;
    color: var(--brown-light);
}

.summary-card .back-link:hover { color: var(--gold); }

.cart-empty {
    grid-column: 1 / -1;
    text-align: center;
    background: var(--white);
    border-radius: 10px;
    padding: 80px 20px;
    box-shadow: 0 4px 16px rgba(74, 63, 53, 0.05);
}

.cart-empty .icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 18px;
    color: var(--cream-dark);
}

.cart-empty p {
    color: var(--brown-light);
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: 22px;
}

/* ============================================================
   Checkout page
   ============================================================ */
.checkout-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px 80px;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 40px;
    align-items: start;
}

.checkout-form {
    background: var(--white);
    border-radius: 10px;
    padding: 28px 32px;
    box-shadow: 0 4px 16px rgba(74, 63, 53, 0.05);
}

.checkout-form h2 {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 1px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--cream-dark);
}

.checkout-form .field {
    margin-bottom: 16px;
}

.checkout-form label {
    display: block;
    font-size: 0.88rem;
    color: var(--brown-light);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.checkout-form label .req { color: var(--red); }

.checkout-form input,
.checkout-form textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--cream-dark);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--cream);
    color: var(--brown);
    direction: rtl;
}

.checkout-form input:focus,
.checkout-form textarea:focus {
    outline: none;
    border-color: var(--gold);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(181, 160, 100, 0.12);
}

.checkout-form textarea {
    min-height: 80px;
    resize: vertical;
}

.field-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Delivery method radio cards */
.delivery-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}

.delivery-opt {
    border: 1.5px solid var(--cream-dark);
    border-radius: 8px;
    padding: 16px 14px;
    cursor: pointer;
    background: var(--cream);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.delivery-opt:hover { border-color: var(--gold-light); }

.delivery-opt input { display: none; }

.delivery-opt.selected {
    border-color: var(--gold);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(181, 160, 100, 0.1);
}

.delivery-opt .title {
    font-size: 1rem;
    color: var(--brown);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.delivery-opt .price {
    color: var(--gold-dark);
    font-size: 0.9rem;
}

.delivery-opt .desc {
    font-size: 0.85rem;
    color: var(--brown-light);
    font-weight: 300;
}

/* Compact item list in summary */
.summary-items {
    margin-bottom: 14px;
    max-height: 240px;
    overflow-y: auto;
}

.summary-item {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 8px 0;
    font-size: 0.9rem;
}

.summary-item img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--cream-dark);
}

.summary-item .nm { color: var(--brown); line-height: 1.3; }
.summary-item .nm small { color: var(--brown-light); font-size: 0.8rem; display: block; }
.summary-item .v { color: var(--gold-dark); white-space: nowrap; }

.section-divider {
    height: 1px;
    background: var(--cream-dark);
    margin: 22px 0 18px;
}

/* ============================================================
   Thank-you page
   ============================================================ */
.thanks-shell {
    max-width: 640px;
    margin: 0 auto;
    padding: 80px 20px;
    text-align: center;
}

.thanks-shell .check {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.thanks-shell .check svg { width: 42px; height: 42px; stroke-width: 2; }

.thanks-shell h1 {
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.thanks-shell p {
    font-size: 1.1rem;
    color: var(--brown-light);
    font-weight: 300;
    line-height: 1.8;
    margin-bottom: 30px;
}

.thanks-shell .order-num {
    background: var(--white);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px rgba(74, 63, 53, 0.05);
}

.thanks-shell .order-num small {
    display: block;
    color: var(--brown-light);
    font-size: 0.85rem;
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.thanks-shell .order-num strong {
    font-size: 1.3rem;
    color: var(--gold-dark);
    font-weight: 500;
    letter-spacing: 2px;
}

/* ---------- Toast ---------- */
.toast-host {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--brown);
    color: var(--white);
    padding: 12px 22px;
    border-radius: 6px;
    font-size: 0.95rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: toast-in 0.3s ease;
}

.toast.success { background: #4a7a4a; }
.toast.error   { background: var(--red); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Footer (matches existing) ---------- */
.site-footer {
    background: var(--brown);
    color: var(--cream);
    padding: 35px 20px;
    text-align: center;
    font-weight: 300;
    font-size: 0.95rem;
    letter-spacing: 1px;
}

.site-footer a { color: var(--gold-light); }
.site-footer a:hover { color: var(--white); }

/* ---------- Responsive ---------- */
/* ---------- Mobile / tablet ----------
   Navbar restructures into a 2-row grid:
       row 1: [lang-switch on left]  ...  [nav-cart on right]
       row 2: [nav-links centered, wrapping if needed]
   That gives both utility actions breathing room and the menu
   gets a full row to itself. */
@media (max-width: 820px) {
    .navbar {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        align-items: center;
        padding: 10px 14px;
        gap: 8px 0;
    }

    .nav-cart {
        position: static;
        grid-column: 1 / 2;     /* RTL: right edge */
        grid-row: 1;
        justify-self: start;
        font-size: 0.9rem;
    }

    .lang-switch {
        position: static;
        grid-column: 3 / 4;     /* RTL: left edge */
        grid-row: 1;
        justify-self: end;
    }

    /* No LTR override needed — CSS Grid flips columns automatically with
       `direction: ltr`, so col 1 → left, col 3 → right naturally. */

    .nav-links {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px 16px;
    }

    .nav-links a { font-size: 0.92rem; }

    .product-detail {
        grid-template-columns: 1fr;
        gap: 30px;
        padding-top: 30px;
    }
    .product-info h1 { font-size: 1.6rem; }
    .page-header h1  { font-size: 2rem; }
    .page-header     { padding-top: 30px; }

    .cart-shell, .checkout-shell {
        grid-template-columns: 1fr;
        gap: 20px;
        padding-top: 20px;
    }
    .summary-card { position: static; }
    .cart-row {
        grid-template-columns: 70px 1fr auto;
        gap: 12px;
        padding: 14px;
    }
    .cart-row .thumb { width: 70px; height: 70px; }
    .cart-row .line-total {
        grid-column: 2 / 3;
        text-align: right;
        font-size: 0.95rem;
    }
    .cart-row .remove {
        grid-column: 3 / 4;
        grid-row: 1 / 3;
    }
    .field-row-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .navbar { padding: 8px 12px; }
    .nav-links { gap: 4px 12px; }
    .nav-links a { font-size: 0.85rem; }
    .nav-cart { font-size: 0.85rem; }
    .nav-cart svg { width: 20px; height: 20px; }
    /* On the smallest screens, hide the "עגלה" label — icon + count is enough */
    .nav-cart span:not(.cart-count) { display: none; }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        padding: 20px 12px 60px;
    }
    .product-card .name { font-size: 1rem; }
    .product-card .body { padding: 12px 14px 16px; }
}
