/* ==========================================================================
   BioVigor Vital - Components, Modals, Cart Drawer & Checkout Styling
   ========================================================================== */

/* ==========================================================================
   Slide-Over Cart Drawer & Overlay
   ========================================================================== */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 440px;
  height: 100vh;
  background-color: var(--bg-surface);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.cart-drawer.active {
  transform: translateX(0);
}

.cart-drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-drawer-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--secondary);
}

.cart-drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.cart-drawer-close svg {
  width: 24px;
  height: 24px;
}

.drawer-free-shipping {
  background-color: #f0fdf4;
  border-bottom: 1px solid #dcfce7;
  padding: 12px 24px;
}

.free-shipping-progress {
  height: 6px;
  background-color: #d1fae5;
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 6px;
}

.free-shipping-bar {
  height: 100%;
  width: 0%;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

.free-shipping-text {
  font-size: 0.78rem;
  color: #166534;
}

.cart-drawer-items {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-item-row {
  display: flex;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.cart-item-thumb {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-md);
  background-color: #f1f5f9;
  overflow: hidden;
  flex-shrink: 0;
}

.cart-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.cart-item-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1.3;
  margin-bottom: 4px;
}

.cart-item-price-unit {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  background-color: #ffffff;
}

.qty-stepper-sm {
  height: 32px;
}

.qty-stepper-lg {
  height: 48px;
}

.qty-btn {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--secondary);
  cursor: pointer;
}

.qty-stepper-lg .qty-btn {
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
}

.qty-input {
  width: 32px;
  border: none;
  text-align: center;
  font-weight: 700;
  color: var(--secondary);
  background: transparent;
  outline: none;
}

.qty-stepper-lg .qty-input {
  width: 44px;
  font-size: 1.1rem;
}

.cart-item-total-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--secondary);
}

.btn-remove-item {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
}

.btn-remove-item:hover {
  color: var(--danger);
}

.btn-remove-item svg {
  width: 16px;
  height: 16px;
}

.empty-cart-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-cart-icon {
  width: 60px;
  height: 60px;
  color: #cbd5e1;
  margin: 0 auto 16px;
}

.empty-cart-msg {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.cart-drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  background-color: #fafbfc;
}

.drawer-calc-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.drawer-calc-total {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--secondary);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
}

/* ==========================================================================
   Product Detail View
   ========================================================================== */
.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 48px;
  align-items: start;
}

.product-gallery-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px;
  position: sticky;
  top: 100px;
}

.gallery-badge-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.product-main-image-container {
  background-color: #f8fafc;
  border-radius: var(--radius-lg);
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.product-main-image {
  max-height: 420px;
  width: auto;
  object-fit: contain;
}

.quality-badges-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.q-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
}

.q-icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.product-info-card {
  display: flex;
  flex-direction: column;
}

.product-rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.rating-number {
  font-size: 0.9rem;
  color: var(--secondary);
}

.rating-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sku-tag {
  font-size: 0.75rem;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-left: auto;
}

.detail-product-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1.25;
  margin-bottom: 8px;
}

.detail-product-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.detail-pricing-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-current-price {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--secondary);
  margin-right: 12px;
}

.detail-old-price {
  font-size: 1.1rem;
  color: #94a3b8;
  text-decoration: line-through;
}

.tax-note {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.stock-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #166534;
  background-color: #f0fdf4;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
}

.stock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
}

.detail-purchase-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.cod-banner-badge {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 30px;
}

.cod-icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
  flex-shrink: 0;
}

.cod-banner-badge strong {
  display: block;
  font-size: 0.9rem;
  color: var(--secondary);
}

.cod-banner-badge p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.detail-section {
  margin-bottom: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.detail-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 12px;
}

.detail-benefits-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-benefits-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text-main);
}

.check-icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 3px;
}

.section-body-text {
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.65;
}

.ingredients-text {
  background: #f8fafc;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
}

/* ==========================================================================
   Checkout & Cart Page Layout
   ========================================================================== */
.checkout-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: start;
}

.form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 24px;
}

.form-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--secondary);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 76, 58, 0.1);
}

.form-help-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.payment-option-card {
  border: 2px solid var(--primary);
  background: #f0fdf4;
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.payment-radio {
  margin-top: 4px;
  accent-color: var(--primary);
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-table th {
  text-align: left;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.cart-table-row td {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-product-img {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #f1f5f9;
}

.table-product-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--secondary);
  display: block;
}

.table-product-sku {
  font-size: 0.75rem;
  color: var(--text-light);
}

.btn-remove-table {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
}

.btn-remove-table:hover {
  color: var(--danger);
}

.btn-remove-table svg {
  width: 18px;
  height: 18px;
}

.summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px;
  position: sticky;
  top: 100px;
}

.summary-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 20px;
}

/* ==========================================================================
   Thank You Page (thx.html)
   ========================================================================== */
.thx-page-hero {
  text-align: center;
  max-width: 650px;
  margin: 40px auto 36px;
}

.thx-success-icon-wrap {
  width: 80px;
  height: 80px;
  background-color: #dcfce7;
  color: #166534;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 10px 20px rgba(22, 101, 52, 0.15);
}

.thx-success-icon-wrap svg {
  width: 44px;
  height: 44px;
}

.thx-order-pill {
  display: inline-block;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--secondary);
  margin-top: 12px;
}

/* Call Time Alert Banner */
.thx-manager-banner {
  background: linear-gradient(135deg, #092e23 0%, #0f4c3a 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin: 32px 0;
  display: flex;
  gap: 20px;
  align-items: center;
  box-shadow: var(--shadow-lg);
}

.thx-manager-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #34d399;
  flex-shrink: 0;
}

.thx-manager-icon svg {
  width: 26px;
  height: 26px;
}

.thx-manager-content h4 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #ffffff;
}

.thx-manager-content p {
  font-size: 0.95rem;
  color: #e2e8f0;
  line-height: 1.5;
}

.thx-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}

.thx-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.thx-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.thx-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.thx-calc-divider {
  border-top: 1px dashed var(--border-color);
  margin: 14px 0;
}

.thx-calc-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.thx-calc-total {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--secondary);
  padding-top: 8px;
}

.thx-address-box p {
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.cod-tag-pill {
  display: inline-block;
  background: #f0fdf4;
  color: #166534;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
}

.thx-steps-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 36px;
}

.thx-steps-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 16px;
}

.thx-step-item {
  background: #f8fafc;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.thx-step-item strong {
  display: block;
  font-size: 0.95rem;
  color: var(--secondary);
  margin-bottom: 4px;
}

.thx-step-item span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Static Content / Legal Pages
   ========================================================================== */
.legal-content-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 48px;
  margin: 40px auto 60px;
  max-width: 900px;
}

.legal-content-card h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 12px;
}

.legal-content-card h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--secondary);
  margin-top: 32px;
  margin-bottom: 14px;
}

.legal-content-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--secondary);
  margin-top: 20px;
  margin-bottom: 8px;
}

.legal-content-card p {
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.7;
  margin-bottom: 16px;
}

.legal-content-card ul {
  padding-left: 24px;
  margin-bottom: 20px;
}

.legal-content-card li {
  font-size: 0.95rem;
  color: #334155;
  margin-bottom: 8px;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-notification {
  background: #0f172a;
  color: #ffffff;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
}

.toast-icon {
  width: 20px;
  height: 20px;
  color: #34d399;
  flex-shrink: 0;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

@keyframes slideIn {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.animate-slide-in {
  animation: slideIn 0.3s ease forwards;
}

.toast-fade-out {
  opacity: 0;
  transform: translateY(20px);
}

/* ==========================================================================
   Responsive Adaptations for Components
   ========================================================================== */
@media (max-width: 900px) {
  .product-detail-grid {
    grid-template-columns: 1fr;
  }
  .product-gallery-card {
    position: static;
  }
  .checkout-grid {
    grid-template-columns: 1fr;
  }
  .summary-card {
    position: static;
  }
  .thx-content-grid {
    grid-template-columns: 1fr;
  }
  .thx-steps-list {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}
