/* ==========================================================================
   EBAR BIO THEME - STYLES & TAILWIND HELPERS (Google Stitch Design System)
   ========================================================================== */

/* 0. Strict Viewport & Mobile Boundary Protection */
html {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  -webkit-text-size-adjust: 100%;
  box-sizing: border-box !important;
}

body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  position: relative;
}

*, *::before, *::after {
  box-sizing: border-box !important;
}

/* Ensure media never spills horizontally */
img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 1. Color Utilities */
.bg-primary { background-color: #006c50 !important; }
.bg-primary-container { background-color: #57b894 !important; }
.bg-mint-glow { background-color: #7ED9B5 !important; }
.bg-mint-light { background-color: #E8F7F1 !important; }
.bg-sage-wash { background-color: #EDF6F3 !important; }

.bg-secondary { background-color: #864784 !important; }
.bg-secondary-container { background-color: #fdb0f5 !important; }
.bg-plum-soft { background-color: #F5ECF4 !important; }
.bg-plum-deep { background-color: #5E2750 !important; }

.bg-clinical-amber { background-color: #E67E22 !important; }
.bg-supplement-ruby { background-color: #C0392B !important; }

.bg-surface-alabaster { background-color: #FAF9F6 !important; }
.bg-surface-card { background-color: #FFFFFF !important; }
.bg-surface-container-lowest { background-color: #ffffff !important; }
.bg-surface-container-low { background-color: #eff4ff !important; }
.bg-surface-container { background-color: #e6eeff !important; }
.bg-surface-container-high { background-color: #dee9fc !important; }
.bg-surface-container-highest { background-color: #d9e3f6 !important; }

.text-primary { color: #006c50 !important; }
.text-primary-container { color: #57b894 !important; }
.text-on-primary { color: #ffffff !important; }
.text-secondary { color: #864784 !important; }
.text-on-secondary { color: #ffffff !important; }
.text-on-surface { color: #121c2a !important; }
.text-on-surface-variant { color: #3e4943 !important; }
.text-mint-glow { color: #7ED9B5 !important; }
.text-text-muted { color: #6B7280 !important; }
.text-clinical-amber { color: #E67E22 !important; }
.text-error { color: #ba1a1a !important; }

.border-border-subtle { border-color: #E5EBE8 !important; }
.border-mint-glow { border-color: #7ED9B5 !important; }
.border-outline-variant { border-color: #bdc9c2 !important; }
.border-surface-variant { border-color: #d9e3f6 !important; }

/* 2. Spacing tokens - optimized for edge-to-edge mobile screens */
.p-space-xs { padding: 0.25rem; }
.p-space-sm { padding: 0.5rem; }
.p-space-md { padding: 1rem; }
.p-space-lg { padding: 1.5rem; }
.p-space-xl { padding: 2.5rem; }

.px-margin { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-margin-mobile { padding-left: 0.75rem; padding-right: 0.75rem; }
@media (min-width: 640px) {
  .px-margin { padding-left: 1.25rem; padding-right: 1.25rem; }
}
@media (min-width: 1024px) {
  .px-margin { padding-left: 2rem; padding-right: 2rem; }
}

.gap-space-xs { gap: 0.25rem; }
.gap-space-sm { gap: 0.5rem; }
.gap-space-md { gap: 1rem; }
.gap-space-lg { gap: 1.5rem; }

/* 3. Typography */
.font-display-hero { font-family: 'Cairo', 'Plus Jakarta Sans', sans-serif; font-weight: 700; }
.font-headline-lg { font-family: 'Cairo', 'Plus Jakarta Sans', sans-serif; font-weight: 700; }
.font-headline-md { font-family: 'Cairo', 'Plus Jakarta Sans', sans-serif; font-weight: 600; }
.font-headline-sm { font-family: 'Cairo', 'Plus Jakarta Sans', sans-serif; font-weight: 600; }
.font-title-md { font-family: 'Cairo', 'DM Sans', sans-serif; font-weight: 600; }
.font-body-lg { font-family: 'Cairo', 'DM Sans', sans-serif; font-weight: 400; }
.font-body-md { font-family: 'Cairo', 'DM Sans', sans-serif; font-weight: 400; }
.font-body-sm { font-family: 'Cairo', 'DM Sans', sans-serif; font-weight: 400; }
.font-label-lg { font-family: 'Cairo', 'DM Sans', sans-serif; font-weight: 600; }
.font-label-md { font-family: 'Cairo', 'DM Sans', sans-serif; font-weight: 600; }
.font-label-sm { font-family: 'Cairo', 'DM Sans', sans-serif; font-weight: 700; }
.font-price-lg { font-family: 'Plus Jakarta Sans', 'Cairo', sans-serif; font-weight: 700; }

/* 4. Products Grid - Compact 2-column mobile grid matching Google Stitch */
.products-catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .products-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }
}
@media (min-width: 1024px) {
  .products-catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

/* 5. Modals & Drawers */
.noor-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  background-color: rgba(18, 28, 42, 0.65) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.25s ease-in-out !important;
}
.noor-modal-overlay.active {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}
.noor-modal-card {
  background: #ffffff !important;
  border-radius: 1.5rem !important;
  max-width: 92% !important;
  width: 540px;
  max-height: 90vh !important;
  overflow-y: auto !important;
  box-shadow: 0 24px 48px -12px rgba(31, 41, 55, 0.25) !important;
  transform: translateY(20px) !important;
  transition: transform 0.25s ease-in-out !important;
  position: relative !important;
  border: 1px solid #E5EBE8 !important;
}
.noor-modal-overlay.active .noor-modal-card {
  transform: translateY(0) !important;
}

/* 6. Toast Notifications */
.noor-toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #006c50;
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 25px -4px rgba(0, 108, 80, 0.35);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 999999;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.noor-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 7. Quantity Box Styling */
.quantity-box {
  display: inline-flex;
  align-items: center;
  background: #FAF9F6;
  border: 1px solid #E5EBE8;
  border-radius: 9999px;
  padding: 3px;
}
.quantity-box button {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid #E5EBE8;
  color: #121c2a;
  cursor: pointer;
  transition: all 0.2s;
}
.quantity-box button:hover {
  background: #E8F7F1;
  color: #006c50;
}
.quantity-box .qty-input {
  width: 44px;
  text-align: center;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 15px;
  color: #121c2a;
}
.quantity-box .qty-input:focus {
  outline: none;
  box-shadow: none;
}

/* 8. Tabs in Single Product */
.tab-button {
  position: relative;
  font-weight: 600;
  color: #6B7280;
  padding-bottom: 0.75rem;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab-button.active-tab {
  color: #006c50;
  font-weight: 700;
}
.tab-button.active-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  height: 3px;
  background-color: #006c50;
  border-radius: 9999px;
}

/* 9. Mobile Helpers & Touch Optimizations */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.safe-area-bottom {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.5rem);
}
.touch-callout-none {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
@media (max-width: 767px) {
  body {
    padding-bottom: 74px; /* Space for fixed bottom navigation or checkout bar */
  }
  body.single-product {
    padding-bottom: 96px; /* Space for mobile sticky action bar */
  }
}

/* 10. WooCommerce Compatibility & Notice Banners */
.woocommerce, .woocommerce-page {
  width: 100% !important;
  max-width: 100% !important;
}

.woocommerce-notices-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto 1.25rem auto !important;
  display: block !important;
}

.woocommerce-message, 
.woocommerce-info, 
.woocommerce-error {
  border-radius: 1rem !important;
  padding: 0.875rem 1.25rem !important;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
  margin-bottom: 1rem !important;
  border-top-width: 0 !important;
  border-left-width: 0 !important;
  border-bottom-width: 0 !important;
  border-right-width: 4px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.woocommerce-message {
  background-color: #E8F7F1 !important;
  color: #004532 !important;
  border-right-color: #006c50 !important;
}

.woocommerce-info {
  background-color: #F5ECF4 !important;
  color: #5E2750 !important;
  border-right-color: #864784 !important;
}

.woocommerce-error {
  background-color: #ffdad6 !important;
  color: #93000a !important;
  border-right-color: #ba1a1a !important;
}

/* 11. Elementor Seamless Full-Width Integration */
.elementor-page .entry-content,
.elementor-page .page-content {
  margin: 0 !important;
  padding: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

.elementor-section.elementor-section-stretched {
  max-width: 100vw !important;
  left: 0 !important;
  right: 0 !important;
}

/* Eliminate horizontal bleed on container grids */
[class*="grid-cols-"] {
  max-width: 100%;
}

