/* AMG Carousel — Cafe Design System */
:root {
  --amg-primary:   #5D4432;
  --amg-secondary: #E9E3DD;
  --amg-surface:   #F9F7F5;
  --amg-text:      #3E2B1E;
  --amg-muted:     #7A6A55;
  --amg-white:     #ffffff;
  --amg-radius:    14px;
  --amg-shadow:    0 2px 14px rgba(62, 43, 30, 0.07);
  --amg-shadow-h:  0 10px 32px rgba(62, 43, 30, 0.14);
  --amg-font:      'Poppins', sans-serif;
}

/* Wrapper */
.amg-carousel-wrap {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  font-family: var(--amg-font);
}
.amg-carousel-wrap--has-nav {
  padding: 0 56px;
}

/* Optional section title */
.amg-carousel-title {
  font-family: var(--amg-font);
  font-weight: 700;
  font-size: 28px;
  color: var(--amg-text);
  margin: 0 0 28px;
  text-align: center;
}

/* Nav buttons */
.amg-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--amg-primary);
  color: var(--amg-white);
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.amg-carousel-btn:hover { background: var(--amg-text); }
.amg-carousel-btn:focus-visible {
  outline: 2px solid var(--amg-primary);
  outline-offset: 2px;
}
.amg-carousel-btn--prev { left: 4px; }
.amg-carousel-btn--next { right: 4px; }

.amg-carousel.swiper {
  padding-bottom: var(--amg-dots-spacing, 50px);
}

/* Ensure slides have a base width even before Swiper JS initialises */
.amg-carousel.swiper .swiper-wrapper {
  display: flex;
  width: 100%;
}
.amg-carousel.swiper .swiper-slide {
  flex-shrink: 0;
  width: 100%;
  height: auto;
}

/* Pagination */
.amg-carousel-dots {
  bottom: 0 !important;
  margin-top: 0;
  text-align: center;
}
.amg-carousel-dots .swiper-pagination-bullet {
  background: var(--amg-muted);
  opacity: 0.45;
  width: 8px;
  height: 8px;
}
.amg-carousel-dots .swiper-pagination-bullet-active {
  background: var(--amg-primary);
  opacity: 1;
}

/* ---- Card base ---- */
.amg-card {
  background: var(--amg-white);
  border-radius: var(--amg-radius);
  overflow: hidden;
  box-shadow: var(--amg-shadow);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.amg-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--amg-shadow-h);
}

/* Card image */
.amg-card__img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}
.amg-card__img--placeholder {
  height: 200px;
  background: var(--amg-secondary);
}

/* Card body */
.amg-card__body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

/* Category badge */
.amg-card__cat {
  display: inline-block;
  background: var(--amg-primary);
  color: var(--amg-white);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 4px;
  padding: 3px 9px;
  align-self: flex-start;
}

/* Sale badge */
.amg-card--product {
  position: relative;
}
.amg-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #DC2626;
  color: var(--amg-white);
  font-family: var(--amg-font);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 3px 9px;
  z-index: 2;
}

/* Title */
.amg-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--amg-text);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.amg-card__title a {
  color: inherit;
  text-decoration: none;
}
.amg-card__title a:hover { color: var(--amg-primary); }

/* Excerpt */
.amg-card__excerpt {
  font-size: 13px;
  color: var(--amg-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* Price */
.amg-card__price {
  font-size: 16px;
  font-weight: 600;
  color: var(--amg-primary);
}
.amg-card__price del {
  color: var(--amg-muted);
  font-weight: 400;
  font-size: 13px;
}
.amg-card__price ins {
  text-decoration: none;
}

/* Footer */
.amg-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--amg-secondary);
}

.amg-card__date {
  font-size: 11px;
  color: var(--amg-muted);
}

.amg-card__link {
  font-size: 12px;
  font-weight: 600;
  color: var(--amg-primary);
  text-decoration: none;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.amg-card__link:hover { color: var(--amg-text); }

/* CTA button (Add to cart) */
.amg-card__link--cta {
  background: var(--amg-primary);
  color: var(--amg-white);
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s ease;
}
.amg-card__link--cta:hover {
  background: var(--amg-text);
  color: var(--amg-white);
}
.amg-card__link--cta:focus-visible {
  outline: 2px solid var(--amg-primary);
  outline-offset: 2px;
}

/* ---- Magazine Layout ---- */
.amg-magazine-wrap {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 24px;
}
.amg-magazine-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Horizontal Card */
.amg-card--horizontal {
  flex-direction: row;
  height: auto;
}
.amg-card--horizontal > a,
.amg-card--horizontal > .amg-card__img--placeholder {
  width: 140px;
  flex-shrink: 0;
  height: auto;
  min-height: 120px;
  display: block;
}
.amg-card--horizontal .amg-card__img {
  height: 100%;
}
.amg-card--horizontal .amg-card__body {
  padding: 16px;
  justify-content: center;
}

/* Overlay Card — base */
.amg-card--overlay {
  position: relative;
  display: block;
  height: 100%;     /* fills whatever container it sits in */
  min-height: 420px;
}

/* Carousel + overlay: the swiper container owns the height,
   slides and cards fill it via height:100% */
.amg-carousel-wrap--overlay .amg-carousel.swiper {
  height: 420px;
}
.amg-carousel-wrap--overlay .amg-carousel.swiper .swiper-slide {
  height: 100% !important;
}
.amg-carousel-wrap--overlay .amg-card--overlay {
  min-height: 0; /* let the slide height take over */
}
.amg-card--overlay > a {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.amg-card--overlay .amg-card__img,
.amg-card--overlay .amg-card__img--placeholder {
  height: 100% !important;
  width: 100% !important;
  position: absolute;
  inset: 0;
}
.amg-card--overlay .amg-card__img--placeholder {
  background: var(--amg-secondary);
}
.amg-card--overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,0.85));
  z-index: 2;
  pointer-events: none;
  border-radius: var(--amg-radius);
}
.amg-card--overlay .amg-card__body {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 3;
  padding: 32px;
  background: transparent;
  color: var(--amg-white);
}
.amg-card--overlay .amg-card__title {
  color: var(--amg-white);
  font-size: 24px;
}
.amg-card--overlay .amg-card__title a {
  color: var(--amg-white);
  position: relative;
  z-index: 10;
}
.amg-card--overlay .amg-card__title a:hover {
  text-decoration: underline;
}
.amg-card--overlay .amg-card__excerpt,
.amg-card--overlay .amg-card__date,
.amg-card--overlay .amg-card__price {
  color: rgba(255,255,255,0.8);
}
.amg-card--overlay .amg-card__footer {
  border-top-color: rgba(255,255,255,0.2);
}
.amg-card--overlay .amg-card__badge {
  z-index: 3;
}

/* ---- Responsive ---- */

/* Tablet: keep 3 columns but tighten the grid */
@media (min-width: 769px) and (max-width: 1024px) {
  .amg-magazine-wrap {
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 16px;
  }
}

/* Mobile: show only the center overlay card */
@media (max-width: 768px) {
  .amg-carousel-wrap--has-nav { padding: 0 40px; }
  .amg-carousel-btn  { width: 36px; height: 36px; font-size: 22px; }
  .amg-carousel-btn--prev { left: 0; }
  .amg-carousel-btn--next { right: 0; }
  .amg-carousel-title { font-size: 22px; }

  .amg-magazine-wrap {
    grid-template-columns: 1fr;
  }
  .amg-magazine-col--left,
  .amg-magazine-col--right {
    display: none;
  }
  .amg-magazine-col--center {
    order: -1;
  }
}
@media (max-width: 480px) {
  .amg-carousel-wrap--has-nav { padding: 0 32px; }
  .amg-card__img,
  .amg-card__img--placeholder { height: 170px; }
  .amg-card--horizontal { flex-direction: column; }
  .amg-card--horizontal > a,
  .amg-card--horizontal > .amg-card__img--placeholder { width: 100%; height: 200px; }
}
