:root {
    /* Warm, editorial colour palette inspired by the Atlas Deco reference design */
    --primary-color: #24211c;
    --accent-color: #c08a3e;
    --accent-dark: #a5722f;
    --bg-color: #f8f3ea;
    --bg-alt: #f1e9da;
    --cream: #f8f3ea;
    --text-color: #3a352c;
    --text-muted: #6f6a5e;
    --card-bg: #fff;
    --border-soft: #e4d9c4;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Pushes the footer down to the bottom of the viewport on short pages
   (e.g. about/contact/cgv/admin), while still following the content
   normally on longer pages (e.g. the home page). */
main {
    flex: 1 0 auto;
}

h1, h2, h3 {
    font-family: 'Playfair Display', 'Georgia', serif;
}

header {
    background-color: var(--cream);
    color: var(--primary-color);
    padding: 0.7rem 5% 0.7rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-soft);
}

.logo {
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

/* Logo picture: shown as-is, blended into the header background so its
   white backdrop does not show as a visible box. */
.logo-img {
    height: 5.6rem;
    width: auto;
    display: block;
    mix-blend-mode: multiply;
}

/* Wrapper that centers the signature in the space between the logo and the
   navigation menu. */
.logo-signature-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
}

.logo-signature-wrap a {
    display: flex;
    color: inherit;
    text-decoration: none;
    max-width: 100%;
}

/* Hand-written "Atlas Déco" signature: width tripled and height doubled
   compared to its natural auto-scaled size, so it reads clearly next to
   the logo. */
.logo-signature {
    height: 4.6rem;
    width: 12.9rem;
    max-width: 100%;
    display: block;
    mix-blend-mode: multiply;
}

/* Main navigation menu */
.main-nav {
    display: flex;
    align-items: center;
    gap: 2.2rem;
    flex: 1;
    justify-content: center;
}

.main-nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: var(--accent-color);
}

/* Active page link in the navigation */
.main-nav a.active {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 4px;
}

/* ==========================================================================
   Search overlay
   ========================================================================== */

#search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 80px;
    gap: 0;
}

#search-overlay.hidden { display: none; }

.search-box {
    background: #fff;
    width: min(600px, 92vw);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
    overflow: hidden;
}

.search-box-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
}

.search-box-header svg { flex-shrink: 0; color: var(--primary-color); }

#search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    font-family: inherit;
    color: var(--text-color);
    background: transparent;
    padding: 0.2rem 0;
    margin-top: 0;
}

.search-close-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0 0.2rem;
}
.search-close-btn:hover { color: var(--primary-color); }

#search-results {
    max-height: 60vh;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    padding: 0.7rem 1rem;
    background: none;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #f8f6f2; }

.search-result-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #eee;
}
.search-result-thumb--empty { display: inline-block; }

.search-result-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.search-result-name {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.search-result-meta {
    font-size: 0.82rem;
    color: #888;
}

.search-no-results {
    padding: 1.2rem 1rem;
    color: #888;
    font-size: 0.95rem;
    text-align: center;
}

/* Search / account / cart icons on the right of the header */
.header-icons {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.2rem;
    line-height: 0;
}

.icon-btn svg {
    display: block;
}

/* Small badge showing the number of items in the cart */
.cart-count {
    position: absolute;
    top: -6px;
    right: -8px;
    background-color: var(--accent-color);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* Hamburger button: hidden on desktop, shown on mobile */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
}

/* About and Contact sections */
.about,
.contact {
    max-width: 800px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    text-align: center;
}

/* Extra breathing room when a section is the main content of its own page */
.page-section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
    min-height: 60vh;
}

.about h2,
.contact h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.section-title {
    text-align: center;
    color: var(--primary-color);
    margin: 2rem 0 0;
}

.contact-form {
    max-width: 500px;
    margin: 1.5rem auto;
    text-align: left;
}

.contact-form textarea {
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    margin-top: 0.3rem;
    resize: vertical;
}

.contact-form button {
    width: 100%;
    margin-top: 0.5rem;
}

.contact-form label .required {
    color: #c0392b;
    font-weight: bold;
    margin-left: 2px;
}

.contact-form label .optional {
    color: #999;
    font-size: 0.85em;
    font-weight: normal;
    margin-left: 4px;
}

.contact-info {
    margin-top: 1.5rem;
    color: #555;
    line-height: 1.8;
}

/* ==========================================================================
   Hero: two-column entrance banner (text on the left, framed visual on the right)
   ========================================================================== */

/* Hero: the showcase picture is now the section's own background. */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 460px;
    padding: 3rem 5%;
    background-color: var(--primary-color);

    background-size: cover;
    background-position: center 35%;
    background-repeat: no-repeat;

    animation: heroSlideshow 20s infinite;
    transition: background-image 4s ease-in-out;
}

@keyframes heroSlideshow {

    0%, 24% {
        background-image: url('images/fond_site.webp');
    }

    25%, 49% {
        background-image: url('images/fond_site_olivier.webp');
    }

    50%, 74% {
        background-image: url('images/fond_site_paysage.webp');
    }

    75%, 100% {
        background-image: url('images/fond_site_abstrait.webp');
    }
}

.hero-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-text {
    max-width: 560px;
}

/* Small gold eyebrow label, e.g. "— ATLAS DÉCO —" */
.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--accent-color);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    margin-bottom: 0.5rem;
}

.eyebrow::before {
    content: '';
    width: 26px;
    height: 1px;
    background-color: var(--accent-color);
}

.hero-text h1 {
    font-size: 2.3rem;
    line-height: 1.1;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.6rem;
}

.hero-text h1 .accent {
    color: var(--accent-color);
}

.hero-subtitle {
    font-weight: 600;
    letter-spacing: 0.06em;
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 0.6rem;
}

.hero-divider {
    display: block;
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
    margin-bottom: 0.6rem;
}

.hero-desc {
    color: rgba(255, 255, 255, 0.85);
    max-width: 420px;
    margin-bottom: 0.9rem;
    font-size: 0.9rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Generic button link styles used across the hero and collection cards */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #fff;
    border: 1px solid var(--accent-color);
}

.btn-primary:hover {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* On the hero, the button sits directly on the dark showcase picture, so it
   needs a light outline instead of the default dark one. */
.hero .btn-outline {
    color: #fff;
    border-color: #fff;
}

.hero .btn-outline:hover {
    background-color: #fff;
    color: var(--primary-color);
}

/* ==========================================================================
   Features bar: four short benefits with a line icon each
   ========================================================================== */

.features {
    display: flex;
    flex-wrap: wrap;
    background-color: var(--bg-alt);
    padding: 1rem 5%;
    gap: 1.2rem;
}

.feature {
    flex: 1 1 220px;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0 1.1rem;
    border-left: 1px solid var(--border-soft);
}

.feature:first-child {
    border-left: none;
    padding-left: 0;
}

.feature-icon {
    flex-shrink: 0;
    color: var(--accent-color);
}

.feature-icon svg {
    width: 27px;
    height: 27px;
    display: block;
}

.feature h3 {
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}

.feature p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Home page: compact collections preview
   Small version of the collections grid, kept short so the hero, the
   features bar and this preview stay visible together on one screen.
   ========================================================================== */

.home-collections {
    padding: 1rem 5% 1.6rem;
}

.home-collections .section-eyebrow {
    margin-bottom: 1rem;
}

.home-collections .products {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.home-collections .collection-card {
    aspect-ratio: 4 / 3;
}

.home-collections .collection-overlay {
    padding: 1rem;
}

.home-collections .collection-name {
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
}

.home-collections .collection-label {
    font-size: 0.65rem;
}

.home-collections .collection-link {
    font-size: 0.75rem;
}

/* ==========================================================================
   Collections section
   ========================================================================== */

.collections-section {
    padding: 3.5rem 5%;
    scroll-margin-top: 90px;
}

.section-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    margin-bottom: 2.2rem;
}

.section-eyebrow::before,
.section-eyebrow::after {
    content: '';
    width: 40px;
    height: 1px;
    background-color: var(--accent-color);
}

/* The collection detail heading (e.g. "RELIEF") reuses the eyebrow's gold
   lines/color but needs to read as a real title, not a small label. */
#collection-detail-title {
    font-size: 2.0rem;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

/* Detail view: pulled up close to the header, minimal top spacing. */
#collection-detail-view {
    margin-top: -1.2rem;
}

/* Link back to the collections grid from a collection's detail view */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    padding: 0;
    margin-bottom: 0.6rem;
}

.back-link:hover {
    color: var(--accent-dark);
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.6rem;
    max-width: 1400px;
    margin: 0 auto;
}

.collection-card {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(36, 33, 28, 0.1);
}

.collection-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
    transition: transform 0.5s ease;
}

.collection-card:hover img {
    transform: scale(1.06);
}

/* Paintings inside a collection's detail view are shown smaller and denser,
   so the name and price stay visible without scrolling to the bottom. */
#collection-products {
    grid-template-columns: repeat(auto-fit, minmax(280px, 440px));
    gap: 1.5rem;
}

#collection-products .collection-card {
    aspect-ratio: 4 / 3;
}

#collection-products .collection-name {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

#collection-products .collection-overlay {
    padding: 1.2rem;
}

/* Painting card whose stock is at 0: image gold "ÉPUISÉ" label */
.out-of-stock img {
    filter: none;
    opacity: 1;
}

.out-of-stock .collection-label {
    color: var(--accent-color);
    letter-spacing: 0.1em;
}

/* Small "hurry up" note shown on cards whose stock is positive but low */
.low-stock-badge {
    display: inline-block;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.collection-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.4rem;
    background: linear-gradient(to top, rgba(20, 17, 12, 0.55) 0%, rgba(20, 17, 12, 0.08) 55%, rgba(20, 17, 12, 0) 100%);
    color: #fff;
}

.collection-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--accent-color);
    margin-bottom: 0.3rem;
}

.collection-name {
    font-size: 1.4rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.7rem;
}

.collection-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    padding: 0;
    align-self: flex-start;
}

.collection-link span {
    transition: transform 0.25s ease;
}

.collection-card:hover .collection-link span {
    transform: translateX(4px);
}

.description {
    font-size: 0.9rem;
    color: #666;
    margin: 10px 0;
}

.price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #443c2f;
}

/* ==========================================================================
   Construction Modal
   ========================================================================== */
.construction-modal-content {
    text-align: center;
    padding: 3rem 2.5rem;
    max-width: 420px;
    border-top: 4px solid var(--accent-color);
}

.construction-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.construction-title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

.construction-msg {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.6rem;
}

.construction-sub {
    font-size: 0.88rem;
    color: #666;
    margin-bottom: 1.8rem;
    line-height: 1.55;
}

.construction-close {
    width: 100%;
    justify-content: center;
}

/* Modal and Cart Styles */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.hidden {
    display: none !important;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Full-size lightbox opened by clicking a painting's main picture */
.lightbox {
    position: fixed;
    inset: 0;
    background-color: rgba(20, 17, 12, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 300;
    cursor: zoom-out;
    padding: 2rem;
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    cursor: default;
}

.lightbox-close {
    color: #fff;
    top: 1.2rem;
    right: 1.5rem;
    font-size: 2.2rem;
}

/* Prev/next arrows to move between a painting's pictures while enlarged */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    border: none;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.3s;
}

.lightbox-nav:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

#cart-items {
    list-style: none;
    margin: 1rem 0;
}

#cart-items li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.cart-summary {
    font-size: 1.2rem;
    text-align: right;
    margin-top: 1rem;
}

.checkout-form {
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

input {
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    margin-top: 0.3rem;
}

.pay-btn {
    background-color: #27ae60;
    width: 100%;
    margin-top: 1rem;
}

.pay-btn:hover {
    background-color: #219653;
}

/* Info text shown before redirecting to Stripe */
.pay-info {
    color: #555;
    font-size: 0.95rem;
    margin: 0.5rem 0 1rem;
}

/* Multi-step checkout buttons (cart -> delivery -> payment) */
.step-btn {
    display: block;
    width: 100%;
    margin-top: 1.2rem;
    padding: 0.8rem 1rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.step-btn:hover {
    background-color: var(--accent-dark);
}

.step-btn.secondary {
    background-color: #95a5a6;
}

.step-btn.secondary:hover {
    background-color: #7f8c8d;
}

/* Row of navigation buttons within a checkout step */
.step-actions {
    display: flex;
    gap: 0.8rem;
}

.step-actions .step-btn,
.step-actions .pay-btn {
    flex: 1;
}

footer {
    text-align: center;
    padding: 2.2rem;
    background-color: var(--primary-color);
    color: var(--cream);
    margin-top: 3rem;
    flex-shrink: 0;
}

/* Footer legal links (e.g. CGV) */
.footer-links {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.footer-links a {
    color: inherit;
    text-decoration: underline;
    opacity: 0.9;
}

.footer-links a:hover {
    opacity: 1;
}

/* Terms of sale (CGV) page */
.cgv {
    max-width: 820px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    text-align: left;
}

.cgv h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
}

.cgv h3 {
    color: var(--primary-color);
    margin: 1.6rem 0 0.5rem;
}

.cgv p {
    margin-bottom: 0.8rem;
}

.cgv-note {
    background-color: #fff8e1;
    border-left: 4px solid var(--accent-color);
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    color: #7a5c1e;
    margin-bottom: 1.5rem;
}

/* Product detail page (produit.html): a real page, not a modal/section
   that appears over the current view. */
.product-page {
    max-width: 1400px;
    width: 95%;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 2.5rem 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.product-page .back-link {
    margin-bottom: 1.5rem;
}

.detail-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.detail-gallery {
    flex: 1 1 380px;
    min-width: 320px;
}

/* Row holding the thumbnails and the main picture side by side; kept apart
   from .detail-gallery so it never wraps onto its own line. */
.detail-gallery-main {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

#detail-main-image {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    height: 500px;
    object-fit: cover;
    object-position: center 20%;
    border-radius: 8px;
    cursor: zoom-in;
}

/* Thumbnails are shown as a vertical column to the left of the main image. */
.detail-thumbs {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    gap: 0.6rem;
}

.detail-thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, opacity 0.2s;
    opacity: 0.7;
}

.detail-thumb:hover {
    opacity: 1;
}

.detail-thumb.active {
    border-color: var(--accent-color);
    opacity: 1;
}

/* Personal handwritten-style note from the artist, shown below the photos */
.artist-note {
    margin-top: 1rem;
    padding: 1.2rem 1.4rem;
    background-color: var(--bg-alt);
    border-left: 3px solid var(--accent-color);
    border-radius: 4px;
    position: relative;
}

.artist-note-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 0.4rem;
}

.artist-note-text {
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    line-height: 1.35;
    color: var(--primary-color);
    white-space: pre-line;
}

.detail-info {
    flex: 1.4 1 460px;
    min-width: 340px;
    text-align: left;
}

.detail-info h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Shown instead of the "Ajouter au Panier" button when stock = 0 */
.stock-message {
    background-color: var(--bg-alt);
    border-left: 4px solid var(--accent-color);
    color: var(--primary-color);
    font-style: italic;
    padding: 0.9rem 1.1rem;
    border-radius: 4px;
}

/* Shown above the "Ajouter au Panier" button when stock is positive but low */
.low-stock-message {
    color: var(--accent-dark);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.9rem;
}

.detail-specs {
    list-style: none;
    margin: 0.6rem 0 1.5rem;
    padding: 0;
}

.detail-specs li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

/* "Caractéristiques" heading above the specs list */
.detail-specs-title {
    color: var(--primary-color);
    font-size: 1rem;
    letter-spacing: 0.04em;
    margin-top: 1.2rem;
}

.spec-label {
    font-weight: bold;
    color: var(--primary-color);
}

.spec-value {
    color: #555;
}

/* "Prêt à accrocher" bullet: no border-bottom row, just a checkmark note */
.spec-feature {
    justify-content: flex-start !important;
    gap: 0.5rem;
    border-bottom: none !important;
    color: var(--primary-color);
    font-weight: 600;
}

.spec-check {
    color: var(--accent-color);
    font-weight: 700;
}

/* ==========================================================================
   Buyer reviews
   ========================================================================== */

.reviews {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #eee;
}

.reviews h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.reviews-summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.reviews-summary .avg {
    font-weight: bold;
    color: var(--primary-color);
}

.reviews-summary .count {
    color: #777;
    font-size: 0.9rem;
}

.no-reviews {
    color: #777;
    font-style: italic;
    margin-bottom: 1rem;
}

/* Star rating display */
.stars {
    color: var(--accent-color);
    letter-spacing: 2px;
}

.reviews-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
}

.review-item {
    padding: 0.8rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.review-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-author {
    font-weight: bold;
    color: var(--primary-color);
}

.review-date {
    font-size: 0.8rem;
    color: #999;
    margin: 0.2rem 0;
}

.review-comment {
    color: #444;
    margin: 0.3rem 0 0;
}

/* Review form (buyers only) */
.review-form {
    background-color: #faf9f7;
    padding: 1.2rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.review-form h4 {
    margin-bottom: 0.8rem;
    color: var(--primary-color);
}

.review-form select {
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    margin-top: 0.3rem;
}

.submit-review-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.8rem 1.4rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-review-btn:hover {
    background-color: var(--accent-dark);
}

/* Message shown to non-buyers */
.review-locked {
    color: #777;
    font-style: italic;
    background-color: #f7f7f7;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

/* ==========================================================================
   Admin panel (admin.html)
   ========================================================================== */

.admin-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--primary-color);
    letter-spacing: 0.05em;
}

.admin-main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2.5rem 2.5%;
    min-height: 60vh;
}

.admin-login {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.admin-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    padding: 2.2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 8px 24px rgba(36, 33, 28, 0.08);
}

.admin-submit {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
}

/* Larger description textarea in the admin form: room for several
   paragraphs, resizable vertically, line breaks are preserved. */
.admin-textarea {
    min-height: 10rem;
    resize: vertical;
    line-height: 1.5;
}

.admin-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* "Prêt à accrocher" checkbox row in the admin form */
.admin-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
    color: var(--primary-color);
    cursor: pointer;
}

.admin-checkbox-group input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--accent-color);
}

.admin-error {
    background-color: #fdecea;
    border-left: 4px solid #c0392b;
    color: #c0392b;
    padding: 0.7rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    margin: 0.8rem 0;
}

.admin-feedback {
    background-color: #eafaf0;
    border-left: 4px solid #27ae60;
    color: #1e7e46;
    padding: 0.7rem 1rem;
    border-radius: 4px;
    margin-bottom: 1.2rem;
}

.admin-feedback-error {
    background-color: #fdecea;
    border-left-color: #c0392b;
    color: #c0392b;
}

/* Section switcher: "Gestion des produits" / "Gestion des commandes" */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 2rem;
}

.admin-tab {
    background: none;
    border: none;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    padding: 0.9rem 0.4rem;
    margin-right: 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.admin-tab:hover {
    background: none;
    color: var(--primary-color);
}

.admin-tab.active {
    background: none;
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-toolbar .section-eyebrow {
    margin-bottom: 0;
}

.admin-table-wrap {
    overflow-x: auto;
    background-color: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--border-soft);
    white-space: normal;
    word-break: break-word;
}

.admin-table th {
    color: var(--primary-color);
    font-weight: 600;
    background-color: var(--bg-alt);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-row-actions {
    display: flex;
    gap: 0.8rem;
}

/* Free-text carrier / tracking number field in the orders table */
.admin-tracking-input {
    min-width: 220px;
    margin-top: 0;
    font-size: 0.85rem;
    padding: 0.5rem 0.7rem;
}

.admin-link-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
}

.admin-link-btn:hover {
    color: var(--accent-dark);
}

.admin-link-danger {
    color: #c0392b;
}

.admin-link-danger:hover {
    color: #8f2a1f;
}

/* Existing-photos gallery in the admin add/edit form: thumbnails with a
   small delete button in the corner. */
.admin-image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.admin-image-thumb {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
}

.admin-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-image-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    line-height: 20px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: rgba(192, 57, 43, 0.9);
    color: #fff;
    font-size: 1rem;
    text-align: center;
    cursor: pointer;
}

.admin-image-remove:hover {
    background-color: #8f2a1f;
}

/* ==========================================================================
   Responsive design: tablets and mobile phones
   ========================================================================== */

/* Tablets and small laptops */
@media (max-width: 992px) {
    .hero-inner {
        flex-direction: column;
    }

    .hero-text {
        text-align: center;
    }

    .eyebrow,
    .hero-actions {
        justify-content: center;
    }

    .hero-divider {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-desc {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-text h1 {
        font-size: 2.4rem;
    }

    /* Home page collections preview: 2 columns on tablets */
    .home-collections .products {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Header / navigation en mode "burger" dès 992 px pour couvrir les
       grands téléphones et petites tablettes : le menu se replie et le
       burger passe tout à droite. */
    header {
        padding: 0.4rem 4% 0.4rem 0;
        flex-wrap: wrap;
    }

    .logo-img {
        height: 2.6rem;
    }

    .logo-signature {
        height: auto;
        width: 11.5rem;
    }

    /* Show the hamburger button on mobile, pushed to the far right */
    .nav-toggle {
        display: block;
        order: 1;
        margin-left: auto;
    }

    /* On mobile the search + cart icons move inside the dropdown menu:
       hidden by default, revealed only when the menu is open. */
    .header-icons {
        order: 4;
        width: 100%;
        display: none;
        justify-content: flex-start;
        gap: 1.8rem;
        padding-top: 0.9rem;
        margin-top: 0.2rem;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }

    .main-nav.open ~ .header-icons {
        display: flex;
    }

    /* Keep only the search and the cart in the menu: hide the account icon */
    .header-icons > span.icon-btn {
        display: none;
    }

    /* Collapse the menu: hidden until the hamburger is clicked.
       flex: 0 0 100% neutralise le "flex: 1" de base (flex-basis: 0%) qui,
       sinon, ignore width:100% et empêche la nav de passer sur sa propre
       ligne : elle resterait alors comprimée à côté du burger. */
    .main-nav {
        order: 3;
        flex: 0 0 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .main-nav.open {
        max-height: 400px;
        margin-top: 0.8rem;
    }

    .main-nav a {
        padding: 0.3rem 0;
    }

    #detail-main-image {
        height: 340px;
    }
}

/* Mobile phones */
@media (max-width: 768px) {
    .hero {
        min-height: 380px;
        padding: 2.5rem 1rem;
    }

    .hero-text h1 {
        font-size: 1.9rem;
    }

    .eyebrow,
    .hero-text h1,
    .hero-subtitle,
    .hero-divider {
        margin-bottom: 0.4rem;
    }

    .hero-desc {
        margin-bottom: 0.8rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        justify-content: center;
    }

    /* Sur mobile, resserrer l'espace vertical entre les 4 avantages */
    .features {
        flex-direction: column;
        gap: 0.3rem;
    }

    .feature {
        border-left: none;
        border-top: 1px solid var(--border-soft);
        padding: 0.3rem 0 0;
        gap: 0.6rem;
    }

    .feature:first-child {
        border-top: none;
        padding-top: 0;
    }

    .feature h3 {
        margin-bottom: 0.1rem;
    }

    /* Collection cards take the full width on small screens */
    .products {
        grid-template-columns: 1fr;
    }

    /* Home page preview: 2 columns instead of 4 on small screens */
    .home-collections .products {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Modals use almost the whole screen for readability */
    .modal-content {
        width: 95%;
        padding: 1.2rem;
        max-height: 92vh;
    }

    /* Detail view stacks the gallery on top of the information */
    .detail-layout {
        flex-direction: column;
        gap: 1.2rem;
    }

    /* On small screens the gallery stays a tall vertical rectangle, with
       the thumbnails kept as a narrow column on the left of the main
       picture (same layout as desktop, just narrower). */
    #detail-main-image {
        height: 420px;
    }

    .detail-thumb {
        width: 50px;
        height: 50px;
    }

    /* Card fields (expiration / CVC) stack vertically on very small screens */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Mobile portrait: use the dedicated portrait image, centered, and tighten
   the vertical spacing between the 4 feature blocks even further. */
@media (max-width: 768px) and (orientation: portrait) {
    .hero {
        background-position: center;
        background-size: cover;
        background-repeat: no-repeat;
        animation: heroSlideshowMobile 20s infinite;
    }

    @keyframes heroSlideshowMobile {

        0%, 24% {
            background-image: url('images/fond_site_mobile.webp');
        }

        25%, 49% {
            background-image: url('images/fond_site_olivier_mobile.webp');
        }

        50%, 74% {
            background-image: url('images/fond_site_paysage_mobile.webp');
        }

        75%, 100% {
            background-image: url('images/fond_site_abstrait_mobile.webp');
        }
    }

    /* Switching from a single stacked column (4 rows) to a compact 2x2
       grid with smaller icons/text cuts the section's overall height by
       roughly 60% compared to the previous stacked layout. */
    .features {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem 0.8rem;
        padding: 0.5rem 4%;
    }

    .feature {
        gap: 0.4rem;
        padding: 0;
        border: none;
    }

    .feature-icon svg {
        width: 18px;
        height: 18px;
    }

    .feature h3 {
        font-size: 0.7rem;
        margin-bottom: 0;
        line-height: 1.2;
    }

    .feature p {
        font-size: 0.7rem;
        line-height: 1.2;
    }
}

/* Mobile landscape: use the standard image, centered, and keep the 4
   feature blocks on a single row by shrinking their width/text/icons.
   Phones in landscape are often wider than 768px (e.g. 812-930px), so this
   targets short viewports (max-height) rather than narrow ones (max-width)
   to reliably catch phones regardless of their landscape width. */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        background-image: url('images/fond_site.webp');
        background-position: center;
    }

    .features {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.3rem;
        padding: 0.6rem 2%;
    }

    .feature {
        flex: 1 1 0;
        min-width: 0;
        border-left: 1px solid var(--border-soft);
        border-top: none;
        padding: 0 0.4rem;
        gap: 0.4rem;
    }

    .feature:first-child {
        border-left: none;
        padding-left: 0;
    }

    .feature-icon svg {
        width: 20px;
        height: 20px;
    }

    .feature h3 {
        font-size: 0.65rem;
        margin-bottom: 0.1rem;
    }

    .feature p {
        font-size: 0.6rem;
    }

    /* Hide the logo/signature/menu row entirely and replace it with a
       small burger button fixed in the top-left corner. Clicking it opens
       the whole header (logo, signature, navigation, icons) as a panel
       overlaying the top of the page. Excluded on the admin page, which has
       no burger button to reopen the header. */
    body:not(.admin-body) header {
        padding: 0;
        min-height: 0;
        border-bottom: none;
    }

    body:not(.admin-body) .logo,
    body:not(.admin-body) .logo-signature-wrap,
    body:not(.admin-body) .main-nav,
    body:not(.admin-body) .header-icons {
        display: none;
    }

    body:not(.admin-body) .nav-toggle {
        display: block;
        position: fixed;
        top: 0.5rem;
        left: 0.5rem;
        margin-left: 0;
        order: 0;
        background-color: var(--cream);
        border: 1px solid var(--border-soft);
        border-radius: 4px;
        z-index: 260;
    }

    body:not(.admin-body) header.menu-open {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
        width: 100%;
        max-height: 100vh;
        overflow-y: auto;
        padding: 3rem 1rem 1rem;
        background-color: var(--cream);
        border-bottom: 1px solid var(--border-soft);
        z-index: 255;
    }

    body:not(.admin-body) header.menu-open .logo,
    body:not(.admin-body) header.menu-open .logo-signature-wrap,
    body:not(.admin-body) header.menu-open .main-nav,
    body:not(.admin-body) header.menu-open .header-icons {
        display: flex;
    }
}

/* Small phones */
@media (max-width: 400px) {
    .logo-signature {
        width: 7.5rem;
    }

    .hero-text h1 {
        font-size: 1.6rem;
    }

    #detail-main-image {
        height: 340px;
    }

    button {
        padding: 0.7rem 1rem;
        font-size: 0.95rem;
    }
}

/* ------------------------------------------------------------------ */
/* Cookie consent banner (RGPD / CNIL)                                 */
/* ------------------------------------------------------------------ */
.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 1000;
    max-width: 720px;
    margin: 0 auto;
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-soft);
    border-top: 4px solid var(--accent-color);
    border-radius: 6px;
    box-shadow: 0 18px 45px rgba(36, 33, 28, 0.25);
    padding: 1.3rem 1.4rem;
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-banner h2 {
    font-size: 1.15rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.cookie-banner p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.cookie-banner a {
    color: var(--accent-dark);
}

.cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

/* Accept and refuse buttons share the same visual weight (CNIL requirement). */
.cookie-btn {
    flex: 1 1 auto;
    min-width: 140px;
    padding: 0.7rem 1.2rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--primary-color);
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.cookie-btn-accept {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.cookie-btn-accept:hover {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
}

.cookie-btn-refuse {
    background-color: transparent;
    color: var(--primary-color);
}

.cookie-btn-refuse:hover {
    background-color: var(--primary-color);
    color: #fff;
}

@media (max-width: 480px) {
    .cookie-actions {
        flex-direction: column;
    }
}