:root {
    --gold: #b08d4f;
    --gold-dark: #8a6d3a;
    --black: #161513;
    --white: #ffffff;
    --cream: #faf7f2;
    --gray: #6b6660;
    --border: #e6e1d8;
    --danger: #b3413a;
    --success: #3f6b4a;
    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Jost', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-sans);
    color: var(--black);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; margin: 0 0 0.5em; color: var(--black); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.narrow-container { max-width: 560px; }

/* --- Header --- */
.site-header { border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--white); z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; gap: 24px; }
.logo { display: inline-flex; align-items: center; white-space: nowrap; }
.logo-img { height: 42px; width: auto; display: block; }
.logo-img-footer { height: 48px; }
.search-form { position: relative; display: flex; align-items: center; background: var(--cream); border: 1px solid var(--border); border-radius: 2px; flex-shrink: 0; flex-basis: 220px; }
.search-form input { border: none; background: none; outline: none; font-family: inherit; font-size: 0.85rem; padding: 9px 0 9px 12px; width: 100%; color: var(--black); }
.search-form input::placeholder { color: var(--gray); }
.search-form button { background: none; border: none; padding: 8px; cursor: pointer; color: var(--gray); display: flex; }
.search-form button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.search-form button:hover { color: var(--gold-dark); }
.search-suggestions { display: none; position: absolute; top: 100%; left: 0; right: 0; margin-top: 6px; background: var(--white); border: 1px solid var(--border); box-shadow: 0 10px 24px rgba(22, 21, 19, 0.12); z-index: 80; max-height: 380px; overflow-y: auto; }
.search-suggestions.open { display: block; }
.search-suggestion-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; }
.search-suggestion-item:hover { background: var(--cream); }
.search-suggestion-item img, .search-suggestion-placeholder { width: 40px; height: 40px; object-fit: cover; background: var(--cream); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-serif); color: var(--gold); font-size: 0.85rem; }
.search-suggestion-info { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.search-suggestion-name { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-suggestion-price { font-size: 0.8rem; color: var(--gold-dark); }
.search-suggestions-empty { padding: 12px; color: var(--gray); font-size: 0.85rem; }
.main-nav { display: flex; flex-wrap: wrap; gap: 10px 14px; flex: 1; justify-content: center; }
.main-nav a { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; flex-shrink: 0; }
.main-nav a:hover { color: var(--gold); }
.nav-dropdown { position: relative; display: flex; align-items: center; }
.nav-dropdown-trigger { background: none; border: none; font: inherit; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer; color: inherit; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; padding: 0; }
.nav-dropdown-trigger::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-top: -3px; }
.nav-dropdown-trigger:hover { color: var(--gold); }
.nav-dropdown-menu { display: none; flex-direction: column; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); background: var(--white); border: 1px solid var(--border); min-width: 200px; padding: 8px 0; z-index: 70; box-shadow: 0 10px 24px rgba(22, 21, 19, 0.1); }
.nav-dropdown-menu a { padding: 9px 20px; font-size: 0.9rem; text-transform: none; letter-spacing: normal; white-space: nowrap; }
.nav-dropdown-menu a:hover { background: var(--cream); color: var(--gold); }
.nav-dropdown:hover .nav-dropdown-menu, .nav-dropdown.open .nav-dropdown-menu { display: flex; }
.header-actions { display: flex; gap: 20px; align-items: center; font-size: 0.9rem; flex-shrink: 0; min-width: 132px; justify-content: flex-end; }
.icon-link { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.header-icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cart-count { display: inline-block; background: var(--gold); color: var(--white); border-radius: 50%; min-width: 18px; height: 18px; font-size: 0.7rem; text-align: center; line-height: 18px; margin-left: 4px; }
.mobile-menu-btn { display: none; background: none; border: none; padding: 8px; margin: -8px 0 -8px -8px; cursor: pointer; color: var(--black); }
.mobile-menu-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.mobile-tabbar { display: none; }

/* --- Hero --- */
.hero { background: var(--cream); padding: 90px 0; text-align: center; }
.hero-inner { max-width: 640px; margin: 0 auto; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.15em; color: var(--gold-dark); font-size: 0.8rem; margin-bottom: 12px; }
.hero h1 { font-size: 3rem; line-height: 1.1; margin-bottom: 20px; }
.hero .lead { color: var(--gray); font-size: 1.1rem; margin-bottom: 28px; }

/* --- Buttons --- */
.btn { display: inline-block; padding: 14px 32px; border-radius: 2px; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer; border: 1px solid transparent; text-align: center; }
.btn-primary { background: var(--black); color: var(--white); }
.btn-primary:hover { background: var(--gold-dark); }
.btn-secondary { background: transparent; border-color: var(--black); color: var(--black); }
.btn-secondary:hover { background: var(--black); color: var(--white); }
.btn-block { display: block; width: 100%; }
.btn-google { background: #fff; border: 1px solid #dadce0; color: #3c4043; display: flex; align-items: center; justify-content: center; gap: 10px; text-transform: none; letter-spacing: normal; font-weight: 500; }
.btn-google:hover { background: #f7f8f8; }
.btn-google .google-icon { width: 18px; height: 18px; flex-shrink: 0; }
.auth-divider { display: flex; align-items: center; margin: 20px 0; color: #999; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-bottom: 1px solid #e0e0e0; }
.auth-divider span { padding: 0 12px; }

/* --- Sections --- */
.section { padding: 64px 0; }
.section-title { text-align: center; font-size: 2rem; margin-bottom: 40px; }
.page-title { font-size: 2.2rem; margin-bottom: 24px; }

/* --- Categories --- */
.categories-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.category-card { position: relative; display: block; aspect-ratio: 3/4; overflow: hidden; background: var(--cream); border: 1px solid var(--border); transition: border-color 0.2s; }
.category-card:hover { border-color: var(--gold); }
.category-card:hover .category-card-img { transform: scale(1.05); }
.category-card-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.category-card-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; text-align: center; font-family: var(--font-serif); font-size: 1.3rem; color: var(--white); background: rgba(22, 21, 19, 0.78); }

/* --- Product grid / cards --- */
.products-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.product-card { display: block; }
.product-card-img { position: relative; aspect-ratio: 1; background: var(--cream); overflow: hidden; margin-bottom: 14px; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.product-card:hover .product-card-img img { transform: scale(1.05); }
.product-card-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--font-serif); font-size: 2.5rem; color: var(--gold); }
.product-card-body h3 { font-size: 1.05rem; font-weight: 500; margin-bottom: 4px; }
.price { color: var(--gold-dark); font-weight: 600; }
.price-lg { font-size: 1.5rem; margin: 8px 0 20px; }
.badge { display: inline-block; padding: 4px 10px; font-size: 0.75rem; border-radius: 2px; }
.badge-outofstock { background: var(--danger); color: var(--white); position: absolute; top: 10px; left: 10px; }

/* --- Trust section --- */
.trust-section { background: var(--cream); }
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; text-align: center; }

/* --- Shop layout --- */
.shop-layout { display: grid; grid-template-columns: 220px 1fr; gap: 40px; }
.filter-list { list-style: none; padding: 0; margin: 0; }
.filter-list li { margin-bottom: 8px; }
.filter-list a { color: var(--gray); }
.filter-list a.active, .filter-list a:hover { color: var(--black); font-weight: 600; }
.search-results-count { color: var(--gray); margin-bottom: 24px; }
.pagination { display: flex; gap: 8px; margin-top: 32px; }
.pagination a { padding: 8px 14px; border: 1px solid var(--border); }
.pagination a.active { background: var(--black); color: var(--white); border-color: var(--black); }
.infinite-scroll-status { text-align: center; color: var(--gray); font-size: 0.85rem; margin-top: 24px; }
#infinite-scroll-sentinel { height: 1px; }

/* --- Product detail --- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.product-gallery-main { aspect-ratio: 1; background: var(--cream); overflow: hidden; }
.product-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.product-gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; }
.product-gallery-thumbs .thumb { width: 72px; height: 72px; object-fit: cover; cursor: pointer; border: 1px solid var(--border); }
.product-description { color: var(--gray); margin-bottom: 24px; white-space: pre-line; }
.add-to-cart-form { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.add-to-cart-form label { display: block; font-size: 0.85rem; margin-bottom: 6px; }
.add-to-cart-form input[type=number] { width: 70px; padding: 12px; border: 1px solid var(--border); }
.stock-info { color: var(--success); font-size: 0.9rem; }

/* --- Forms --- */
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], select, textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--border); font-family: var(--font-sans); font-size: 0.95rem; margin-bottom: 16px; background: var(--white); color: var(--black);
}
label { display: block; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; color: var(--gray); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; text-transform: none; margin-bottom: 12px; }
.checkbox-label input { width: auto; margin: 0; }
.auth-form, .checkout-form { max-width: 480px; }
.auth-switch { margin-top: 16px; }
.checkout-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.checkout-note { font-size: 0.85rem; color: var(--gray); margin-top: 12px; }

/* --- Alerts --- */
.alert { padding: 14px 18px; margin-bottom: 20px; border-radius: 2px; font-size: 0.9rem; }
.alert-success { background: #eaf3ec; color: var(--success); border: 1px solid #c7ddcb; }
.alert-error { background: #fbeceb; color: var(--danger); border: 1px solid #f0cbc8; }

/* --- Cart table --- */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.cart-table th, .cart-table td { text-align: left; padding: 14px 10px; border-bottom: 1px solid var(--border); }
.cart-product-cell { display: flex; align-items: center; gap: 12px; }
.cart-product-cell img { width: 56px; height: 56px; object-fit: cover; }
.qty-input { width: 64px; margin: 0; padding: 8px; }
.link-btn { background: none; border: none; color: var(--gray); text-decoration: underline; cursor: pointer; font-size: 0.85rem; padding: 0; }
.link-btn:hover { color: var(--danger); }
.link-btn-danger { color: var(--danger); }
.hidden-inline-form { display: none; }
.cart-actions { margin-top: 12px; }
.cart-summary { background: var(--cream); padding: 24px; max-width: 360px; }
.cart-summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 0.95rem; }
.cart-summary-total { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 14px; }

/* --- Footer --- */
.site-footer { background: var(--black); color: #cfcac1; margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding: 56px 24px; }
.footer-col a { display: block; color: #cfcac1; margin-bottom: 8px; font-size: 0.92rem; }
.footer-col a:hover { color: var(--gold); }
.footer-col h4 { color: var(--white); font-family: var(--font-sans); text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.06em; margin-bottom: 14px; }
.footer-col .logo { margin-bottom: 12px; display: inline-block; }
.footer-payments { border-top: 1px solid #2c2a26; padding: 20px 0; }
.payment-icons { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.payment-icons-label { font-size: 0.8rem; color: #8a857c; margin-right: 4px; }
.payment-icon { height: 24px; width: auto; border-radius: 3px; }
.payment-icons-powered { font-size: 0.75rem; color: #6b665e; margin-left: 4px; }
.footer-bottom { border-top: 1px solid #2c2a26; padding: 18px 0; text-align: center; font-size: 0.8rem; color: #8a857c; }

/* --- Blog --- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 32px; }
.blog-card { display: block; }
.blog-card-img { aspect-ratio: 4/3; background: var(--cream); overflow: hidden; margin-bottom: 14px; }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.blog-card:hover .blog-card-img img { transform: scale(1.05); }
.blog-card-date { font-size: 0.8rem; color: var(--gold-dark); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.blog-card-body h3 { font-size: 1.15rem; margin-bottom: 6px; }
.blog-card-excerpt { color: var(--gray); font-size: 0.9rem; }
.blog-breadcrumb { color: var(--gray); font-size: 0.85rem; margin-bottom: 12px; }
.blog-breadcrumb a:hover { color: var(--gold); }
.blog-meta { color: var(--gray); font-size: 0.9rem; margin-bottom: 24px; }
.blog-cover { aspect-ratio: 16/9; background: var(--cream); overflow: hidden; margin-bottom: 32px; }
.blog-cover img { width: 100%; height: 100%; object-fit: cover; }
.blog-content { color: var(--black); }
.blog-content p { margin: 0 0 1.2em; }
.blog-content h2 { font-size: 1.5rem; margin-top: 1.6em; }
.blog-content h3 { font-size: 1.2rem; margin-top: 1.4em; }
.blog-content ul, .blog-content ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.blog-content li { margin-bottom: 0.4em; }
.blog-content a { color: var(--gold-dark); text-decoration: underline; }

/* --- Legal pages --- */
.legal-page h2 { margin-top: 32px; font-size: 1.3rem; }
.legal-placeholder-notice { background: #fff4e0; border: 1px solid #f0d8a0; padding: 12px 16px; font-size: 0.85rem; margin-bottom: 24px; }

/* --- Responsive --- */
@media (max-width: 900px) {
    .header-inner { padding: 11px 4px; }
    .logo-img { height: 37px; width: auto; }
    .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); flex-direction: column; padding: 20px 24px; border-bottom: 1px solid var(--border); gap: 16px; z-index: 65; }
    .main-nav.open { display: flex; }
    .header-actions { display: none; }
    .mobile-menu-btn { display: flex; }
    .search-form { flex: 1; flex-basis: auto; }
    .nav-dropdown { flex-direction: column; align-items: flex-start; }
    .nav-dropdown-trigger { pointer-events: none; font-weight: 600; }
    .nav-dropdown-trigger::after { display: none; }
    .nav-dropdown-menu { display: flex !important; position: static; transform: none; border: none; box-shadow: none; min-width: 0; padding: 4px 0 4px 14px; }
    .nav-dropdown-menu a { padding: 6px 0; }
    .categories-grid, .products-grid, .blog-grid { grid-template-columns: repeat(2, 1fr); }
    .shop-layout, .product-detail, .checkout-layout { grid-template-columns: 1fr; }
    .trust-grid, .form-row { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .hero h1 { font-size: 2.2rem; }
    body { padding-bottom: 60px; }
    .mobile-tabbar {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: var(--white);
        border-top: 1px solid var(--border);
        z-index: 60;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    }
    .mobile-tab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        font-size: 0.65rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--gray);
        background: none;
        border: none;
        font-family: inherit;
        cursor: pointer;
        position: relative;
        padding: 4px 0;
    }
    .mobile-tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
    .mobile-tab.active { color: var(--gold-dark); }
    .mobile-tab-badge { position: absolute; top: -2px; right: calc(50% - 22px); background: var(--gold); color: var(--white); border-radius: 50%; min-width: 16px; height: 16px; font-size: 0.6rem; line-height: 16px; text-align: center; }
}

@media (prefers-color-scheme: dark) {
    /* Le site vitrine reste volontairement clair (charte joaillerie) même en mode sombre système */
}
