/* Herba Rise commerce refresh
   Scoped to the approved bundle, cart, and checkout presentation. */

.commerce-page {
  --commerce-forest: #2D5016;
  --commerce-gold: #B4933D;
  --commerce-cream: #FAF7F2;
  --commerce-stone: #F0EBE3;
  --commerce-ink: #1F271B;
  --commerce-muted: #62685D;
  --commerce-border: rgba(45, 80, 22, 0.16);
  --commerce-gold-border: rgba(180, 147, 61, 0.46);
  --commerce-gold-soft: rgba(180, 147, 61, 0.12);
  color: var(--commerce-ink);
}

.commerce-page .btn {
  min-height: 48px;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 700;
}

.commerce-page .btn--primary {
  background: var(--commerce-forest);
  border-color: var(--commerce-forest);
  color: var(--commerce-cream);
  box-shadow: 0 8px 22px rgba(45, 80, 22, 0.16);
}

.commerce-page .btn--primary:hover,
.commerce-page .btn--primary:focus-visible {
  background: #244512;
  border-color: #244512;
  color: var(--commerce-cream);
}

.commerce-btn--secondary {
  background: transparent;
  border-color: var(--commerce-forest);
  color: var(--commerce-forest);
}

.commerce-btn--secondary:hover,
.commerce-btn--secondary:focus-visible {
  background: var(--commerce-stone);
  border-color: var(--commerce-forest);
  color: var(--commerce-forest);
  transform: translateY(-1px);
}

.commerce-page :is(a, button, input, textarea):focus-visible {
  outline: 3px solid rgba(180, 147, 61, 0.48);
  outline-offset: 3px;
}

.commerce-alert {
  max-width: 800px;
  margin: 0 0 1.5rem;
  padding: 1rem 1.125rem;
  border: 1px solid rgba(153, 27, 27, 0.2);
  border-radius: 12px;
}

.commerce-alert--error {
  background: #FDECEC;
  color: #7F1D1D;
}

/* Keep the purchase-critical cart and checkout controls unobstructed. Support
   remains available in the footer; the floating WhatsApp control stays on
   browsing and product surfaces. */
body:has(.commerce-cart) .floating-whatsapp,
body:has(.commerce-checkout) .floating-whatsapp {
  display: none;
}

/* Standalone bundle */
.commerce-bundle.bundle-detail {
  align-items: start;
}

.commerce-bundle .bundle-detail__media {
  order: 1;
  isolation: isolate;
  border: 1px solid var(--commerce-border);
  border-radius: 20px;
  background: var(--commerce-stone);
  box-shadow: 0 18px 48px rgba(31, 39, 27, 0.12);
}

.commerce-bundle .bundle-detail__media::after {
  content: '';
  position: absolute;
  inset: auto 12% 3% 12%;
  z-index: -1;
  height: 9%;
  border-radius: 50%;
  background: rgba(45, 80, 22, 0.12);
  filter: blur(18px);
}

.commerce-bundle .bundle-detail__media img {
  object-fit: contain;
}

.commerce-bundle .bundle-detail__badge,
.commerce-bundle .bundle-detail__count-chip {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--commerce-gold-border);
  border-radius: 999px;
  background: var(--commerce-cream);
  color: #5E4B1D;
  box-shadow: 0 6px 18px rgba(31, 39, 27, 0.1);
  font-size: 0.8125rem;
  font-weight: 800;
}

.commerce-bundle .bundle-detail__badge {
  top: 1rem;
  right: 1rem;
  padding: 0.4rem 0.75rem;
}

.commerce-bundle .bundle-detail__badge[hidden] {
  display: none !important;
}

.commerce-bundle .bundle-detail__count-chip {
  right: 1rem;
  bottom: 1rem;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  background: var(--commerce-gold);
  color: var(--commerce-cream);
  font-size: 1rem;
}

.commerce-bundle .bundle-detail__panel {
  order: 2;
  border: 1px solid var(--commerce-border);
  border-radius: 20px;
  background: var(--commerce-cream);
  box-shadow: 0 14px 36px rgba(31, 39, 27, 0.09);
  backdrop-filter: none;
}

.bundle-detail__eyebrow {
  margin: 0 0 0.45rem;
  color: var(--commerce-forest);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.commerce-bundle .bundle-detail__panel h1 {
  max-width: 16ch;
  margin-bottom: 0.75rem;
  color: var(--commerce-ink);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 0.98;
}

.commerce-bundle .bundle-detail__desc {
  max-width: 58ch;
  color: var(--commerce-muted);
  line-height: 1.65;
}

.commerce-price {
  margin: 1.25rem 0 0.8rem;
  padding: 1rem 0;
  border-top: 1px solid var(--commerce-border);
  border-bottom: 1px solid var(--commerce-border);
}

.commerce-price__quantity {
  margin-bottom: 0.25rem;
  color: var(--commerce-muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.commerce-bundle .bundle-detail__price-row {
  margin: 0;
  gap: 0.55rem 0.75rem;
}

.commerce-bundle .bundle-detail__price {
  color: var(--commerce-forest);
  font-size: clamp(2rem, 5vw, 2.65rem);
  font-weight: 800;
  line-height: 1;
}

.commerce-bundle .bundle-detail__regular {
  color: var(--commerce-muted);
  font-size: 1rem;
  text-decoration-color: var(--commerce-muted);
  text-decoration-thickness: 1.5px;
}

.commerce-bundle .bundle-detail__save {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--commerce-gold-border);
  border-radius: 999px;
  background: var(--commerce-gold-soft);
  color: #5E4B1D;
  font-size: 0.75rem;
  line-height: 1.2;
}

.commerce-price__per-unit {
  margin-top: 0.45rem;
  color: var(--commerce-muted);
  font-size: 0.8125rem;
}

.bundle-price-status {
  min-height: 1.4rem;
  margin-bottom: 0.75rem;
  color: var(--commerce-forest);
  font-size: 0.8125rem;
  font-weight: 700;
}

.commerce-bundle .bundle-price-assurance {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--commerce-gold-border);
  border-radius: 12px;
  background: var(--commerce-gold-soft);
}

.commerce-bundle .bundle-price-assurance strong {
  color: #5E4B1D;
}

.commerce-bundle .bundle-price-assurance span {
  color: var(--commerce-muted);
}

.commerce-bundle .bundle-detail__items {
  gap: 0.55rem;
}

.commerce-bundle .bundle-detail__items h2 {
  color: var(--commerce-ink);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.commerce-bundle .bundle-detail__item {
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--commerce-stone);
}

.commerce-bundle .bundle-detail__item:hover,
.commerce-bundle .bundle-detail__item:focus-visible {
  border-color: var(--commerce-border);
  color: var(--commerce-forest);
}

.commerce-bundle .purchase-actions {
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.bundle-quantity {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--commerce-border);
}

.bundle-quantity__label {
  color: var(--commerce-ink);
  font-size: 0.875rem;
  font-weight: 700;
}

.commerce-bundle .qty-selector {
  border-color: var(--commerce-border);
  border-radius: 10px;
  background: var(--commerce-cream);
}

.commerce-bundle .qty-selector button {
  background: var(--commerce-stone);
  color: var(--commerce-forest);
}

.commerce-bundle .purchase-actions__help {
  color: var(--commerce-muted);
}

/* Cart */
.commerce-cart .page-header,
.commerce-checkout .page-header {
  padding: clamp(2rem, 5vw, 3.5rem) 0 1rem;
  text-align: left;
}

.commerce-cart .page-header h1,
.commerce-checkout .page-header h1 {
  color: var(--commerce-forest);
}

.commerce-cart .cart-layout,
.commerce-checkout .checkout-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1rem 0 4rem;
}

.commerce-cart .cart-layout {
  align-items: start;
}

.commerce-cart .cart-items {
  display: grid;
  align-content: start;
  align-self: start;
  gap: 12px;
  min-width: 0;
}

.commerce-cart-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 1rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--commerce-border);
  border-radius: 16px;
  background: var(--commerce-cream);
  box-shadow: 0 8px 24px rgba(31, 39, 27, 0.06);
}

.commerce-cart-item.is-updating {
  opacity: 0.68;
  pointer-events: none;
}

.commerce-cart-item.is-updating::after {
  content: "Updating best price…";
  grid-column: 1 / -1;
  color: var(--commerce-forest);
  font-size: 0.75rem;
  font-weight: 800;
}

.add-to-cart-btn.is-loading,
.buy-now-btn.is-loading,
.add-bundle-btn.is-loading {
  cursor: wait;
  opacity: 0.72;
}

.commerce-cart-item__media {
  align-self: start;
  overflow: hidden;
  width: 88px;
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  background: var(--commerce-stone);
}

.commerce-cart-item__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.commerce-cart-item__body {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  min-width: 0;
}

.commerce-cart-item__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.commerce-cart-item__name {
  color: var(--commerce-ink);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  line-height: 1.05;
}

.commerce-cart-item__quantity-label,
.commerce-cart-item__contents {
  color: var(--commerce-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.commerce-cart-item__remove-form {
  flex: 0 0 auto;
}

.commerce-cart-item__remove {
  padding: 0.25rem 0;
  color: #8A3029;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.commerce-cart-item__value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
}

.commerce-cart-item__current {
  color: var(--commerce-forest);
  font-size: 1.125rem;
}

.commerce-cart-item__regular {
  color: var(--commerce-muted);
  font-size: 0.8125rem;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.commerce-cart-item__saving {
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--commerce-gold-border);
  border-radius: 999px;
  background: var(--commerce-gold-soft);
  color: #5E4B1D;
  font-size: 0.6875rem;
  font-weight: 800;
}

.commerce-cart-item__quantity-form {
  justify-self: start;
}

.commerce-cart-item .qty-selector {
  border-color: var(--commerce-border);
  border-radius: 10px;
}

.commerce-cart-item .qty-selector button {
  width: 36px;
  height: 36px;
  background: var(--commerce-stone);
  color: var(--commerce-forest);
}

.commerce-cart-item .qty-selector input {
  width: 42px;
  font-size: 0.875rem;
}

.cart-value-notice {
  border-color: var(--commerce-gold-border);
  border-radius: 12px;
  background: var(--commerce-gold-soft);
  color: #5E4B1D;
}

.commerce-empty-state {
  border: 1px solid var(--commerce-border);
  border-radius: 18px;
  background: var(--commerce-stone);
}

.commerce-empty-state .btn {
  margin-top: 1rem;
}

/* Shared cart/checkout summaries */
.commerce-page .commerce-summary {
  padding: 1.25rem;
  border: 1px solid var(--commerce-border);
  border-radius: 18px;
  background: var(--commerce-stone);
  box-shadow: 0 10px 28px rgba(31, 39, 27, 0.07);
}

.commerce-summary h2 {
  margin-bottom: 1rem;
  color: var(--commerce-ink);
  font-family: var(--font-display);
  font-size: 1.65rem;
  line-height: 1;
}

.commerce-page .commerce-summary__row {
  align-items: flex-start;
  gap: 1rem;
  padding: 0.55rem 0;
  color: var(--commerce-muted);
  font-size: 0.875rem;
}

.commerce-page .commerce-summary__row > :last-child {
  max-width: 55%;
  color: var(--commerce-ink);
  text-align: right;
}

.commerce-page .cart-summary__saving,
.commerce-page .checkout-summary__saving {
  color: #5E4B1D;
}

.commerce-page .cart-summary__saving > :last-child,
.commerce-page .checkout-summary__saving > :last-child {
  color: #5E4B1D;
}

.commerce-summary__subtotal {
  margin-top: 0.25rem;
  border-top: 1px solid var(--commerce-border);
}

.commerce-page .commerce-summary__delivery > :last-child {
  color: var(--commerce-muted);
  font-size: 0.75rem;
}

.commerce-page .commerce-summary__total {
  margin-top: 0.35rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--commerce-border);
  color: var(--commerce-forest);
  font-size: 1.2rem;
}

.commerce-summary__actions {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.commerce-summary__clear {
  margin-top: 0.8rem;
  text-align: center;
}

.commerce-summary__clear button {
  padding: 0.25rem;
  color: var(--commerce-muted);
  font-size: 0.75rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.commerce-summary__delivery-note {
  margin-top: 0.75rem;
  color: var(--commerce-muted);
  font-size: 0.6875rem;
  line-height: 1.5;
}

/* Checkout */
.commerce-checkout .checkout-form {
  padding: clamp(1.1rem, 3vw, 1.75rem);
  border: 1px solid var(--commerce-border);
  border-radius: 18px;
  background: var(--commerce-cream);
  box-shadow: 0 10px 28px rgba(31, 39, 27, 0.06);
}

.checkout-form__header {
  margin-bottom: 1rem;
}

.checkout-form__header h2 {
  color: var(--commerce-ink);
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1;
}

.checkout-form__header p {
  margin-top: 0.35rem;
  color: var(--commerce-muted);
  font-size: 0.875rem;
}

.commerce-checkout .form-note {
  border: 1px solid var(--commerce-gold-border);
  border-left: 3px solid var(--commerce-gold);
  border-radius: 10px;
  background: var(--commerce-gold-soft);
  color: #5E4B1D;
}

.commerce-checkout .form-group label {
  color: var(--commerce-ink);
}

.commerce-checkout .form-group :is(input, textarea) {
  border-color: var(--commerce-border);
  border-radius: 10px;
  background: var(--commerce-cream);
}

.commerce-checkout .form-group :is(input, textarea):focus {
  border-color: var(--commerce-forest);
  box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
}

.checkout-summary__items {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--commerce-border);
}

.checkout-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
}

.checkout-line__identity,
.checkout-line__value {
  display: grid;
  align-content: start;
  gap: 0.1rem;
}

.checkout-line__identity span {
  color: var(--commerce-ink);
  font-size: 0.8125rem;
  font-weight: 700;
}

.checkout-line small {
  color: var(--commerce-muted);
  font-size: 0.6875rem;
}

.checkout-line__value {
  text-align: right;
}

.checkout-line__value strong {
  color: var(--commerce-forest);
  font-size: 0.8125rem;
}

.checkout-line__value span {
  color: var(--commerce-muted);
  font-size: 0.6875rem;
  text-decoration: line-through;
}

.checkout-line__value small {
  color: #5E4B1D;
  font-weight: 700;
}

@media (min-width: 768px) {
  .commerce-cart .cart-items {
    gap: 16px;
  }

  .commerce-cart-item {
    grid-template-columns: 104px minmax(0, 1fr);
    padding: 1.25rem;
  }

  .commerce-cart-item__media {
    width: 104px;
  }
}

@media (min-width: 1024px) {
  .commerce-cart .cart-layout,
  .commerce-checkout .checkout-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 370px);
    gap: clamp(1.5rem, 3vw, 2.5rem);
  }

  .commerce-page .commerce-summary {
    position: sticky;
    top: calc(var(--header-height) + 1.25rem);
  }
}

@media (max-width: 1023px) {
  .commerce-cart .cart-layout,
  .commerce-checkout .checkout-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .commerce-page .commerce-summary {
    position: static;
  }
}

@media (max-width: 1100px) {
  .commerce-bundle .bundle-detail__media {
    order: 1;
    width: min(100%, 560px);
    margin-inline: auto;
  }

  .commerce-bundle .bundle-detail__panel {
    order: 2;
    width: min(100%, 680px);
    margin-inline: auto;
  }
}

@media (max-width: 640px) {
  .commerce-bundle.bundle-detail {
    gap: 1rem;
    padding: 1rem 0 3rem;
  }

  .commerce-bundle .bundle-detail__media,
  .commerce-bundle .bundle-detail__panel {
    border-radius: 16px;
  }

  .commerce-bundle .bundle-detail__panel {
    padding: 1.1rem;
  }

  .commerce-bundle .bundle-detail__panel h1 {
    font-size: clamp(2.1rem, 12vw, 2.8rem);
  }

  .commerce-bundle .purchase-actions {
    grid-template-columns: 1fr;
  }

  .commerce-bundle .purchase-actions > * {
    grid-column: 1;
  }

  .bundle-quantity {
    align-items: center;
  }

  .commerce-bundle .purchase-actions .qty-selector {
    width: auto;
  }

  .commerce-bundle .purchase-actions .qty-selector input {
    flex: 0 0 48px;
  }

  .commerce-cart .page-header,
  .commerce-checkout .page-header {
    padding-top: 1.5rem;
  }

  .commerce-cart-item {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 0.8rem;
    padding: 0.85rem;
  }

  .commerce-cart-item__media {
    width: 72px;
  }

  .commerce-cart-item__heading {
    display: grid;
    gap: 0.35rem;
  }

  .commerce-cart-item__remove-form {
    justify-self: start;
  }

  .commerce-page .commerce-summary {
    padding: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .commerce-page *,
  .commerce-page *::before,
  .commerce-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
.commerce-cart .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
