/* ============================================================
   DOUCEURS D'ALGÉRIE — Main Stylesheet
   Naming: kebab-case with single dash separator
   ============================================================ */

/* ======================== CSS VARIABLES ======================== */
:root {
    --color-bg:           #FAF7F4;
    --color-bg-alt:       #EDE7D9;
    --color-bg-white:     #FFFFFF;
    --color-text:         #1A1A1A;
    --color-text-muted:   #555555;
    --color-text-light:   #888888;
    --color-primary:      #B33B2A;
    --color-primary-dark: #912E21;
    --color-primary-transparent:      #B33B2A0f;
    --color-border:       #D8CFC0;
    --color-card-bg:      #FFFFFF;
  
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'Lato', sans-serif;
  
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 14px;
  
    --shadow-card:       0 2px 10px rgba(0,0,0,0.07);
    --shadow-card-hover: 0 8px 28px rgba(0,0,0,0.13);
  
    /* Wide container — closer to the mockup's full-width feel */
    --container-max: 1200px;
    --section-gap:   72px;
  }
  
  /* ======================== RESET & BASE ======================== */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; z-index: 1;}
  html  { scroll-behavior: smooth; }
  body  {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.65;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
  }
  main {
    overflow-x: hidden;
  }
  img  { display: block; max-width: 100%; height: auto; }
  a    { text-decoration: none; color: inherit; }
  
  /* ======================== CONTAINER ======================== */
  .container {
    max-width: var(--container-max);
    margin: 0 auto;
    /* Reduced side padding so content breathes but isn't cramped */
    padding-left: 32px;
    padding-right: 32px;
  }
  
  /* ======================== BUTTONS ======================== */
  .btn {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s;
    white-space: nowrap;
    line-height: 1.4;
    text-align: center;
  }
  .btn-primary {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
  }
  .btn-primary:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    box-shadow: 0 4px 14px rgba(139,32,32,.28);
  }
  .btn-outline {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
  }
  .btn-outline:hover {
    background-color: var(--color-primary-transparent);
  }
  .btn-full { width: 100%; display: block; text-align: center; }
  
  /* ======================== SECTION SHARED ======================== */
  .section-header  { text-align: center; margin-bottom: 44px; }
  .section-title   {
    font-family: var(--font-display);
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 6px;
  }
  .section-subtitle { font-size: 15px; color: var(--color-text-muted); }
  .section-footer   { text-align: center; margin-top: 44px; 
    display: flex;
    flex-direction: column;
  }
  
  /* ======================== NAVBAR ======================== */
  .navbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    transition: box-shadow .2s;
  }
  .navbar.scrolled { box-shadow: 0 2px 16px rgba(0,0,0,.09); }
  .navbar-inner {
    display: flex;
    align-items: center;
    height: 64px;
    gap: 0;
  }
  .navbar-logo { flex-shrink: 0; margin-right: auto; }
  .logo-box {
    width: 62px;
    height: 62px;
    background-color: var(--color-bg);
    /* border: 1px solid var(--color-border); */
    border-radius: var(--radius-sm);
  }
  .logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
  }
  .navbar-nav {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-right: 32px;
  }
  .nav-link {
    font-size: 14px;
    color: var(--color-text);
    transition: color .2s;
  }
  .nav-link:hover  { color: var(--color-primary); }
  .nav-link.is-active {
    color: var(--color-primary);
    font-weight: 700;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 2px;
  }
  .navbar-cta { font-size: 13px; padding: 9px 18px; }
  
  /* Hamburger */
  .hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
  }
  .hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
  }
  /* Mobile nav */
  .mobile-nav {
    display: none;
    flex-direction: column;
    gap: 16px;
    padding: 20px 32px;
    background-color: var(--color-bg);
    border-top: 1px solid var(--color-border);
  }
  .mobile-nav.is-open { display: flex; }
  
  /* ======================== HERO ======================== */
  .hero { padding: 56px 0 64px; }
  .hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
  }
  .hero-title {
    font-family: var(--font-display);
    font-size: clamp(28px, 3.2vw, 46px);
    font-weight: 700;
    line-height: 1.18;
    margin-bottom: 20px;
  }
  .hero-text {
    font-size: 16px;
    color: var(--color-text-muted);
    margin-bottom: 32px;
    line-height: 1.7;
  }
  .hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;}
  .hero-image img {
    width: 100%;
    border-radius: var(--radius-lg);
    object-fit: cover;
    max-height: 400px;
  }
  .hero-actions .btn { width: 49%; }
  .hero-actions .btn-outline { width: 47%; }
  
  /* ======================== FEATURES ======================== */
  .features {
    padding: 48px 0;
    background-color: var(--color-bg-white);
  }
  .features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  .feature-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 8px 28px 28px 28px;
    text-align: center;
    background-color: var(--color-bg-white);
    transition: box-shadow .2s;
  }
  .feature-card:hover { box-shadow: var(--shadow-card-hover); }
  .feature-card svg {
    color: var(--color-primary);
  }
  .feature-icon  { color: var(--color-primary); }
  .feature-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
  }
  .feature-text { font-size: 14px; color: var(--color-text-muted); }
  
  /* ======================== PRODUCTS ======================== */
  .products {
    padding: var(--section-gap) 0;
    position: relative;
    overflow: hidden;
  }
  /* Decorative watermark */
  .products::before {
    content: 'Pâtisseries';
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-size: 120px;
    font-weight: 700;
    color: rgba(139,32,32,.04);
    white-space: nowrap;
    pointer-events: none;
    z-index: 0;
    user-select: none;
  }
  .products .container { position: relative; z-index: 1; }
  
  .products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
  
  /* Product card — clickable, opens modal */
  .product-card {
    background-color: var(--color-card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: box-shadow .25s, transform .25s;
    border: 1px solid var(--color-border);
  }
  .product-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px);
  }
  .product-image { width: 100%; height: 200px; overflow: hidden; }
  .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
  }
  .product-card:hover .product-image img { transform: scale(1.05); }
  .product-info { 
    padding: 16px 18px 20px; 
    display: flex;
    flex-direction: column;
  }
  .product-cta {
    align-self: flex-start;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
  }
  
  /* Underline animation */
  .product-cta::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 1px;
    background-color: var(--color-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
  }
  
  .product-cta:hover {
    color: var(--color-primary-dark);
  }
  
  .product-cta:hover::after {
    transform: scaleX(1);
  }
  .product-name {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
  }
  .product-desc { font-size: 13px; color: var(--color-text-muted); line-height: 1.6; }

  .products-grid .product-card .product-image {
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* Makes the image container square */
    overflow: hidden;
    position: relative;
  }
  
  .products-grid .product-card .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  /* ======================== PRODUCT MODAL ======================== */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,.45);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, visibility .25s;
  }
  .modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
  }
  
  .modal-box {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: scale(.94);
    transition: transform .25s;
    box-shadow: 0 24px 80px rgba(0,0,0,.22);
  }
  .modal-overlay.is-open .modal-box { transform: scale(1); }
  
  .modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 10;
    background: rgba(255,255,255,.85);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    transition: background-color .2s;
  }
  .modal-close:hover { background-color: #fff; }
  
  /* Large image area — takes upper ~60% of modal */
  .modal-image-wrap {
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
    background-color: var(--color-bg-alt);
  }
  .modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  /* Text block at bottom — matches mockup layout */
  .modal-body {
    padding: 28px 32px 32px;
    flex: 0 1 auto; /* Ensures the text block is visible and scrollable if needed */
    overflow-y: auto;
  }
  .modal-desc {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.75;
  }
  
  /* ======================== EVENTS ======================== */
  .events {
    padding: var(--section-gap) 0;
    background-color: var(--color-bg-white);
  }
  .events-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
  }
  .events-image img {
    width: 100%;
    border-radius: var(--radius-md);
    object-fit: cover;
  }
  .events-title {
    font-family: var(--font-display);
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
  }
  .events-text {
    font-size: 15px;
    color: var(--color-text-muted);
    margin-bottom: 28px;
    line-height: 1.7;
  }
  
  /* ======================== TESTIMONIALS ======================== */
  .testimonials {
    padding: var(--section-gap) 0;
    background-color: var(--color-bg-alt);
  }
  .testimonials .section-title { text-align: center; margin-bottom: 40px; }
  .testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  .testimonial-card {
    background-color: var(--color-bg-white);
    border-radius: var(--radius-md);
    padding: 28px 24px 24px;
    box-shadow: var(--shadow-card);
  }
  .quote-mark {
    font-size: 48px;
    line-height: .9;
    color: var(--color-primary);
    font-family: Georgia, serif;
    margin-bottom: 10px;
    opacity: .7;
  }
  .testimonial-text {
    font-size: 14px;
    color: var(--color-text-muted);
    font-style: italic;
    margin-bottom: 14px;
    line-height: 1.6;
  }
  .testimonial-author { font-size: 13px; font-weight: 700; }
  
  /* ======================== GALLERY ======================== */
  .gallery { padding: var(--section-gap) 0; }
  .gallery .section-title   { text-align: center; margin-bottom: 8px; }
  .gallery .section-subtitle { text-align: center; margin-bottom: 28px; font-weight: 700; color: var(--color-text); }
  
  .gallery-carousel-wrapper {
    position: relative;
  }
  .gallery-carousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
    /* Slightly reveal next item edge on right */
    padding-right: 64px;
  }
  .gallery-carousel::-webkit-scrollbar { display: none; }
  
  /* Each gallery thumbnail */
  .gallery-item {
    flex: 0 0 280px;
    height: 220px;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: var(--shadow-card);
  }
  .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
    display: block;
  }
  .gallery-item:hover img { transform: scale(1.06); }
  
  /* Dark hover overlay with name + description */
  .gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.4) 55%, rgba(0,0,0,.0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px 16px;
    opacity: 0;
    transition: opacity .3s ease;
  }
  .gallery-item:hover .gallery-overlay { opacity: 1; }
  
  .gallery-overlay-name {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    line-height: 1.3;
  }
  .gallery-overlay-desc {
    font-size: 12px;
    color: rgba(255,255,255,.85);
    line-height: 1.5;
  }
  
  /* Arrow button */
  .gallery-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background-color: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    font-size: 26px;
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-card-hover);
    transition: background-color .2s, color .2s;
    z-index: 5;
  }
  .gallery-btn:hover {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
  }
  
  /* ======================== ORDER FORM ======================== */
  .order-form { padding: var(--section-gap) 0; background-color: var(--color-bg-alt); }
  .order-form-inner { max-width: 520px; }
  .order-form .section-title    { text-align: center; margin-bottom: 6px; }
  .order-form .section-subtitle { text-align: center; margin-bottom: 32px; }
  
  .form { display: flex; flex-direction: column; gap: 18px; }
  .form-group { display: flex; flex-direction: column; gap: 5px; }
  .form-label { font-size: 14px; font-weight: 700; }
  .form-input {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-text);
    background-color: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    width: 100%;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
  }
  .form-input::placeholder { color: #BBBBBB; }
  .form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(139,32,32,.1);
  }
  .form-input.is-invalid {
    border-color: #C62828;
    box-shadow: 0 0 0 3px rgba(198,40,40,.1);
  }
  .form-textarea { min-height: 120px; resize: vertical; }
  .form .btn-primary { font-size: 15px; padding: 13px 20px; margin-top: 4px; }
  .form-disclaimer {
    font-size: 12px;
    color: var(--color-text-light);
    line-height: 1.65;
    text-align: center;
    margin-top: -4px;
  }
  
  /* ======================== FOOTER ======================== */
  .footer {
    background-color: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: 52px 0 0;
  }
  .footer-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
    margin-bottom: 44px;
  }
  .footer-heading {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
  }
  .footer-text  { font-size: 13px; color: var(--color-text-muted); margin-bottom: 5px; }
  .footer-link  {
    display: block;
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 5px;
    transition: color .2s;
  }
  .footer-link:hover { color: var(--color-primary); }
  .footer-bottom {
    border-top: 1px solid var(--color-border);
    padding: 18px 0;
    text-align: center;
    font-size: 12px;
    color: var(--color-text-muted);
  }
  
  /* ======================== BODY SCROLL LOCK (modal open) ======================== */
  body.modal-open { overflow: hidden; }
  
  .background-decor {
    position: absolute;
    top: 130vh;
    z-index: 0;
    opacity: 0.1;
    overflow-x: hidden;
    overflow-y: clip;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .background-decor img {
    transform: rotate(-10deg);
  }
  .background-decor :not(img:first-child) {
    display: none;
  }
  /* ======================== RESPONSIVE ======================== */
  
  /* Tablet — ≤ 960px */
  @media (max-width: 960px) {
    :root { --section-gap: 56px; }
  
    .hero-inner         { grid-template-columns: 1fr; gap: 28px; }
    .hero-image         { order: -1; }
    .hero-image img     { max-height: 300px; }
  
    .products-grid      { grid-template-columns: repeat(2, 1fr); }
  
    .events-inner       { grid-template-columns: 1fr; gap: 28px; }
    .events-content    { display: flex; flex-direction: column; }
  
    .testimonials-grid  { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
  
    .footer-inner       { grid-template-columns: repeat(2, 1fr); }
  
    /* Swap to hamburger */
    .navbar-nav, .navbar-cta { display: none; }
    .hamburger { display: flex; }
    .hero-actions .btn, .hero-actions .btn-outline { width: 100%; }
    .product-cta {
      font-size: 1.125rem;
    }
  }
  
  /* Small tablet / large mobile — ≤ 640px */
  @media (max-width: 640px) {
    :root { --section-gap: 44px; }
    .container { padding-left: 20px; padding-right: 20px; }
  
    .features-grid     { grid-template-columns: 1fr; }
    .products-grid     { grid-template-columns: 1fr; }
    .hero-actions      { flex-direction: column; }
  
    .gallery-item      { flex: 0 0 220px; height: 180px; }
    .gallery-carousel  { padding-right: 44px; }
  
    .modal-image-wrap  { height: 240px; }
    .modal-body        { padding: 20px 20px 24px; }
    
    .background-decor :not(img:first-child) {
      display: block;
    }
    .background-decor img:last-child {
      display: none;
    }
  }
  
  /* Mobile — ≤ 420px */
  @media (max-width: 420px) {
    .events-content {
      display: flex;
      flex-direction: column;
    }
    .footer-inner { 
      grid-template-columns: 1fr; 
    }
    .footer-col {
      width: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
    }
    .background-decor img:last-child {
      display: block;
    }
  }