/* ============================================
   Biscuits Cui — Style CSS (mobile-first)
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Covered+By+Your+Grace&family=Oswald:wght@300;400;500;600&display=swap');

/* --- CSS Custom Properties --- */
:root {
  --color-title: #B45F06;
  --color-text: #444444;
  --color-bg: #FFFFFF;
  --font-title: 'Covered By Your Grace', cursive;
  --font-body: 'Oswald', sans-serif;
}

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* --- Typography --- */
h1 {
  font-family: var(--font-title);
  color: var(--color-title);
  font-size: 2.2rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

h2 {
  font-family: var(--font-body);
  color: var(--color-title);
  font-size: 1.5rem;
  font-weight: 500;
}

h3 {
  font-family: var(--font-body);
  color: var(--color-title);
  font-size: 1.2rem;
  font-weight: 500;
}

p, li {
  font-family: var(--font-body);
  color: var(--color-text);
  font-size: 1rem;
}

/* --- Focus visible (keyboard accessibility) --- */
a:focus-visible,
button:focus-visible,
details summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-title);
  outline-offset: 2px;
}

/* --- Header & Navigation --- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  background-color: var(--color-bg);
  border-bottom: 2px solid var(--color-title);
  position: relative;
}

.logo img {
  height: 70px;
  width: auto;
}

.logo {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: 1px solid var(--color-title);
  border-radius: 4px;
  font-size: 1.5rem;
  color: var(--color-title);
  cursor: pointer;
}

.nav-links {
  display: none;
  flex-direction: column;
  width: 100%;
  padding: 0.5rem 0;
}

.nav-links.open {
  display: flex;
}

.nav-links li {
  width: 100%;
}

.nav-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-title);
  background-color: #fdf3e7;
}

.nav-links a.active {
  font-weight: 600;
  border-left: 3px solid var(--color-title);
}

.lang-switch {
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: 2px solid var(--color-title);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-title);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-switch:hover {
  background-color: var(--color-title);
  color: var(--color-bg);
}

/* --- Main content --- */
main {
  flex: 1;
  padding: 1.5rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

section {
  margin-bottom: 2rem;
}

/* --- Hero section (accueil) --- */
.hero {
  text-align: center;
  padding: 1rem 0;
}

.hero img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.hero h1 {
  margin-bottom: 4rem;
  font-size: 2.8rem;
}

.hero p {
  margin-bottom: 1rem;
}

/* --- Nouveautés section (accueil) --- */
.nouveautes {
  text-align: center;
  padding: 2rem 0;
}

.nouveautes h2 {
  margin-bottom: 1.5rem;
}

.nouveautes-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.nouveaute-item {
  width: calc(33.333% - 1rem);
  min-width: 150px;
  max-width: 200px;
  text-align: center;
}

.nouveaute-item img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  border-radius: 8px;
  background-color: #fdf8f3;
}

.nouveaute-item p {
  margin-top: 0.5rem;
  font-weight: 500;
  color: var(--color-title);
}

/* --- CTA buttons --- */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-title);
  color: var(--color-bg);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.2s ease;
  margin: 0.5rem 0.25rem;
}

.cta:hover {
  opacity: 0.85;
}

/* --- Catalogue grid --- */
#catalogue-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

/* --- Giant format grid --- */
.giant-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.giant-item {
  width: calc(50% - 0.5rem);
  height: 250px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.giant-grid img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

.rotate-90 {
  transform: rotate(90deg);
}

/* --- Product card --- */
.product-card {
  border: 1px solid #e0d5c7;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--color-bg);
  transition: box-shadow 0.2s ease;
}

.product-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-card img {
  width: 100%;
  height: 350px;
  object-fit: contain;
  background-color: #fdf8f3;
}

/* Conteneur d'image pour gérer le zoom sans débordement */
.product-card .img-container {
  width: 100%;
  height: 350px;
  overflow: hidden;
  background-color: #fdf8f3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card .img-container img {
  height: 100%;
  width: auto;
  max-width: none;
}

/* Agrandir les images plus petites pour qu'elles correspondent à la taille de la chouette */
.product-card[data-product="chat-pain-epices"] .img-container img,
.product-card[data-product="chat-citron-combava"] .img-container img,
.product-card[data-product="chat-coriandre"] .img-container img,
.product-card[data-product="chat-macis"] .img-container img,
.product-card[data-product="mouton-sarrasin"] .img-container img,
.product-card[data-product="oiseau-coco"] .img-container img {
  height: 180%;
}

/* Ours légèrement moins agrandi */
.product-card[data-product="petit-ours-noisette"] .img-container img {
  height: 150%;
}

/* Décaler l'oiseau et le piranha vers le haut */
.product-card[data-product="piranha-navette-marseille"] .img-container {
  align-items: flex-start;
}

.product-card[data-product="piranha-navette-marseille"] .img-container img {
  margin-top: -1.5rem;
}

/* L'oiseau doit être plus haut */
.product-card[data-product="oiseau-coco"] .img-container {
  align-items: flex-start;
}

.product-card[data-product="oiseau-coco"] .img-container img {
  height: 140%;
  margin-top: -4rem;
}

.product-card[data-product="piranha-navette-marseille"] img {
  transform: rotate(270deg);
}

.product-card h3 {
  padding: 0.75rem 1rem 0.25rem;
}

.product-card .shape {
  padding: 0 1rem;
  font-size: 0.9rem;
  font-style: italic;
  color: #8B4513;
}

.product-card .description {
  padding: 0.5rem 1rem;
}

.product-card details {
  padding: 0 1rem 1rem;
}

.product-card details summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 500;
  color: var(--color-title);
}

.product-card details p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* --- Sur-mesure page --- */
.custom-section {
  margin-bottom: 1.5rem;
}

.custom-section h1 {
  margin-bottom: 0.5rem;
}

.custom-section img {
  max-width: 300px;
  width: 100%;
  border-radius: 8px;
}

/* Feature blocks with image + text */
.custom-feature {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  padding: 1.5rem;
  background-color: #fdf8f3;
  border-radius: 8px;
}

.custom-feature-text {
  flex: 1;
}

.custom-feature-text h2 {
  margin-bottom: 0.5rem;
}

.custom-feature-img {
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .custom-feature {
    flex-direction: row;
    gap: 2rem;
  }

  .custom-feature-reverse {
    flex-direction: row-reverse;
  }

  .custom-feature-img img {
    max-width: 250px;
  }
}

/* --- Contact page --- */
.contact-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

.contact-card {
  background-color: #fdf8f3;
  border-radius: 8px;
  padding: 1.5rem;
  width: 100%;
}

.contact-images {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.contact-images img {
  max-width: 300px;
  height: auto;
}

/* Crossfade animation */
.image-crossfade {
  position: relative;
  width: 350px;
  height: 350px;
}

.crossfade-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  animation: fadeIn 8s ease-in-out infinite;
}

.crossfade-img.rotate-90 {
  transform: translate(-50%, -50%) rotate(90deg);
}

.crossfade-img:nth-child(1) {
  animation-name: fadeIn;
}

.crossfade-img:nth-child(2) {
  animation-name: fadeOut;
}

@keyframes fadeIn {
  0%, 40% { opacity: 1; }
  50%, 90% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes fadeOut {
  0%, 40% { opacity: 0; }
  50%, 90% { opacity: 1; }
  100% { opacity: 0; }
}

/* Slideshow animation for multiple images */
.image-slideshow {
  position: relative;
  width: 350px;
  height: 350px;
}

.slideshow-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  max-height: 90%;
  opacity: 0;
  animation: slideshow 30s ease-in-out infinite;
}

.slideshow-img.rotate-270 {
  transform: translate(-50%, -50%) rotate(270deg);
}

.slideshow-img.rotate-90 {
  transform: translate(-50%, -50%) rotate(90deg);
}

.slideshow-img:nth-child(1) { animation-delay: 0s; }
.slideshow-img:nth-child(2) { animation-delay: 3s; }
.slideshow-img:nth-child(3) { animation-delay: 6s; }
.slideshow-img:nth-child(4) { animation-delay: 9s; }
.slideshow-img:nth-child(5) { animation-delay: 12s; }
.slideshow-img:nth-child(6) { animation-delay: 15s; }
.slideshow-img:nth-child(7) { animation-delay: 18s; }
.slideshow-img:nth-child(8) { animation-delay: 21s; }
.slideshow-img:nth-child(9) { animation-delay: 24s; }
.slideshow-img:nth-child(10) { animation-delay: 27s; }

@keyframes slideshow {
  0% { opacity: 0; }
  1% { opacity: 1; }
  9% { opacity: 1; }
  10% { opacity: 0; }
  100% { opacity: 0; }
}

@media (min-width: 768px) {
  .contact-wrapper {
    flex-direction: row;
    align-items: center;
    gap: 2rem;
  }

  .contact-card {
    flex: 1;
    max-width: none;
  }

  .contact-images {
    flex: 1;
  }

  .contact-images img {
    max-width: 100%;
    max-height: 300px;
  }
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #e0d5c7;
}

.contact-item:last-child {
  border-bottom: none;
}

.contact-icon {
  font-size: 1.5rem;
  width: 40px;
  text-align: center;
}

.contact-label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-title);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.contact-item a {
  color: var(--color-text);
  text-decoration: underline;
}

.contact-item a:hover {
  color: var(--color-title);
}

.contact-info {
  margin-bottom: 1.5rem;
}

/* --- SVG Icons --- */
.icon {
  width: 18px;
  height: 18px;
  color: var(--color-title);
  flex-shrink: 0;
  vertical-align: middle;
}

/* --- Distributors page --- */
.distributors-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.distributor-card {
  background-color: #fdf8f3;
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #e0d5c7;
}

.distributor-card h2 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.distributor-info p {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.distributor-info a {
  color: var(--color-text);
  text-decoration: none;
}

.distributor-info a:hover {
  color: var(--color-title);
  text-decoration: underline;
}

.become-distributor {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: #fdf8f3;
  border-radius: 8px;
}

.become-distributor p {
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .distributors-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* --- Legal page --- */
.legal-content {
  max-width: 800px;
}

.legal-content h2 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.legal-content p {
  margin-bottom: 1rem;
}

.legal-content a {
  color: var(--color-title);
}

/* --- Breadcrumb --- */
.breadcrumb {
  font-size: 0.85rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.breadcrumb a {
  color: var(--color-title);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* --- Footer --- */
footer {
  background-color: #f9f5f0;
  border-top: 2px solid var(--color-title);
  padding: 1.5rem 1rem;
  text-align: center;
  margin-top: auto;
}

footer .footer-logo img {
  height: 40px;
  width: auto;
  margin: 0 auto 1rem;
}

footer p {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--color-title);
  font-weight: 500;
}

footer a:hover {
  opacity: 0.8;
}

footer .footer-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

footer .footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  font-size: 1.5rem;
}

/* --- Utility --- */
.text-center {
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   Tablet — min-width: 768px
   ============================================ */
@media (min-width: 768px) {
  /* Navigation: full horizontal nav, hide hamburger */
  .hamburger {
    display: none;
  }

  .nav-links {
    display: flex;
    flex-direction: row;
    width: auto;
    padding: 0;
    gap: 0.25rem;
  }

  .nav-links li {
    width: auto;
  }

  .nav-links a {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
  }

  .nav-links a.active {
    border-left: none;
    border-bottom: 3px solid var(--color-title);
  }

  .navbar {
    flex-wrap: nowrap;
    padding: 0.75rem 2rem;
  }

  /* Main content */
  main {
    padding: 2rem;
  }

  /* Typography */
  h1 {
    font-size: 2.8rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  /* Catalogue grid: 2 columns */
  #catalogue-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  /* Giant grid: 3 columns on tablet */
  .giant-item {
    width: calc(33.333% - 0.67rem);
  }

  /* Hero */
  .hero {
    padding: 2rem 0;
  }

  /* Footer */
  footer {
    padding: 2rem;
  }

  footer .footer-links {
    flex-direction: row;
    justify-content: center;
    gap: 1.5rem;
  }
}

/* ============================================
   Desktop — min-width: 1024px
   ============================================ */
@media (min-width: 1024px) {
  /* Main content */
  main {
    padding: 2.5rem 2rem;
  }

  /* Typography */
  h1 {
    font-size: 3.2rem;
  }

  h2 {
    font-size: 2rem;
  }

  /* Catalogue grid: 3 columns */
  #catalogue-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Navigation */
  .navbar {
    padding: 1rem 3rem;
  }

  .nav-links a {
    padding: 0.5rem 1rem;
  }

  /* Hero layout */
  .hero-images {
    display: flex;
    gap: 1.5rem;
  }

  .hero-images img {
    flex: 1;
  }

  /* Footer */
  footer {
    padding: 2rem 3rem;
  }
}
