/**
 * Vital Healer Labs - Theme Styles
 * Shared styles across OpenCart and custom pages
 * Version 2.0 - Consolidated all duplicate CSS
 */

/* ==================== BRAND COLORS ==================== */
:root {
  --vh-primary: #2d65c7;
  --vh-accent: #0d6efd; /* Blue for footer headings */
  --vh-brand-purple: #b136c7; /* Purple for logo "Vital Healer" text */
}

.text-vh-brand {
  color: var(--vh-brand-purple) !important;
}

/* ==================== BASE STYLES ==================== */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
}

/* ==================== NAVIGATION ==================== */
.navbar-brand img {
  height: 2.5rem;
  width: auto;
}

/* Cart icon size standardization */
.navbar .fa-cart-shopping,
.fa-solid.fa-cart-shopping {
  font-size: 1.1rem !important;
  display: inline-block;
  line-height: 1;
}

.navbar svg.icon {
  width: 1.15rem;
  height: 1.15rem;
}

/* Cart badge styling - Perfect circle (matches old header exactly) */
.badge-overlay,
.badge.rounded-pill.badge-overlay {
  top: -5px;
  right: -5px;
  font-size: 0.65rem;
  padding: 0 !important;
  border: 2px solid white;
  line-height: 1;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: bold;
  color: white !important;
  box-sizing: border-box;
}

/* Single digit numbers (0-9) - perfect circle */
.badge-overlay:not([data-count]),
.badge-overlay[data-count="0"],
.badge-overlay[data-count="1"],
.badge-overlay[data-count="2"],
.badge-overlay[data-count="3"],
.badge-overlay[data-count="4"],
.badge-overlay[data-count="5"],
.badge-overlay[data-count="6"],
.badge-overlay[data-count="7"],
.badge-overlay[data-count="8"],
.badge-overlay[data-count="9"] {
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  padding: 0 !important;
}

/* ==================== BUTTONS ==================== */
.btn-primary {
  background-color: var(--vh-primary);
  border-color: var(--vh-primary);
}

.btn-primary:hover {
  background-color: #2456a8;
  border-color: #2456a8;
}

.btn-outline-primary {
  color: var(--vh-primary);
  border-color: var(--vh-primary);
}

.btn-outline-primary:hover {
  background-color: var(--vh-primary);
  border-color: var(--vh-primary);
  color: white;
}

/* ==================== OFFCANVAS CART ==================== */
.offcanvas {
  position: fixed;
  bottom: 0;
  z-index: 1045;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  visibility: hidden;
  background-color: #fff;
  background-clip: padding-box;
  outline: 0;
  transition: transform 0.3s ease-in-out;
}

.offcanvas-end {
  top: 0;
  right: 0;
  width: 400px;
  border-left: 1px solid rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
}

.offcanvas.show {
  transform: none;
  visibility: visible;
}

.offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem;
  border-bottom: 1px solid #dee2e6;
}

.offcanvas-body {
  flex-grow: 1;
  padding: 1rem;
  overflow-y: auto;
}

.offcanvas-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  width: 100vw;
  height: 100vh;
  background-color: #000;
}

.offcanvas-backdrop.fade {
  opacity: 0;
}

.offcanvas-backdrop.show {
  opacity: 0.5;
}

/* ==================== PRODUCT CARDS ==================== */
.product-card {
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
}

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

.product-image {
  height: 200px;
  object-fit: cover;
}

/* ==================== PRODUCT PAGE STYLES ==================== */

/* Trust Badge Icons (Blue) */
.vh-trust-badges .icon {
  width: 1.35rem;
  height: 1.35rem;
  color: #2d65c7;
}

/* Key Research Checkmarks (Green) */
.key-research-card .icon {
  width: 1.05rem;
  height: 1.05rem;
  color: #198754;
}

/* Alert Icons */
.alert .icon {
  width: 1.1rem;
  height: 1.1rem;
  color: inherit;
}

/* Dosage Button Text Wrapping Fix */
label.btn[for^="dosage-"] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  height: auto;
  min-height: 3rem;
  padding: 0.75rem;
}

label.btn[for^="dosage-"] > div {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

label.btn[for^="dosage-"] > small {
  font-size: 0.875rem;
  opacity: 0.85;
}

/* Quality Testing Card Borders */
.quality-testing-card {
  border-color: #0a4fad !important;
}

.quality-testing-card .quality-testing-value {
  color: #053061;
  font-weight: 600;
}

/* ==================== ICONS ==================== */
svg.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  fill: currentColor;
}

.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  fill: currentColor;
}

.icon-2x { width: 2em; height: 2em; }
.icon-3x { width: 3em; height: 3em; }

/* Icon spacing utilities */
.me-2 { margin-right: 0.5rem; }
.ms-2 { margin-left: 0.5rem; }
.mb-2 { margin-bottom: 0.5rem; }

/* ==================== COOKIE CONSENT BANNER ==================== */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #212529;
  padding: 1.5rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  border-top: 3px solid #2d65c7;
  z-index: 9999;
  display: none;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
}

.cookie-consent-banner.show {
  transform: translateY(0);
}

/* Close button - circular with hover effect */
.cookie-consent-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(45, 101, 199, 0.1);
  color: #2d65c7;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.cookie-consent-close:hover {
  background: rgba(45, 101, 199, 0.2);
  transform: rotate(90deg);
}

.cookie-consent-close:focus {
  outline: 2px solid #2d65c7;
  outline-offset: 2px;
}

.cookie-consent-close svg {
  width: 16px;
  height: 16px;
}

.cookie-consent-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cookie-consent-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: rgba(45, 101, 199, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2d65c7;
}

.cookie-consent-text {
  flex: 1;
  min-width: 300px;
}

.cookie-consent-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #212529;
}

.cookie-consent-message {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0;
  opacity: 0.85;
  color: #495057;
}

.cookie-consent-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Cookie Modal */
.cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.cookie-modal.show {
  opacity: 1;
}

.cookie-modal-content {
  background: white;
  border-radius: 1rem;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease-in-out;
}

.cookie-modal.show .cookie-modal-content {
  transform: scale(1);
}

.cookie-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cookie-modal-body {
  padding: 1.5rem;
}

.cookie-modal-footer {
  padding: 1.5rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.cookie-category {
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.cookie-category-header {
  margin-bottom: 0.75rem;
}

.cookie-category-description {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0;
  margin-left: 2.5rem;
}

/* ==================== HOVER EFFECTS ==================== */
.hover-card {
  transition: all 0.2s ease;
  cursor: pointer;
}

.hover-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  border-color: var(--bs-primary) !important;
}

.hover-card:hover strong {
  color: var(--bs-primary) !important;
}

/* ==================== FOOTER ==================== */
.text-vh-accent {
  color: var(--vh-accent) !important;
}

footer.bg-dark a:hover {
  color: #ffffff !important;
  text-decoration: underline;
}

footer .text-white-50:hover {
  color: #ffffff !important;
}

/* ==================== PROMOTIONAL BANNER ==================== */
.promo-banner {
  background-color: var(--vh-accent);
  color: white;
}

.promo-banner .text-warning {
  color: #ffc107 !important;
}

/* ==================== UTILITY CLASSES ==================== */
.text-muted {
  color: #6c757d !important;
}

/* Hero section - DO NOT override background-image set in index.php inline styles */

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .offcanvas-end {
    width: 85%;
    max-width: 400px;
  }
  
  .navbar-brand img {
    height: 2rem;
  }
  
  /* Cookie Consent Mobile */
  .cookie-consent-banner {
    padding: 1rem;
  }
  
  .cookie-consent-content {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  
  .cookie-consent-icon {
    display: none;
  }
  
  .cookie-consent-text {
    min-width: auto;
  }
  
  .cookie-consent-title {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
  }
  
  .cookie-consent-message {
    font-size: 0.85rem;
    margin-bottom: 0;
  }
  
  .cookie-consent-actions {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .cookie-consent-actions button {
    width: 100%;
  }
  
  .cookie-modal-content {
    max-height: 90vh;
    margin: 1rem;
  }
  
  .cookie-modal-footer {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .cookie-modal-footer button {
    width: 100%;
  }
}

/* ==================== ACCESSIBILITY ==================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==================== LOADING STATES ==================== */
.btn[disabled], .btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

/* ==================== ANIMATIONS ==================== */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

.toggle-icon {
  display: inline-block;
  transition: transform 0.3s ease;
  margin-left: 0.25rem;
}

