/* =============================================
   Premium commerce UI — product cards, shop, home
   Inspired by Anveshan, Nestlé Health, premium D2C
============================================= */

/* —— Section headers (editorial) —— */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.section-head__left { max-width: 560px; }

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--earth);
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.section-head p {
  color: var(--text-mid);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Testimonials block — readable ratings line */
.testimonials .section-head p.amazon-summary {
  color: var(--earth);
  font-size: 0.95rem;
  max-width: 520px;
}

.testimonials .section-tag {
  color: var(--green);
  font-weight: 700;
}

.amazon-summary__photos {
  color: #2d5016;
  font-weight: 700;
}

.section-head__link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
  white-space: nowrap;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.section-head__link:hover {
  border-bottom-color: var(--green);
}

/* —— Star rating —— */
.rating-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 10px;
  flex-wrap: wrap;
}

.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.star-rating svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.star-rating--amazon svg {
  width: 16px;
  height: 16px;
}

.review-card .star-rating,
.amazon-summary .star-rating {
  gap: 1px;
}

.rating-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--earth);
}

.rating-count {
  font-size: 0.8rem;
  color: var(--text-mid);
  font-weight: 500;
}

.rating-count::before {
  content: '|';
  margin-right: 6px;
  color: var(--text-light);
}

/* —— Premium product card —— */
.products-grid--premium {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px 20px;
}

.product-card--premium {
  background: var(--white);
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow 0.35s ease, transform 0.35s ease;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card--premium:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.product-card__media {
  position: relative;
  aspect-ratio: 1;
  background: #FAFAF8;
  overflow: hidden;
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: transform 0.5s ease;
}

.product-card--premium:hover .product-card__media img {
  transform: scale(1.04);
}

.product-card__img-link {
  display: block;
  width: 100%;
  height: 100%;
}

.product-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 10px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 2px;
  z-index: 2;
}

.product-card__badge--bestseller { background: var(--earth); color: var(--cream); }
.product-card__badge--new { background: var(--green); color: #fff; }
.product-card__badge--sale { background: var(--terracotta); color: #fff; }

.product-card__wishlist {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.95);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
  font-size: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

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

.product-card__quick-add {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  z-index: 2;
  padding: 11px;
  background: var(--white);
  border: 1.5px solid var(--earth);
  color: var(--earth);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s, color 0.2s;
}

.product-card--premium:hover .product-card__quick-add,
.product-card__quick-add:focus {
  opacity: 1;
  transform: translateY(0);
}

.product-card__quick-add:hover,
.product-card__quick-add.added {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

@media (max-width: 768px) {
  .product-card__quick-add {
    opacity: 1;
    transform: none;
  }
}

.product-card__body {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card__brand {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 4px;
}

.product-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--earth);
  margin: 0 0 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.product-card__title a {
  color: inherit;
  text-decoration: none;
}

.product-card__title a:hover { color: var(--green); }

.product-card__subtitle {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 4px;
  font-weight: 400;
}

.product-card__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: auto;
  padding-top: 12px;
}

.product-card__price .price-sale {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--earth);
}

.product-card__price .price-mrp {
  font-size: 0.82rem;
  color: var(--text-light);
  text-decoration: line-through;
}

.product-card__price .price-off {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--terracotta);
  background: rgba(196, 98, 45, 0.1);
  padding: 2px 6px;
  border-radius: 2px;
}

.product-card__variants {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0 0;
  min-height: 34px;
  align-content: flex-start;
}

.product-card__variants .size-opt {
  min-width: 44px;
  text-align: center;
  padding: 5px 10px;
  font-size: 0.72rem;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 2px;
  text-decoration: none;
  color: var(--text-mid);
  font-weight: 500;
}

.product-card__variants .size-opt.active,
.product-card__variants .size-opt:hover {
  border-color: var(--earth);
  color: var(--earth);
  background: var(--cream);
}

.product-card__variants .size-opt--solo {
  cursor: default;
  pointer-events: none;
}

.product-card__variants .size-opt--solo:hover {
  border-color: var(--earth);
  color: var(--earth);
  background: var(--cream);
}

.product-card__atc {
  width: 100%;
  flex: 0 0 auto;
  margin-top: 12px;
  padding: 10px 8px;
  min-height: 42px;
  max-height: 42px;
  background: var(--earth);
  color: var(--cream);
  border: none;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  cursor: pointer;
  border-radius: 2px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.product-card--premium .product-card__atc.btn-add {
  flex: 0 0 auto !important;
  background: var(--cream);
  color: var(--green);
  border: 2px solid var(--green);
}

.product-card--premium .product-card__atc.btn-add:hover {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.product-card__atc:hover {
  background: var(--green);
}

/* Coin / coupon hint on cards — small inline reference only */
.product-rewards {
  display: block !important;
  margin-top: 4px;
  padding: 0;
  font-size: 0.65rem;
  line-height: 1.3;
  color: var(--text-light);
  background: none;
  border: none;
  min-height: 2.6em;
}

.product-card .alvar-coin-icon {
  display: inline !important;
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  vertical-align: -2px;
  margin-right: 3px;
  flex: none !important;
}

.product-card .alvar-coin-icon__svg {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
}

.product-rewards__line {
  display: block;
}

.product-rewards__line strong {
  color: var(--green);
  font-weight: 600;
}

.product-rewards__line code {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--earth);
}

/* Hide legacy card chrome when premium (not .product-card__*) */
.product-card--premium > .product-img-wrap,
.product-card--premium > .product-info,
.product-card--premium > .product-actions-row {
  display: none !important;
}

/* —— Home: category tiles with image —— */
.category-grid--premium {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.category-tile {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.category-tile__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
}

.category-tile:hover .category-tile__bg {
  transform: scale(1.06);
}

.category-tile__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(30, 18, 8, 0.75) 100%);
}

.category-tile__content {
  position: relative;
  z-index: 1;
  padding: 20px;
  color: #fff;
}

.category-tile__content h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.category-tile__content p {
  font-size: 0.78rem;
  opacity: 0.9;
}

.category-tile__cta {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* —— Home hero refresh —— */
.hero--premium {
  background: var(--cream);
  min-height: auto;
}

.hero--premium .hero-content {
  padding: 48px 0 64px;
  align-items: center;
}

.hero--premium .hero-text h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
}

.hero-trust-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-mid);
}

.hero--premium .hero-img-main {
  aspect-ratio: 1;
  object-fit: contain;
  padding: 24px;
  background: linear-gradient(145deg, #fff 0%, var(--cream-dark) 100%);
}

/* —— Hero product carousel —— */
.hero-carousel {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  transition: opacity 0.4s ease;
}

.hero-carousel--loading {
  opacity: 0;
  min-height: min(88vw, 420px);
  pointer-events: none;
}

.hero-carousel--ready {
  opacity: 1;
  pointer-events: auto;
}

.hero-carousel__track {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: min(88vw, 480px);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #fff 0%, var(--cream-dark) 100%);
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.65s ease;
  pointer-events: none;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.hero-slide__tag {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--earth);
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.hero-slide__tag-icon {
  flex-shrink: 0;
  object-fit: contain;
}

.hero-slide__media {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 16px 8px;
}

.hero-slide__link {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.hero-slide__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.hero-slide__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 14px;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid var(--border);
}

.hero-slide__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hero-slide__name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--earth);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-slide__price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--green);
}

.hero-slide__atc {
  padding: 10px 16px;
  font-size: 0.78rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.hero-carousel__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.hero-carousel__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.hero-carousel__dot.is-active {
  background: var(--green);
  transform: scale(1.15);
}

.hero-carousel__dot:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.hero-rating-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* —— Collection strip —— */
.collection-banner {
  background: var(--earth);
  color: var(--cream);
  padding: 56px 0;
  text-align: center;
}

.collection-banner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 12px;
}

.collection-banner p {
  opacity: 0.85;
  max-width: 480px;
  margin: 0 auto 24px;
  font-size: 0.95rem;
}

/* —— Shop page —— */
.shop-breadcrumb {
  display: block;
  height: auto;
  padding: 16px 0 0;
  font-size: 0.8rem;
  color: var(--text-light);
  background: var(--cream);
}

.shop-breadcrumb a {
  color: var(--text-mid);
  text-decoration: none;
}

.shop-breadcrumb a:hover { color: var(--green); }

/* Shop hero layout — full styles in shop.css (.shop-hero.shop-hero--premium) */

.shop-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.shop-toolbar__count {
  font-size: 0.88rem;
  color: var(--text-mid);
}

.shop-toolbar__count strong {
  color: var(--earth);
  font-weight: 600;
}

.shop-section--premium {
  margin-bottom: 56px;
}

.shop-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.shop-section-head h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--earth);
}

.shop-section-head span {
  font-size: 0.82rem;
  color: var(--text-light);
}

.filter-tab--premium {
  border-radius: 2px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

@media (max-width: 1024px) {
  .category-grid--premium {
    grid-template-columns: repeat(2, 1fr);
  }
}

.product-rail .product-card--premium {
  flex: 0 0 min(260px, 72vw);
  scroll-snap-align: start;
}

@media (max-width: 768px) {
  .category-grid--premium {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .category-tile { aspect-ratio: 3/4; }

  .products-grid--premium {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 12px;
  }

  .product-card__body { padding: 12px; }

  .product-card__title {
    font-size: 0.85rem;
    min-height: auto;
    -webkit-line-clamp: 3;
  }
}
