/* ============================================
   Kalyani Medical Agency - Pharmaceutical Distributors
   White + Blue + Green medical palette
   ============================================ */

:root {
  --primary: #0d6efd;
  --primary-dark: #0a58ca;
  --primary-light: #e7f1ff;
  --secondary: #198754;
  --secondary-dark: #146c43;
  --secondary-light: #d1e7dd;
  --accent: #20c997;
  --white: #ffffff;
  --off-white: #f8fafb;
  --gray-50: #f1f5f9;
  --gray-100: #e2e8f0;
  --gray-200: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --danger: #dc3545;
  --warning: #ffc107;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --navbar-height: 72px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--gray-800);
  background: var(--off-white);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition);
}

ul {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ========== Loading Overlay ========== */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s, visibility 0.5s;
}

.loader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== Navbar ========== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  height: var(--navbar-height);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-img {
  height: 48px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
}

.footer .logo-img {
  height: 56px;
  max-width: 220px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a {
  font-weight: 500;
  color: var(--gray-600);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.nav-btn-outline {
  background: transparent;
  color: var(--secondary);
  border: 2px solid var(--secondary);
}

.nav-btn-outline:hover {
  background: var(--secondary);
  color: var(--white);
}

.nav-btn-primary {
  background: var(--primary);
  color: var(--white);
}

.nav-btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.cart-link {
  position: relative;
  padding: 0.5rem;
  color: var(--gray-800);
  font-size: 1.25rem;
}

.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--secondary);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--gray-800);
  border-radius: 2px;
  transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(13, 110, 253, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 110, 253, 0.45);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--white);
}

.btn-secondary:hover {
  background: var(--secondary-dark);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ========== Hero ========== */
.hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 50%, var(--off-white) 100%);
  padding: 4rem 0 5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 150%;
  background: radial-gradient(circle, rgba(13, 110, 253, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-content h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.2;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.hero-content h1 span {
  color: var(--primary);
}

.hero-content p {
  color: var(--gray-600);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.hero-cta-row {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  background: var(--white);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--secondary);
  box-shadow: var(--shadow-sm);
}

.search-hero {
  display: flex;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
}

.search-hero input {
  flex: 1;
  border: none;
  padding: 1rem 1.25rem;
  outline: none;
}

.search-hero button {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0 1.5rem;
  cursor: pointer;
  font-weight: 600;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}

.autocomplete-dropdown.show {
  display: block;
}

.autocomplete-item {
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}

.autocomplete-item:hover {
  background: var(--primary-light);
}

.hero-visual {
  position: relative;
}

.hero-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.hero-card-media {
  line-height: 0;
}

.hero-padding-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.hero-card-info {
  padding: 1rem 1.25rem 1.25rem;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 100%);
  border-top: 1px solid var(--gray-100);
}

.hero-card-info h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.hero-card-info p {
  color: var(--gray-600);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.hero-card-info a {
  color: var(--secondary-dark);
  font-weight: 600;
}

.hero-card-info a:hover {
  color: var(--primary);
}

/* ========== Section Common ========== */
.section {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--gray-600);
  max-width: 560px;
  margin: 0 auto;
}

.section-tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  margin-bottom: 0.75rem;
}

/* ========== Stats Counters ========== */
.stats-bar {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 2.5rem 0;
  color: var(--white);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-item h3 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
}

.stat-item p {
  opacity: 0.9;
  font-size: 0.9rem;
}

/* ========== Categories ========== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.25rem;
}

.category-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.category-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.category-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.category-card h3 {
  font-size: 0.95rem;
  color: var(--gray-800);
}

/* ========== Product Cards ========== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-image {
  height: 180px;
  background: linear-gradient(145deg, var(--primary-light), var(--secondary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
}

.discount-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--danger);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

.product-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-body h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
  color: var(--gray-900);
}

.product-category {
  font-size: 0.75rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

.product-prices {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.price-current {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.price-old {
  font-size: 0.9rem;
  color: var(--gray-400);
  text-decoration: line-through;
}

.product-card .btn {
  margin-top: auto;
  width: 100%;
}

/* ========== Brands ========== */
.brands-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  align-items: center;
}

.brand-item {
  background: var(--white);
  padding: 1rem 2rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  color: var(--gray-600);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.brand-item:hover {
  color: var(--primary);
  transform: scale(1.05);
}

/* ========== Offers ========== */
.offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.offer-card {
  background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
  color: var(--white);
  border-radius: var(--radius-md);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.offer-card:nth-child(2) {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
}

.offer-card:nth-child(3) {
  background: linear-gradient(135deg, #6366f1 0%, var(--primary) 100%);
}

.offer-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.offer-card p {
  opacity: 0.9;
  margin-bottom: 1rem;
}

/* ========== Testimonials ========== */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.testimonial-card {
  background: var(--white);
  padding: 1.75rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.testimonial-stars {
  color: var(--warning);
  margin-bottom: 0.75rem;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.author-avatar {
  width: 44px;
  height: 44px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
}

/* ========== FAQ ========== */
.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  background: var(--white);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  text-align: left;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--gray-800);
}

.faq-question::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--primary);
  transition: transform var(--transition);
}

.faq-item.active .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition);
}

.faq-answer-inner {
  padding: 0 1.5rem 1.25rem;
  color: var(--gray-600);
}

.faq-item.active .faq-answer {
  max-height: 200px;
}

/* ========== Footer ========== */
.footer {
  background: var(--gray-900);
  color: var(--gray-200);
  padding: 3.5rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer h4 {
  color: var(--white);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid var(--gray-600);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.7;
}

.footer-bottom p {
  margin: 0;
}

/* ========== Products Page Layout ========== */
.page-header {
  background: linear-gradient(135deg, var(--primary-light), var(--white));
  padding: 2.5rem 0;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  color: var(--gray-900);
}

.products-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  padding-bottom: 4rem;
}

.filter-sidebar {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  height: fit-content;
  position: sticky;
  top: calc(var(--navbar-height) + 1rem);
}

.filter-sidebar h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.filter-group {
  margin-bottom: 1.25rem;
}

.filter-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--gray-600);
}

.filter-group select,
.filter-group input[type="range"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
}

.checkbox-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  margin-bottom: 0.35rem;
  cursor: pointer;
}

.products-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.search-inline {
  display: flex;
  flex: 1;
  max-width: 400px;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.search-inline input {
  flex: 1;
  border: none;
  padding: 0.65rem 1rem;
  outline: none;
}

.search-inline button {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0 1rem;
  cursor: pointer;
}

/* ========== Product Details ========== */
.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  padding: 2rem 0 4rem;
}

.detail-image {
  background: linear-gradient(145deg, var(--primary-light), var(--secondary-light));
  border-radius: var(--radius-lg);
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8rem;
  box-shadow: var(--shadow-md);
}

.detail-info h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.detail-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.detail-tabs {
  margin-top: 2rem;
}

.tab-buttons {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--gray-100);
  margin-bottom: 1rem;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
  color: var(--gray-600);
  line-height: 1.8;
}

.tab-panel.active {
  display: block;
}

.tab-panel ul {
  list-style: disc;
  padding-left: 1.5rem;
}

/* ========== Cart ========== */
.cart-layout {
  padding: 2rem 0 4rem;
}

.cart-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.cart-empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.cart-table-wrap {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 2rem;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-table th,
.cart-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
}

.cart-table th {
  background: var(--gray-50);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.cart-product {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cart-product-icon {
  width: 56px;
  height: 56px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.qty-controls {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-controls button {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--gray-50);
  cursor: pointer;
  font-size: 1.1rem;
}

.qty-controls button:hover {
  background: var(--primary-light);
}

.qty-controls span {
  width: 40px;
  text-align: center;
  font-weight: 600;
}

.btn-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
}

.btn-remove:hover {
  text-decoration: underline;
}

.cart-summary {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  max-width: 400px;
  margin-left: auto;
}

.cart-summary h3 {
  margin-bottom: 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  color: var(--gray-600);
}

.summary-row.total {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  border-top: 2px solid var(--gray-100);
  padding-top: 1rem;
  margin-top: 0.5rem;
}

/* ========== Checkout ========== */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem 0 4rem;
}

.checkout-form,
.prescription-section {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.checkout-form h2,
.prescription-section h2 {
  margin-bottom: 1.25rem;
  font-size: 1.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
  color: var(--gray-600);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Prescription Upload */
.prescription-warning {
  background: #fff3cd;
  border: 1px solid var(--warning);
  color: #856404;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  display: none;
}

.prescription-warning.show {
  display: block;
}

.upload-zone {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--gray-50);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-zone-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.upload-zone p {
  color: var(--gray-600);
  font-size: 0.9rem;
}

.upload-zone input {
  display: none;
}

.prescription-preview {
  margin-top: 1rem;
  display: none;
}

.prescription-preview.show {
  display: block;
}

.prescription-preview img {
  max-height: 200px;
  border-radius: var(--radius-sm);
  margin: 0 auto;
  object-fit: contain;
}

.preview-pdf {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
}

.btn-clear-upload {
  margin-top: 0.75rem;
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
}

/* ========== Auth ========== */
.auth-page {
  min-height: calc(100vh - var(--navbar-height) - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}

.auth-tabs {
  display: flex;
}

.auth-tab {
  flex: 1;
  padding: 1rem;
  border: none;
  background: var(--gray-50);
  font-weight: 600;
  cursor: pointer;
  color: var(--gray-600);
  transition: var(--transition);
}

.auth-tab.active {
  background: var(--white);
  color: var(--primary);
}

.auth-form-wrap {
  padding: 2rem;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 3rem;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
}

/* ========== Contact ========== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem 0 4rem;
}

.contact-info-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.contact-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-item-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.map-placeholder {
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
  border-radius: var(--radius-md);
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  font-weight: 600;
  margin-top: 2rem;
}

/* ========== Toast ========== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--gray-900);
  color: var(--white);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.4s ease;
  min-width: 280px;
}

.toast.success {
  background: var(--secondary);
}

.toast.error {
  background: var(--danger);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ========== Responsive ========== */

/* Tablet */
@media (max-width: 992px) {
  .hero-grid,
  .product-detail-grid,
  .checkout-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .products-layout {
    grid-template-columns: 1fr;
  }

  .filter-sidebar {
    position: static;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .detail-image {
    height: 320px;
    font-size: 6rem;
  }

  .hero-visual {
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --navbar-height: 60px;
  }

  .container {
    padding: 0 1rem;
  }

  .section {
    padding: 2.5rem 0;
  }

  .page-header {
    padding: 1.75rem 0;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  /* Navbar */
  .menu-toggle {
    display: flex;
  }

  .logo-img {
    height: 38px;
    max-width: 150px;
  }

  .navbar .container {
    gap: 0.5rem;
  }

  .nav-actions .nav-btn-outline {
    display: none;
  }

  .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    max-height: calc(100dvh - var(--navbar-height));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--white);
    padding: 0.5rem 1rem 1.5rem;
    gap: 0;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0.3s;
  }

  .nav-links.open {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-links a {
    padding: 0.9rem 0.25rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 1rem;
  }

  .nav-links a.active::after {
    display: none;
  }

  .nav-links a.active {
    color: var(--primary);
    font-weight: 700;
  }

  .nav-link-mobile-rx {
    display: block !important;
    color: var(--secondary) !important;
    font-weight: 600;
  }

  .nav-overlay {
    display: block;
    position: fixed;
    inset: var(--navbar-height) 0 0 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
  }

  .nav-overlay.show {
    opacity: 1;
    visibility: visible;
  }

  body.menu-open {
    overflow: hidden;
  }

  /* Hero */
  .hero {
    padding: 1.75rem 0 2.5rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .hero-content {
    text-align: center;
  }

  .hero-content h1 {
    font-size: 1.65rem;
  }

  .hero-content p {
    font-size: 0.95rem;
  }

  .hero-badges {
    justify-content: center;
  }

  .badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.65rem;
  }

  .search-hero {
    flex-direction: column;
    border-radius: var(--radius-sm);
  }

  .search-hero input {
    padding: 0.85rem 1rem;
    width: 100%;
    min-width: 0;
  }

  .search-hero button {
    width: 100%;
    padding: 0.85rem;
  }

  .hero-cta-row {
    justify-content: center;
  }

  .hero-content .btn {
    width: 100%;
    max-width: 280px;
  }

  .hero-card {
    animation: none;
  }

  .hero-visual {
    max-width: 100%;
  }

  /* Stats */
  .stats-bar {
    padding: 1.75rem 0;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .stat-item h3 {
    font-size: 1.5rem;
  }

  .stat-item p {
    font-size: 0.8rem;
  }

  /* Products */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  .product-image {
    height: 130px;
    font-size: 2.75rem;
  }

  .product-body {
    padding: 0.85rem;
  }

  .product-body h3 {
    font-size: 0.85rem;
  }

  .price-current {
    font-size: 1rem;
  }

  .products-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-inline {
    max-width: none;
    width: 100%;
  }

  .products-layout {
    gap: 1.25rem;
  }

  .filter-sidebar {
    padding: 1.25rem;
  }

  /* Product detail */
  .detail-image {
    height: 240px;
    font-size: 5rem;
  }

  .detail-info h1 {
    font-size: 1.35rem;
  }

  .tab-buttons {
    flex-wrap: wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  /* Cart */
  .cart-summary {
    max-width: 100%;
    margin-left: 0;
  }

  .cart-table thead {
    display: none;
  }

  .cart-table tr {
    display: block;
    padding: 1rem;
    border-bottom: 2px solid var(--gray-100);
  }

  .cart-table td {
    display: block;
    padding: 0.35rem 0;
    border: none;
    text-align: left;
  }

  .cart-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--gray-400);
    display: block;
    margin-bottom: 0.25rem;
  }

  .cart-product {
    flex-wrap: wrap;
  }

  /* Checkout & forms */
  .checkout-grid,
  .contact-grid {
    gap: 1.25rem;
  }

  .checkout-form,
  .prescription-section,
  .contact-info-card {
    padding: 1.25rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .upload-zone {
    padding: 1.75rem 1rem;
  }

  /* Offers & categories */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .category-card {
    padding: 1rem 0.5rem;
  }

  .category-icon {
    font-size: 2rem;
  }

  .offers-grid,
  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .brands-row {
    gap: 0.75rem;
  }

  .brand-item {
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
  }

  /* Footer */
  .footer {
    padding: 2.5rem 0 1.25rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }

  .footer .logo {
    justify-content: center;
  }

  .footer-bottom {
    font-size: 0.75rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .footer-bottom p {
    word-break: break-word;
    hyphens: auto;
  }

  /* Auth */
  .auth-page {
    padding: 1.5rem 1rem;
    align-items: flex-start;
  }

  .auth-form-wrap {
    padding: 1.25rem;
  }

  /* Toast */
  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  .toast {
    min-width: 0;
    width: 100%;
  }

  .map-placeholder {
    height: 200px;
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-content h1 {
    font-size: 1.45rem;
  }

  .section-header h2 {
    font-size: 1.35rem;
  }

  .offer-card {
    padding: 1.5rem;
  }

  .offer-card h3 {
    font-size: 1.25rem;
  }

  .btn {
    padding: 0.7rem 1.15rem;
    font-size: 0.9rem;
  }

  .qty-controls button {
    width: 40px;
    height: 40px;
  }
}

/* Desktop-only helpers */
.nav-link-mobile-rx {
  display: none;
}

.nav-overlay {
  display: none;
}
