@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;700&display=swap');

/*
 * Colour palette and global styles
 *
 * The primary colour is a warm yellow inspired by the Piou Piou mascot.  
 * The secondary tone is a light beige which complements the yellow and
 * creates a soft backdrop for the content.  
 * Text colours are kept dark for good contrast and readability.
 */

:root {
  --primary: #f3c623;
  --secondary: #fdf5e6;
  --accent: #f0a202;
  --text-dark: #333333;
  --text-light: #555555;
}

body {
  font-family: 'Nunito', sans-serif;
  margin: 0;
  background-color: var(--secondary);
  color: var(--text-dark);
  line-height: 1.5;
}

/* Header and Navigation */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--secondary);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

header .logo {
  display: flex;
  align-items: center;
}

header .logo img {
  height: 40px;
  margin-right: 10px;
}

nav ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

nav li {
  margin: 0 1rem;
}

nav a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 600;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--primary);
}

.language-switcher {
  display: flex;
  align-items: center;
}

.language-switcher button {
  background: none;
  border: none;
  margin-left: 8px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-dark);
}

.language-switcher button.active {
  color: var(--primary);
}

/* Hero Section */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 4rem 2rem;
  background-color: var(--primary);
  color: #ffffff;
}

.hero-text {
  max-width: 600px;
}

.hero-text h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.hero-text p {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.hero-text .btn {
  background-color: #ffffff;
  color: var(--primary);
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 700;
  transition: background-color 0.2s;
}

.hero-text .btn:hover {
  background-color: rgba(255, 255, 255, 0.9);
}

.hero-image img {
  width: 350px;
  max-width: 100%;
  border-radius: 15px;
}

/* Product Listing */
.products {
  padding: 2rem;
}

.products h2 {
  margin-top: 0;
  font-size: 2rem;
  margin-bottom: 1rem;
  text-align: center;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background-color: #ffffff;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}

.product-card:hover {
  transform: translateY(-5px);
}

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

/*
 * Product image animations
 *
 * Each product card now contains a .product-image wrapper with two images
 * (a back and a front view).  The back image is static while the front
 * image sits on top and fades in and out, creating a gentle cross‑fade
 * animation between the two views.  On the product detail pages a similar
 * wrapper named .image-wrapper is used inside .product-images.
 */

/* Shared styles for both listing cards and detail pages */
.product-image,
.product-images .image-wrapper {
  position: relative;
  overflow: hidden;
}

/* Back image stays underneath and defines the height of the container */
.product-image img.back,
.product-images .image-wrapper img.back {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}

/* Front image overlays the back image and animates its opacity */
.product-image img.front,
.product-images .image-wrapper img.front {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: piouFade 6s infinite;
  /* Start invisible so the back image shows first */
  opacity: 0;
}

/* Keyframes define the cross‑fade: front image appears mid‑cycle */
@keyframes piouFade {
  0%, 40% {
    opacity: 0;
  }
  50%, 90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.product-card .content {
  padding: 1rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.product-card p {
  flex-grow: 1;
  color: var(--text-light);
}

.product-card .price {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0.5rem 0;
  color: var(--primary);
}

.product-card .btn {
  align-self: flex-start;
  background-color: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 700;
  transition: background-color 0.2s;
}

.product-card .btn:hover {
  background-color: #e6b91b;
}

/* Product Detail Page */
.product-detail {
  padding: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.product-detail .images {
  flex: 1;
  min-width: 300px;
}

.product-detail .images img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 1rem;
}

/* When using the new product-images wrapper, apply the border radius and margin
 * to the wrapper instead of the individual images.  The back image retains
 * rounded corners while the front image can remain square because it is
 * absolutely positioned inside. */
.product-images .image-wrapper {
  border-radius: 10px;
  margin-bottom: 1rem;
}
.product-images .image-wrapper img.back {
  border-radius: 10px;
}

.product-detail .info {
  flex: 1;
  min-width: 300px;
}

.product-detail .info h1 {
  margin-top: 0;
}

.product-detail .info .price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 1rem 0;
}

.product-detail .info select,
.product-detail .info input[type="number"] {
  padding: 0.5rem;
  margin-right: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.product-detail .info .add-to-cart {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  border-radius: 25px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.product-detail .info .add-to-cart:hover {
  background-color: #e6b91b;
}

/* Cart Page */
.cart-container {
  padding: 2rem;
}

.cart-container h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.cart-item {
  display: flex;
  align-items: center;
  background-color: #fff;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.cart-item img {
  width: 80px;
  height: auto;
  border-radius: 8px;
  margin-right: 1rem;
}

.cart-item .details {
  flex-grow: 1;
}

.cart-item .details h4 {
  margin: 0;
  font-size: 1.2rem;
}

.cart-item .details .price {
  color: var(--primary);
  font-weight: 700;
  margin: 0.5rem 0;
}

.cart-item .quantity {
  display: flex;
  align-items: center;
}

.cart-item .quantity button {
  background-color: var(--primary);
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  font-weight: 700;
  border-radius: 50%;
  cursor: pointer;
}

.cart-item .quantity span {
  margin: 0 0.5rem;
  min-width: 20px;
  text-align: center;
}

.cart-item .remove-btn {
  background: none;
  border: none;
  color: red;
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: 1rem;
}

.cart-total {
  text-align: right;
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 1rem;
}

.checkout-btn {
  background-color: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
  margin-top: 1rem;
  transition: background-color 0.2s;
}

.checkout-btn:hover {
  background-color: #e6b91b;
}

/* Checkout Form */
form.checkout-form {
  background-color: #fff;
  padding: 2rem;
  border-radius: 15px;
  max-width: 500px;
  margin: 2rem auto;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

form.checkout-form input,
form.checkout-form textarea {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
}

form.checkout-form button {
  width: 100%;
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 25px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
}

form.checkout-form button:hover {
  background-color: #e6b91b;
}

/* Footer */
.footer {
  background-color: var(--secondary);
  padding: 2rem;
  text-align: center;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.footer p {
  margin: 0.5rem 0;
  color: var(--text-light);
}