/* ============================================
   BONADWAN STOREFRONT — Matching Shopify Design
   Dark nav, white bg, minimalist luxury
   ============================================ */

:root {
    --primary: #1a1a1a;
    --primary-light: #333;
    --accent: #c8a96e;
    --accent-light: #e8d5b0;
    --bg: #ffffff;
    --bg-light: #f8f8f8;
    --text: #333333;
    --text-light: #777777;
    --border: #e5e5e5;
    --white: #ffffff;
    --danger: #dc3545;
    --success: #28a745;
    --max-width: 1200px;
    --header-height: 120px;
    --radius: 4px;
}

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

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }

/* Announcement Bar */
.announcement-bar {
    background: var(--primary);
    color: var(--white);
    text-align: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Header */
.site-header {
    background: var(--primary);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-start, .header-end {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 120px;
}
.header-end { justify-content: flex-end; }

.header-lang {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    padding: 4px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    transition: all 0.2s;
}
.header-lang:hover { color: #fff; border-color: #fff; }

.header-center { text-align: center; }
.site-logo h1 {
    margin: 0;
    line-height: 0;
}

.site-logo img {
    height: 52px;
    width: auto;
    display: block;
    /* artwork is solid black on transparent; header is dark, so render it white */
    filter: brightness(0) invert(1);
}

.header-cart {
    position: relative;
    color: var(--white);
    display: flex;
    align-items: center;
}
.cart-count {
    position: absolute;
    top: -8px;
    inset-inline-end: -10px;
    background: var(--accent);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Navigation */
.main-nav {
    background: var(--primary);
    border-top: 1px solid rgba(255,255,255,0.1);
}
.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 0 24px;
}
.nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--white); }
.nav-link.active { border-bottom: 2px solid var(--accent); }

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--white);
    transition: 0.2s;
}
.mobile-menu {
    display: none;
    background: var(--primary);
    padding: 0 24px 16px;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
    display: block;
    color: rgba(255,255,255,0.8);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 15px;
}
.mobile-menu a:hover { color: #fff; }

/* Main Content */
.site-main {
    min-height: 60vh;
}

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Hero Section */
.hero-section {
    background: var(--bg-light);
    text-align: center;
    padding: 0;
    line-height: 0; /* kill the inline-image gap */
}
.hero-image {
    display: block;
    width: 100%;
    height: auto;
    /* On wide screens the natural 2.3:1 banner would be ~700px tall, so cap it and
       crop from 25% down — that keeps the calligraphy (upper-middle) in frame. */
    max-height: 460px;
    object-fit: cover;
    object-position: center 25%;
}
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Section Titles */
.section-title {
    text-align: center;
    padding: 48px 0 24px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

/* Product Grid */
.product-grid {
    display: grid;
    /* auto-fit + capped track width so a short row (e.g. 3 items) centres
       instead of leaving an empty column at the end */
    grid-template-columns: repeat(auto-fit, minmax(240px, 300px));
    justify-content: center;
    gap: 24px;
    padding: 0 0 48px;
}

/* Product Card */
.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.3s;
    border: 1px solid var(--border);
}
.product-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.product-card-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-light);
}
.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.product-card:hover .product-card-image img {
    transform: scale(1.05);
}
.product-card-image .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--border);
}

.sold-out-badge {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 2px;
    text-transform: uppercase;
}

.product-card-body {
    padding: 16px;
    text-align: center;
}
.product-card-vendor {
    font-size: 11px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.product-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1.4;
}
.product-card-title a { color: inherit; }
.product-card-title a:hover { color: var(--accent); }

.product-card-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}
.product-card-price .compare-price {
    text-decoration: line-through;
    color: var(--text-light);
    font-weight: 400;
    font-size: 13px;
    margin-inline-start: 6px;
}

.btn-add-cart, .btn-choose {
    display: inline-block;
    padding: 10px 28px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    border: 1px solid var(--primary);
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.btn-add-cart {
    background: var(--primary);
    color: var(--white);
}
.btn-add-cart:hover { background: var(--primary-light); }
.btn-choose {
    background: transparent;
    color: var(--primary);
}
.btn-choose:hover { background: var(--primary); color: var(--white); }
.btn-sold-out {
    display: inline-block;
    padding: 10px 28px;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-light);
    color: var(--text-light);
    border: 1px solid var(--border);
    cursor: not-allowed;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Category Section */
.category-section {
    padding: 40px 0;
    border-top: 1px solid var(--border);
}

/* Single Product Page */
.product-detail {
    padding: 48px 0;
}
.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.product-gallery {
    position: sticky;
    top: 140px;
}
.product-buy {
    margin-top: 20px;
}
.product-gallery-main {
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-light);
    margin-bottom: 12px;
}
.product-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}
.product-gallery-thumbs .thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
}
.product-gallery-thumbs .thumb.active { border-color: var(--primary); }
.product-gallery-thumbs .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1.3;
}
.product-info .product-vendor {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.product-info .product-price {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}
.product-info .product-description {
    color: var(--text);
    line-height: 1.9;
    margin-bottom: 24px;
    font-size: 15px;
}
.product-info .product-description p { margin: 0 0 10px; }
.product-info .product-description p:last-child { margin-bottom: 0; }
.product-info .product-description strong { font-weight: 600; }
.product-info .product-description img { max-width: 100%; height: auto; }
.product-info .product-meta {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.product-info .product-meta span {
    display: block;
    margin-bottom: 4px;
}

.qty-selector {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 16px;
}
.qty-selector button {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--bg-light);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qty-selector input {
    width: 60px;
    height: 40px;
    border: 1px solid var(--border);
    border-inline: none;
    text-align: center;
    font-size: 15px;
    font-family: 'Cairo', sans-serif;
}

.product-add-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    background: var(--primary);
    color: var(--white);
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.2s;
}
.product-add-btn:hover { background: var(--primary-light); }
.product-add-btn:disabled {
    background: var(--bg-light);
    color: var(--text-light);
    cursor: not-allowed;
}

.stock-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 2px;
    margin-bottom: 16px;
}
.stock-badge.in-stock { background: #d4edda; color: #155724; }
.stock-badge.out-of-stock { background: #f8d7da; color: #721c24; }

/* Page Header */
.page-hero {
    background: var(--bg-light);
    text-align: center;
    padding: 40px 24px;
    border-bottom: 1px solid var(--border);
}
.page-hero h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

/* Footer */
.site-footer {
    background: var(--primary);
    color: rgba(255,255,255,0.8);
    padding: 48px 0 0;
    margin-top: 48px;
}
.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}
.footer-col h3 {
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.footer-col p {
    font-size: 13px;
    line-height: 1.8;
}
.footer-col a {
    color: rgba(255,255,255,0.7);
    transition: color 0.2s;
}
.footer-col a:hover { color: var(--white); }

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}
.social-link:hover { color: var(--white); }

.footer-bottom {
    text-align: center;
    padding: 24px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    inset-inline-end: 24px;
    background: var(--primary);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }
    .main-nav { display: none; }
    .header-lang { display: none; }
    .site-logo img { height: 38px; }
    .hero-section { padding: 0; }
    .hero-image { max-height: 260px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-card-body { padding: 12px; }
    .product-card-title { font-size: 13px; }
    .product-card-price { font-size: 14px; }
    .product-detail-grid { grid-template-columns: 1fr; gap: 24px; }
    .product-gallery { position: static; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .section-title { font-size: 20px; padding: 32px 0 16px; }
    .btn-add-cart, .btn-choose, .btn-sold-out { padding: 8px 16px; font-size: 11px; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .product-card-price { font-size: 13px; margin-bottom: 8px; }
    .product-info h1 { font-size: 22px; }
}


/* ---- Product variant options ---- */
.product-options { margin: 20px 0 4px; }
.option-group { margin-bottom: 16px; }
.option-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}
.option-values { display: flex; flex-wrap: wrap; gap: 8px; }
.option-chip { cursor: pointer; }
.option-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.option-chip span {
    display: inline-block;
    padding: 9px 16px;
    /* --chip is set per value from the admin; falls back to the neutral look */
    border: 1px solid var(--chip, var(--border));
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--chip, var(--text));
    background: var(--white);
    transition: all .15s ease;
}
.option-chip:hover span { border-color: var(--chip, var(--primary-light)); }
.option-chip input:checked + span {
    border-color: var(--chip, var(--primary));
    background: var(--chip, var(--primary));
    color: var(--white);
}
.option-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.product-card-price .from-label { font-size: 12px; color: var(--text-light); font-weight: 400; }


/* ---- Added-to-cart modal ---- */
.cart-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.cart-modal.open { display: flex; }
.cart-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.cart-modal-box {
    position: relative;
    background: var(--white);
    border-radius: 10px;
    width: 100%;
    max-width: 420px;
    padding: 28px 24px 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    animation: cartModalIn .18s ease-out;
}
@keyframes cartModalIn {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
.cart-modal-close {
    position: absolute; top: 8px; inset-inline-end: 12px;
    background: none; border: 0; font-size: 26px; line-height: 1;
    color: var(--text-light); cursor: pointer;
}
.cart-modal-close:hover { color: var(--primary); }
.cart-modal-check {
    width: 52px; height: 52px; margin: 0 auto 12px;
    border-radius: 50%; background: #2e9e5b; color: #fff;
    font-size: 26px; line-height: 52px; font-weight: 700;
}
.cart-modal-box h3 { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 18px; }
.cart-modal-item {
    display: flex; gap: 12px; align-items: center; text-align: start;
    background: var(--bg-light); border-radius: 8px; padding: 10px; margin-bottom: 14px;
}
.cart-modal-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.cart-modal-info { min-width: 0; }
.cart-modal-name { font-weight: 600; font-size: 14px; color: var(--text); }
.cart-modal-variant { font-size: 13px; color: var(--text); margin-top: 2px; }
.cart-modal-meta { font-size: 13px; color: var(--text-light); margin-top: 2px; }
.cart-modal-subtotal {
    display: flex; justify-content: space-between;
    font-size: 14px; padding: 0 4px 16px; color: var(--text);
}
.cart-modal-actions { display: flex; gap: 10px; }
.cart-modal-btn {
    flex: 1; padding: 12px 14px; border-radius: 6px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    text-decoration: none; text-align: center;
    border: 1px solid var(--primary); transition: opacity .15s ease;
}
.cart-modal-btn.secondary { background: var(--white); color: var(--primary); }
.cart-modal-btn.primary   { background: var(--primary); color: var(--white); }
.cart-modal-btn:hover { opacity: .85; }
.cart-modal-link { display: inline-block; margin-top: 12px; font-size: 13px; color: var(--text-light); }
.cart-modal-link:hover { color: var(--primary); }

@media (max-width: 480px) {
    .cart-modal-actions { flex-direction: column; }
}
