/* =========================================
   GLOBAL MOBILE-FIRST DESIGN SYSTEM
   Renewed Technology — Premium UI
   ========================================= */

:root {
  /* ========== BRAND COLORS (UNIQUE) ========== */
  --primary: #0f766e;
  --primary-dark: #0c5f59;
  --primary-light: #14b8a6;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --price: #0f172a;
  --offer-badge: #dc2626;
  --rating: #f59e0b;

  /* ========== SEMANTIC COLORS ========== */
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --error: #EF4444;
  --error-light: #FEE2E2;
  --info: #3B82F6;
  --info-light: #DBEAFE;

  /* ========== NEUTRAL COLORS ========== */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* ========== BACKGROUNDS ========== */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8FAFC;
  --bg-tertiary: #F1F5F9;

  /* ========== TYPOGRAPHY SCALE (MOBILE-FIRST) ========== */
  --font-primary: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;

  --text-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.75rem);
  --text-sm: clamp(0.8rem, 0.75rem + 0.25vw, 0.875rem);
  --text-base: clamp(0.9rem, 0.85rem + 0.25vw, 1rem);
  --text-lg: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
  --text-xl: clamp(1.25rem, 1rem + 1vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
  --text-3xl: clamp(2rem, 1.5rem + 2.5vw, 3rem);

  /* ========== SPACING SCALE ========== */
  --space-1: clamp(4px, 0.5vw, 6px);
  --space-2: clamp(8px, 1vw, 12px);
  --space-3: clamp(12px, 1.5vw, 16px);
  --space-4: clamp(16px, 2vw, 24px);
  --space-5: clamp(24px, 3vw, 32px);
  --space-6: clamp(32px, 4vw, 48px);

  /* ========== ICON SIZES ========== */
  --icon-xs: 16px;
  --icon-sm: 20px;
  --icon-md: 24px;
  --icon-lg: 32px;
  --icon-xl: 40px;

  /* ========== TOUCH TARGETS ========== */
  --touch-min: 44px;

  /* ========== SHADOWS ========== */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.18);

  /* ========== BORDER RADIUS ========== */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* ========== TRANSITIONS ========== */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* ========== Z-INDEX ========== */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal: 1040;
  --z-popover: 1050;
  --z-tooltip: 1060;

  /* ========== BREAKPOINTS (REFERENCE) ========== */
  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;
}

/* =========================================
   GLOBAL RESET & BASE
   ========================================= */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

/* =========================================
   UTILITY CLASSES
   ========================================= */

.container {
  width: 92%;
  max-width: 1200px;
  margin: 0 auto;
}

.container-fluid {
  width: 100%;
  padding: 0 var(--space-3);
}

/* Mobile bottom nav spacer */
.has-mobile-bottom-nav {
  padding-bottom: 70px;
}

/* Safe area for fixed headers */
.safe-top {
  padding-top: env(safe-area-inset-top);
}

.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

/* Touch target enforcement */
.touch-target {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
}

/* Text truncation */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =========================================
   RESPONSIVE GRID SYSTEM
   ========================================= */

.grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.grid--tight {
  gap: var(--space-2);
}

.grid--cards {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

/* =========================================
   PREMIUM BUTTONS
   ========================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 24px;
  font-size: var(--text-base);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  min-height: var(--touch-min);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.btn-accent {
  background: var(--accent);
  color: var(--gray-900);
  box-shadow: var(--shadow-sm);
}

.btn-accent:hover {
  background: var(--accent-dark);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-danger {
  background: var(--error);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: var(--text-sm);
  min-height: 36px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: var(--text-lg);
  min-height: 52px;
}

.btn-block {
  width: 100%;
}

/* =========================================
   PREMIUM CARDS
   ========================================= */

.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--gray-100);
}

.card-body {
  padding: var(--space-4);
}

.card-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}

/* =========================================
   PREMIUM INPUTS
   ========================================= */

.input-group {
  margin-bottom: var(--space-3);
}

.input-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  font-size: var(--text-base);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all var(--transition-base);
  font-family: var(--font-primary);
  min-height: 48px;
}

.input-field::placeholder {
  color: var(--text-tertiary);
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.input-field:disabled {
  background: var(--gray-100);
  cursor: not-allowed;
}

/* =========================================
   BADGES
   ========================================= */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary {
  background: var(--info-light);
  color: var(--info);
}

.badge-success {
  background: var(--success-light);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-danger {
  background: var(--error-light);
  color: var(--error);
}

.badge-accent {
  background: var(--accent);
  color: var(--gray-900);
}

/* =========================================
   LOADING & SKELETON
   ========================================= */

.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner-sm {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

.spinner-lg {
  width: 56px;
  height: 56px;
  border-width: 4px;
}

/* =========================================
   EMPTY STATES
   ========================================= */

.empty-state {
  text-align: center;
  padding: var(--space-6) var(--space-4);
}

.empty-state-icon {
  font-size: 48px;
  color: var(--gray-300);
  margin-bottom: var(--space-4);
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state-description {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* =========================================
   TOAST NOTIFICATIONS
   ========================================= */

.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border-left: 4px solid var(--primary);
  min-width: 280px;
  max-width: 380px;
  animation: slide-in 0.3s ease;
}

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--error); }
.toast-warning { border-left-color: var(--warning); }

.toast-icon { font-size: 20px; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--error); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-message {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 18px;
  padding: var(--space-1);
}

.toast-close:hover {
  color: var(--text-primary);
}

/* =========================================
   MODAL
   ========================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: all var(--transition-base);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: var(--space-1);
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-4);
}

.modal-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* =========================================
   RATING STARS
   ========================================= */

.rating {
  display: inline-flex;
  gap: 2px;
}

.rating-star {
  font-size: var(--icon-md);
  color: var(--gray-300);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.rating-star.filled {
  color: var(--rating);
}

.rating-star:hover {
  color: #fbbf24;
}

/* =========================================
   PROGRESS BAR
   ========================================= */

.progress-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.error { background: var(--error); }

/* =========================================
   TABS
   ========================================= */

.tabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 var(--space-3);
  overflow-x: auto;
}

.tab {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* =========================================
   TOOLTIP
   ========================================= */

.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-3);
  background: var(--gray-900);
  color: white;
  font-size: var(--text-xs);
  white-space: nowrap;
  border-radius: var(--radius-sm);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: var(--z-tooltip);
  pointer-events: none;
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  bottom: calc(100% + 8px);
}

/* =========================================
   FLOATING ACTION BUTTONS
   ========================================= */

.floating-buttons {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  z-index: var(--z-fixed);
}

.float-btn {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--icon-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  text-decoration: none;
}

.float-btn:hover {
  transform: scale(1.1);
}

.float-btn.whatsapp {
  background: #25D366;
}

.float-btn.call {
  background: #007bff;
}

.float-btn .tooltip {
  position: absolute;
  right: 60px;
  background: var(--gray-900);
  color: white;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.float-btn:hover .tooltip {
  opacity: 1;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
  70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.whatsapp-pulse {
  animation: pulse 2s infinite;
}

/* =========================================
   BOTTOM NAVIGATION (MOBILE)
   ========================================= */

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
  z-index: var(--z-fixed);
  padding: 6px 0;
  justify-content: space-around;
  align-items: center;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-tertiary);
  font-size: 10px;
  padding: 4px 6px;
  transition: all var(--transition-fast);
  flex: 1;
  text-decoration: none;
  min-height: 48px;
  justify-content: center;
}

.mobile-nav-item span:first-child {
  font-size: var(--icon-lg);
  margin-bottom: 2px;
}

.mobile-nav-item.active {
  color: var(--primary);
}

.mobile-nav-item:active {
  transform: scale(0.95);
}

/* =========================================
   PREMIUM FOOTER
   ========================================= */

.premium-footer {
  background: var(--gray-900);
  color: white;
  padding: var(--space-6) var(--space-4) var(--space-4);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.footer-section h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.footer-section h4 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--gray-300);
}

.footer-section p {
  color: var(--gray-400);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section li {
  margin-bottom: var(--space-2);
}

.footer-section a {
  color: var(--gray-400);
  text-decoration: none;
  transition: color var(--transition-base);
}

.footer-section a:hover {
  color: white;
}

.social-links {
  display: flex;
  gap: var(--space-3);
}

.social-links a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray-800);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all var(--transition-base);
}

.social-links a:hover {
  background: var(--primary);
  transform: translateY(-2px);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--gray-800);
  text-align: center;
  color: var(--gray-500);
  font-size: var(--text-sm);
}

/* =========================================
   RESPONSIVE: TABLET & UP
   ========================================= */

@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none !important;
  }

  .has-mobile-bottom-nav {
    padding-bottom: 0 !important;
  }
}

@media (max-width: 767px) {
  .mobile-bottom-nav {
    display: flex;
  }

  .has-mobile-bottom-nav {
    padding-bottom: 70px;
  }
}

/* =========================================
   REDUCED MOTION
   ========================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================
   FOCUS VISIBLE (ACCESSIBILITY)
   ========================================= */

*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:focus-visible,
.input-field:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* =========================================
   NOTIFICATION TOGGLE - USER MENU
   ========================================= */

#notificationToggleSection {
  padding: 10px 16px;
}

.notification-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #0f766e;
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.notification-status-text {
  font-size: 12px;
  color: #6b7280;
  padding: 4px 0;
}
