/* ==========================================
   MADHYA EARTH — shop.css
   Shop page styles
   ========================================== */

/* ======================================
   SHOP HERO
   ====================================== */
.shop-hero {
  min-height: 34vh;
  display: flex;
  align-items: flex-end;
  /* Navbar is always the compact/solid variant on this page (see shop.html),
     never the taller transparent one, so clear by its real height. */
  padding: calc(var(--nav-h-compact) + 2rem) 0 clamp(2.5rem, 5vw, 4rem);
  position: relative;
  overflow: hidden;
}

.shop-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(74, 124, 89, 0.35) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 20%,  rgba(201, 169, 110, 0.1) 0%, transparent 55%),
    var(--bg-dark);
  z-index: 0;
}

.shop-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.shop-hero .eyebrow {
  animation: shop-hero-in 0.8s var(--ease-out) 0.1s both;
}

.shop-hero__heading {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  color: var(--text-light);
  animation: shop-hero-in 0.8s var(--ease-out) 0.25s both;
}

.shop-hero__heading em {
  color: var(--accent-gold);
  font-style: italic;
}

.shop-hero__sub {
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  color: var(--text-light-muted);
  animation: shop-hero-in 0.8s var(--ease-out) 0.4s both;
  max-width: 480px;
}

@keyframes shop-hero-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ======================================
   SHOP TRUST BADGES
   ====================================== */
.shop-trust {
  background: var(--bg-cream);
  border-bottom: 1px solid var(--border-light);
}

.shop-trust__inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding-top: clamp(0.9rem, 2vw, 1.2rem);
  padding-bottom: clamp(0.9rem, 2vw, 1.2rem);
}

.trust-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  min-height: 78px;
  padding: 0.85rem 1rem;
  background: var(--bg-light);
  border: 1px solid rgba(201, 169, 110, 0.22);
}

.trust-badge__icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 46px;
  color: var(--sage);
  background: rgba(132, 168, 124, 0.12);
  border: 1px solid rgba(132, 168, 124, 0.24);
  border-radius: 50%;
}

.trust-badge:nth-child(2) .trust-badge__icon {
  color: var(--accent-terra);
  background: rgba(184, 112, 104, 0.1);
  border-color: rgba(184, 112, 104, 0.22);
}

.trust-badge:nth-child(3) .trust-badge__icon {
  color: var(--accent-gold);
  background: rgba(201, 169, 110, 0.13);
  border-color: rgba(201, 169, 110, 0.28);
}

.trust-badge__label {
  color: var(--text-dark);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.25;
  text-transform: uppercase;
}

/* ======================================
   SHOP BODY
   ====================================== */
.shop-body {
  background: var(--bg-light);
  /* Overrides .section's large symmetric padding — the hero/trust/campaigns
     above already give the page breathing room, so the search/filter bar
     shouldn't need another ~128px gap on top of that before it shows up. */
  padding-top: clamp(2rem, 4vw, 3rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

/* ======================================
   FILTER BAR
   ====================================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0.85rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-bar--tags {
  border-bottom: none;
  margin-bottom: 0;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-tab {
  flex-shrink: 0;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color var(--t-base), border-color var(--t-base);
  white-space: nowrap;
}

.filter-tab:hover { color: var(--text-dark); }

.filter-tab.is-active {
  color: var(--accent-terra);
  border-bottom-color: var(--accent-terra);
  font-weight: 500;
}

.filter-tab--tag {
  padding: 0.55rem 1rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}

/* ======================================
   PRODUCT GRID
   ====================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  min-height: 200px;
}

/* Loading state */
.product-grid__loading {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty state */
.product-grid__empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: var(--space-xl) 0;
  color: var(--text-muted);
  text-align: center;
}

/* ======================================
   PRODUCT CARD
   ====================================== */
.product-card {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: transform var(--t-slow), box-shadow var(--t-slow), border-color var(--t-base);
  display: flex;
  flex-direction: column;
}

/* Whole card is clickable on the shop grid (see js/shop.js) — show the hand cursor everywhere, not just over the image/title links. */
body.page--shop .product-grid .product-card {
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(11, 26, 15, 0.1);
  border-color: rgba(201, 169, 110, 0.4);
}

.product-card__media {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-cream);
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out);
}

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

/* Seasonal overlay badge */
.product-card__seasonal-overlay {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--accent-gold);
  color: var(--bg-dark);
  padding: 3px 10px;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
}

/* Heart (wishlist) button */
.product-card__heart {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 240, 230, 0.9);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  color: rgba(28, 43, 31, 0.4);
  transition: color var(--t-base), background var(--t-base), transform var(--t-fast);
}

.product-card__heart:hover {
  background: rgba(245, 240, 230, 1);
  color: var(--tree-1);  /* clay rose hover — echoes logo tree 1 */
  transform: scale(1.1);
}

.product-card__heart.is-wishlisted {
  color: var(--tree-1);
  background: rgba(184, 112, 104, 0.12);
}

.product-card__heart.is-wishlisted svg {
  fill: var(--tree-1);
  stroke: var(--tree-1);
}

/* Card body */
.product-card__body {
  padding: 1.25rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.product-card__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.product-card__cat {
  color: var(--text-muted);
  font-size: 0.65rem;
  transition: color var(--t-base);
}

a.product-card__cat:hover {
  color: var(--accent-terra);
}

.product-card__badge {
  font-size: 0.6rem;
  padding: 2px 8px;
}

.product-card__name {
  font-family: var(--font-card-title);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-dark);
  letter-spacing: 0.02em;
  line-height: 1.35;
  text-transform: uppercase;
}

.product-card__desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.product-card__price {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text-dark);
}

.product-card__seasonal-price {
  color: var(--accent-gold);
  font-size: 0.65rem;
}

.product-card__cta {
  padding: 0.6rem 1.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.product-card--compact .product-card__body {
  gap: 0.35rem;
}

.product-card--compact .product-card__footer {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.product-card--featured:hover:nth-child(1) { border-color: var(--tree-1); box-shadow: 0 16px 48px rgba(184, 112, 104, 0.14); }
.product-card--featured:hover:nth-child(2) { border-color: var(--tree-2); box-shadow: 0 16px 48px rgba(217, 168, 152, 0.12); }
.product-card--featured:hover:nth-child(3) { border-color: var(--tree-4); box-shadow: 0 16px 48px rgba(178, 196, 188, 0.14); }
.product-card--featured:hover:nth-child(4) { border-color: var(--tree-5); box-shadow: 0 16px 48px rgba(132, 168, 124, 0.16); }

.product-card--account-wishlist .product-card__footer {
  align-items: stretch;
}

.product-card--account-wishlist .account-wishlist-card__remove {
  width: 100%;
  justify-content: center;
}

/* Cart button success state */
.cart-btn.is-added {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}

.notify-btn.is-success {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}

/* Wishlist drawer styles now live in css/wishlist-drawer.css (shared, loaded on every page). */

/* ======================================
   SKELETON CARDS (loading state)
   ====================================== */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

.skeleton {
  --sk-bg:    var(--bg-cream);
  --sk-shine: linear-gradient(90deg, var(--bg-cream) 25%, var(--bg-light) 50%, var(--bg-cream) 75%);
  background: var(--sk-bg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.skeleton__media {
  aspect-ratio: 1;
  background: var(--sk-shine);
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton__body {
  padding: 1.25rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.skeleton__line {
  height: 0.75rem;
  border-radius: 2px;
  background: var(--sk-shine);
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton__line--sm  { width: 45%; }
.skeleton__line--md  { width: 70%; }
.skeleton__line--lg  { width: 90%; }
.skeleton__line--xl  { width: 100%; }
.skeleton__line--h2  { height: 1.2rem; width: 60%; }
.skeleton__line--btn {
  height: 2.2rem;
  width: 45%;
  margin-top: auto;
}

/* ======================================
   CAMPAIGNS CAROUSEL
   ====================================== */
.campaigns-section {
  overflow: hidden;
  line-height: 0;
}

.campaigns-section.is-hidden { display: none; }

.campaigns-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.campaigns-track {
  display: flex;
  transition: transform 0.5s var(--ease-out);
}

.campaigns-slide {
  flex: 0 0 100%;
  position: relative;
  cursor: default;
}

.campaigns-slide a {
  display: block;
  line-height: 0;
}

.campaigns-slide img {
  width: 100%;
  aspect-ratio: 16 / 5;
  object-fit: cover;
}

.campaigns-slide__title {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 300;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0,0,0,0.4);
  line-height: 1;
  padding: var(--gutter);
  pointer-events: none;
}

.campaigns-prev,
.campaigns-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 26, 15, 0.5);
  color: var(--text-light);
  border-radius: 50%;
  transition: background var(--t-base);
}

.campaigns-prev:hover,
.campaigns-next:hover { background: rgba(11, 26, 15, 0.8); }

.campaigns-prev { left: 1rem; }
.campaigns-next { right: 1rem; }

.campaigns-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  background: var(--bg-light);
  line-height: 1;
}

.campaigns-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-light);
  border: 1px solid var(--border-light);
  transition: background var(--t-base);
}

.campaigns-dot.is-active { background: var(--accent-terra); border-color: var(--accent-terra); }

/* ======================================
   NOTIFY ME INLINE FORM
   ====================================== */
.notify-inline {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.notify-inline.is-open { display: flex; }

.notify-inline__input {
  padding: 0.55rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  border: 1px solid var(--border-light);
  background: var(--bg-cream);
  outline: none;
  transition: border-color var(--t-base);
}

.notify-inline__input:focus { border-color: var(--accent-gold); }

.notify-inline__submit {
  padding: 0.55rem 1rem;
  font-size: 0.72rem;
}

/* ======================================
   SEARCH BAR
   ====================================== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.search-bar__input {
  flex: 1;
  padding: 0.65rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--bg-cream);
  border: 1px solid var(--border-light);
  outline: none;
  transition: border-color var(--t-base);
  color: var(--text-dark);
}

.search-bar__input::placeholder { color: var(--text-muted); }
.search-bar__input:focus { border-color: var(--accent-gold); }

/* ======================================
   FULL / SHORT TEXT VARIANTS
   Shorter copy swaps in on mobile (see RESPONSIVE below).
   ====================================== */
.shop-hero__sub-short,
.trust-badge__label-short {
  display: none;
}

/* ======================================
   STICKY SEARCH + FILTER BAR
   Locks under the navbar once scrolled to, tucks away on scroll-down,
   reappears on scroll-up (same pattern as the navbar itself).
   ====================================== */
.shop-sticky-bar {
  position: sticky;
  top: var(--nav-h-compact);
  /* One step below .mobile-menu (also var(--z-nav) - 1) so the open
     mobile nav drawer always paints above it, regardless of DOM order. */
  z-index: calc(var(--z-nav) - 2);
  background: var(--bg-light);
  padding-bottom: clamp(2rem, 4vw, 3.5rem);
  transition: transform 300ms ease, box-shadow 300ms ease;
}

.shop-sticky-bar.is-stuck {
  box-shadow: 0 8px 24px rgba(11, 26, 15, 0.08);
}

.shop-sticky-bar.is-hidden {
  transform: translateY(calc(-100% - var(--nav-h-compact)));
}

/* ======================================
   RESPONSIVE
   ====================================== */
@media (max-width: 767px) {
  /* ---- Hero: shrink to content height, drop the long-form copy ---- */
  .shop-hero {
    min-height: 0;
    padding: calc(var(--nav-h-compact) + 1rem) 0 1.25rem;
  }

  .shop-hero__heading {
    font-size: clamp(2.2rem, 11vw, 3.2rem);
  }

  .shop-hero__sub-full {
    display: none;
  }

  .shop-hero__sub-short {
    display: inline;
  }

  /* ---- Trust badges: fold into the hero as one tight, non-scrolling row ---- */
  .shop-trust {
    background: var(--bg-dark);
    border-bottom: none;
  }

  .shop-trust__inner {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    padding-bottom: 1.25rem;
  }

  .shop-trust__inner .trust-badge {
    flex: 1 1 0;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.4rem;
    min-height: 0;
    padding: 0;
    background: none;
    border: none;
  }

  .shop-trust__inner .trust-badge__icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    background: none;
    border-color: rgba(245, 240, 230, 0.18);
  }

  .shop-trust__inner .trust-badge__icon svg {
    width: 18px;
    height: 18px;
  }

  .shop-trust__inner .trust-badge:nth-child(2) .trust-badge__icon,
  .shop-trust__inner .trust-badge:nth-child(3) .trust-badge__icon {
    background: none;
    border-color: rgba(245, 240, 230, 0.18);
  }

  .shop-trust__inner .trust-badge__label {
    color: var(--text-light-muted);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-align: center;
  }

  .trust-badge__label-full {
    display: none;
  }

  .trust-badge__label-short {
    display: inline;
  }

  /* ---- Sticky search/filter bar: bleed edge-to-edge once locked under the nav ---- */
  .shop-body {
    padding-top: 1.5rem;
  }

  .shop-sticky-bar {
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }

  .product-card__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .product-card__cta {
    justify-content: center;
    text-align: center;
    width: 100%;
  }

  .filter-bar {
    gap: 0;
  }

  .filter-tab {
    padding: 0.75rem 1.25rem;
  }
}

@media (max-width: 400px) {
  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
}

/* ======================================
   SHOP PAGE — MOBILE HORIZONTAL PRODUCT CARDS
   Image-left / text-right list rows (Amazon-style), replacing the
   square grid cards below 768px on the shop page specifically.
   Scoped to body.page--shop so it doesn't affect product cards
   rendered elsewhere (home featured grid, account wishlist, etc.)
   that also load this stylesheet.
   ====================================== */
@media (max-width: 767px) {
  body.page--shop .product-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  body.page--shop .product-grid .product-card {
    flex-direction: row;
    align-items: stretch;
  }

  body.page--shop .product-grid .product-card__media-link {
    flex: 0 0 132px;
  }

  body.page--shop .product-grid .product-card__media {
    width: 132px;
    height: 100%;
  }

  body.page--shop .product-grid .product-card__heart {
    width: 26px;
    height: 26px;
    top: 0.4rem;
    right: 0.4rem;
  }

  body.page--shop .product-grid .product-card__heart svg {
    width: 14px;
    height: 14px;
  }

  body.page--shop .product-grid .product-card__seasonal-overlay {
    top: 0.4rem;
    left: 0.4rem;
    padding: 2px 7px;
    font-size: 0.52rem;
  }

  body.page--shop .product-grid .product-card__body {
    padding: 0.75rem 0.9rem 0.75rem 0.85rem;
    gap: 0.3rem;
    min-width: 0;
  }

  body.page--shop .product-grid .product-card__meta {
    gap: 0.4rem;
  }

  body.page--shop .product-grid .product-card__name {
    font-size: 0.88rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }

  body.page--shop .product-grid .product-card__desc {
    flex: 0 0 auto;
    font-size: 0.78rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }

  body.page--shop .product-grid .product-card__footer {
    margin-top: auto;
    padding-top: 0;
    border-top: none;
  }

  body.page--shop .product-grid .product-card__price {
    font-size: 1.15rem;
    font-weight: 600;
  }

  body.page--shop .product-grid .product-card__cta {
    padding: 0.5rem 1rem;
    font-size: 0.68rem;
  }
}
