/* ==========================================================================
   ZOVARIN DESIGN TOKENS & MICRO-INTERACTIONS
   Version: 2026-09-29-spacing-fix
   - Palette: Warm White (#FAF9F6), Charcoal/Olive-Black (#252722), Caramel (#A58B60)
   - Layout: Standardized 4:5 Product Card Ratios; one owner for section spacing
   - Micro-interactions: GPU-accelerated transforms & opacities
   - Full A11y: prefers-reduced-motion compliant
   ========================================================================== */

:root {
  --zv-color-bg: #FAF9F6;
  --zv-color-bg-card: #FFFFFF;
  --zv-color-text: #252722;
  --zv-color-text-secondary: #575954;
  --zv-color-cta: #252722;
  --zv-color-cta-text: #FFFFFF;
  --zv-color-cta-hover: #161814;
  --zv-color-caramel: #A58B60;
  --zv-color-caramel-light: #F4EFE6;
  --zv-color-border: #E8E6E1;
  --zv-color-green: #166534;
  --zv-color-green-light: #F0FDF4;
  --zv-color-green-border: #BBF7D0;

  --zv-radius-sm: 6px;
  --zv-radius-md: 8px;
  --zv-radius-pill: 9999px;

  --zv-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --zv-ease-bounce: cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

/* Global Store Background Color (Zovarin Warm White / Quiet Luxury) */
html,
body,
.content-for-layout,
.header,
#shopline-section-header {
  background-color: var(--zv-color-bg) !important;
}

#shopline-section-announcement-bar {
  background-color: #f4f4ef !important;
}

/* 1. Global Touch Targets & Micro-interactions */
button,
.button,
.product-form__submit,
.btn,
.card__button,
.quick-view-button,
.quick-add-button {
  transition: background-color 150ms ease, color 150ms ease, opacity 150ms ease, border-color 150ms ease, transform 120ms ease !important;
  -webkit-tap-highlight-color: transparent;
}

button:active,
.button:active,
.product-form__submit:active,
.btn:active {
  transform: scale(0.98) !important;
}

/* 2. Primary CTAs & Brand Buttons */
.button.button--primary,
.product-form__submit,
.card__bottom-actions .button,
.card__bottom-actions .product-quick-add-button {
  background-color: var(--zv-color-cta) !important;
  color: var(--zv-color-cta-text) !important;
  border-radius: var(--zv-radius-sm) !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
  border: 1px solid var(--zv-color-cta) !important;
}

.button.button--primary:hover,
.product-form__submit:hover,
.card__bottom-actions .button:hover {
  background-color: var(--zv-color-cta-hover) !important;
  border-color: var(--zv-color-cta-hover) !important;
}

/* 3. Product Cards: 4:5 Aspect Ratio & No-Clip Framing */
.product-card-wrapper .card__inner {
  aspect-ratio: 4 / 5 !important;
  overflow: hidden !important;
  border-radius: var(--zv-radius-sm) !important;
  background-color: #F8F7F4 !important;
}

.product-card-wrapper .card__inner img {
  object-fit: cover !important;
  object-position: center top !important;
  width: 100% !important;
  height: 100% !important;
  transition: opacity 180ms ease, transform 350ms var(--zv-ease-out) !important;
}

.product-card-wrapper:hover .card__inner img {
  transform: scale(1.02);
}

/* Secondary image hover fade */
.product-card-wrapper .card__inner .media--hover-effect > img + img {
  transition: opacity 180ms ease !important;
}

/* Product Card Typography & Hierarchy */
.product-card-wrapper .product__title,
.product-card-wrapper .card__heading {
  font-size: 14.5px !important;
  line-height: 1.35 !important;
  font-weight: 600 !important;
  color: var(--zv-color-text) !important;
  margin-top: 10px !important;
  margin-bottom: 6px !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.product-card-wrapper .price {
  font-size: 15.5px !important;
  font-weight: 700 !important;
  color: var(--zv-color-text) !important;
}

.product-card-wrapper .price-item--regular {
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: #8C8F8A !important;
  margin-left: 6px !important;
}

.product-card-wrapper .price-item--save {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--zv-color-green) !important;
}

/* 4. Streamlined Card Bottom Actions (Clean, Uncrowded) */
.card__bottom-actions {
  display: flex !important;
  gap: 8px !important;
  margin-top: 10px !important;
}

.card__bottom-actions > * {
  flex: 1 !important;
}

@media (max-width: 768px) {
  /* On mobile: keep 1 primary action, prevent overcrowded double buttons */
  .card__bottom-actions {
    gap: 6px !important;
    margin-top: 8px !important;
  }
  .card__bottom-actions .quick-view-button {
    display: none !important; /* Hide redundant quick view on mobile cards */
  }
  .card__bottom-actions .product-quick-add-button {
    height: 38px !important;
    min-height: 38px !important;
    font-size: 13px !important;
    padding: 0 10px !important;
    border-radius: var(--zv-radius-sm) !important;
  }
}

/* 5. Header & Announcement-Bar Strict Protection (Prevent any accidental padding blowouts) */
#shopline-section-announcement-bar,
#shopline-section-header,
.shopline-section-header-sticky,
.shopline-section-header-sticky--always {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
}

#shopline-section-announcement-bar.section-padding,
#shopline-section-announcement-bar .section-padding {
  padding-top: 9px !important;
  padding-bottom: 9px !important;
}

@media (max-width: 768px) {
  #shopline-section-announcement-bar.section-padding,
  #shopline-section-announcement-bar .section-padding {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
  }
}

.header.section--padding {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

/* Spacing is owned by each section's content shell and editor settings.
   Platform wrappers must not add a second layer of padding around that shell. */
#MainContent > .shopline-section:not(.section-padding),
#MainContent > .shopify-section:not(.section-padding) {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* A title banner already supplies its own bottom padding. Keep the product
   filters close below it, across every collection template. */
#MainContent #shopline-section-main-collection-product-list > .section-padding,
#MainContent #shopline-section-main-collection-product-list > infinite-scroll > .section-padding {
  padding-top: 14px !important;
}

/* The empty cart used 80px margins inside another padded section. */
#MainContent #shopline-section-cart-items .section-padding {
  padding-top: 24px !important;
  padding-bottom: 32px !important;
}
#MainContent #shopline-section-cart-items .cart__empty-text-wrapper {
  margin-top: 32px !important;
  margin-bottom: 32px !important;
}

@media (max-width: 768px) {
  #MainContent #shopline-section-main-collection-product-list > .section-padding,
  #MainContent #shopline-section-main-collection-product-list > infinite-scroll > .section-padding {
    padding-top: 10px !important;
  }
  #MainContent #shopline-section-cart-items .section-padding {
    padding-top: 16px !important;
    padding-bottom: 24px !important;
  }
  #MainContent #shopline-section-cart-items .cart__empty-text-wrapper {
    margin-top: 24px !important;
    margin-bottom: 24px !important;
  }
}

/* 6. Accordion & Details Smooth Interaction */
.product__details-container details[open] summary ~ * {
  animation: zv-accordion-fade-in 180ms ease forwards;
}

@keyframes zv-accordion-fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 7. Cart Drawer Smooth Sliding & Overlay */
.cart-drawer__body {
  transition: transform 220ms var(--zv-ease-out), opacity 200ms ease !important;
  will-change: transform;
}

.cart-drawer__overlay {
  transition: opacity 220ms ease !important;
}

/* 8. Full Accessibility / Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    transform: none !important;
  }
}
