/* Custom Variables */
:root {
  --dark-cyan: hsl(158, 36%, 37%);
  --very-dark-cyan: hsl(158, 36%, 20%);
  --cream: hsl(30, 38%, 92%);
  --very-dark-blue: hsl(212, 21%, 14%);
  --dark-grayish-blue: hsl(228, 12%, 48%);
  --white: hsl(0, 0%, 100%);

  --fs-body: 0.875rem; 
  --fs-title: 2rem;    
  --fs-category: 0.75rem;
  
  --ff-accent: 'Fraunces', serif;   
  --ff-base: 'Montserrat', sans-serif; 
}

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

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

button {
  font: inherit;
  cursor: pointer;
}

/* BASE STYLES */
body {
  font-size: var(--fs-body);
  font-family: var(--ff-base);
  background-color: var(--cream);
  color: var(--dark-grayish-blue);
}

main {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* PRODUCT CARD STRUCTURE */
.product-card {
  display: flex;
  flex-direction: column;
  background-color: var(--white);
  max-width: 21.4375rem; 
  border-radius: 10px;
  overflow: hidden;
}

.product-card__image {
  overflow: hidden;
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-content {
  flex: 1;
  padding: clamp(0.625rem, 3vw, 0.75rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.product-category {
  text-transform: uppercase;
  letter-spacing: 0.3125rem; 
  font-size: var(--fs-category);
}

.product-title {
  font-family: var(--ff-accent);
  color: var(--very-dark-blue);
  font-size: var(--fs-title);
  line-height: 1;
}

.product-description {
  line-height: 1.6;
  max-width: 30ch;
}

.price-wrapper {
  display: flex;
  align-items: center;
  gap: 1.25rem; /* 20px */
}

.price-current {
  color: var(--dark-cyan);
  font-family: var(--ff-accent);
  font-size: var(--fs-title);
}

.price-old {
  font-size: clamp(0.75rem, 2vw, 0.8125rem);
  text-decoration: line-through;
}

.add-to-cart-btn {
  background-color: var(--dark-cyan);
  color: var(--white);
  border: none;
  border-radius: 8px;
 padding: clamp(0.75rem, 2.5vw, 1rem);
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

/* Icon slide effect */
.add-to-cart-btn:hover {
  background-color: var(--very-dark-cyan);
}

/* MEDIA QUERIES (DESKTOP) */
@media (min-width: 37.5rem) {
  .product-card {
    flex-direction: row;
    max-width: 37.5rem; /* 600px */
  }

  .product-card__image,
  .product-content {
    flex: 1 1 50%; 
  }

  .product-content {
    padding: clamp(1.25rem, 4vw, 2rem);
    gap: 1.5rem;    
    justify-content: center;
  }
}

/* --- CCESSIBILITY FALLBACK (The "Alternative") --- */
@media (prefers-reduced-motion: reduce) {
  .product-card {
    animation: none;
  }
  
  .product-card__image img,
  .add-to-cart-btn,
  .add-to-cart-btn img {
    transition: none;
    transform: none;
  }
}

/* --- ACCESSIBILITY ENHANCEMENT (The "Motion" version) --- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .product-card {
    animation: fadeIn 0.4s ease-out forwards;
  }

  .product-card__image img {
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .add-to-cart-btn {
    transition: background-color 0.3s ease, transform 0.1s ease;
  }

  .add-to-cart-btn img {
    transition: transform 0.3s ease-out;
  }

  .product-card:hover img {
    transform: scale(1.08);
  }

  .add-to-cart-btn:hover img {
    transform: translateX(-4px);
  }

  .add-to-cart-btn:active {
    transform: scale(0.97);
  }
}
