/* ============================================
   AKM Music — Store Page Styles
   Built on master-design.css tokens (Design System v2.0)
   ============================================ */

/* --- Shop hero --- */
.shop-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-white);
  padding: calc(80px + var(--space-2xl)) var(--space-lg) var(--space-2xl);
  text-align: center;
}
.shop-hero h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-extrabold, 800);
  letter-spacing: 2px;
  margin: 0 0 var(--space-xs);
  color: var(--color-white);
}
.shop-hero p {
  color: var(--color-white);
  opacity: 0.92;
  font-size: var(--font-size-lg);
  margin: 0 0 var(--space-lg);
}
.shop-search-wrap {
  max-width: 620px;
  margin: 0 auto;
  position: relative;
}
.shop-search-wrap i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gray-400);
}
#shopSearch {
  width: 100%;
  padding: 14px 20px 14px 46px;
  border: none;
  border-radius: 999px;
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  box-shadow: var(--shadow-lg);
  outline: none;
  color: var(--text-primary);
}

/* --- Department chips --- */
.shop-departments {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--space-lg);
}
.dept-chip {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--color-white);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold, 600);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-family);
}
.dept-chip:hover { background: rgba(255, 255, 255, 0.28); }
.dept-chip.active {
  background: var(--color-white);
  color: var(--color-primary);
  border-color: var(--color-white);
}

/* --- Toolbar --- */
.shop-toolbar {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  align-items: center;
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-xl);
}
.shop-toolbar select {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  background: var(--bg-card);
  cursor: pointer;
}
.shop-toolbar label.stock-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.shop-count {
  margin-left: auto;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* --- Product grid --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-lg);
}
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.product-image {
  position: relative;
  aspect-ratio: 1;
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--space-md);
  transition: transform 0.3s ease;
}
.product-card:hover .product-image img { transform: scale(1.05); }
.stock-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold, 700);
  padding: 4px 10px;
  border-radius: 999px;
}
.stock-badge.in { background: #d1fae5; color: #065f46; }
.stock-badge.out { background: var(--color-gray-100); color: var(--text-muted); }
.product-info {
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}
.product-brand {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold, 700);
  letter-spacing: 1px;
  color: var(--color-primary);
  text-transform: uppercase;
}
.product-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold, 600);
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}
.product-price {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-extrabold, 800);
  color: var(--text-primary);
  margin-top: auto;
}
.product-price .currency {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold, 600);
  color: var(--text-muted);
  margin-right: 4px;
}
.product-actions {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
}
.btn-add-cart {
  flex: 1;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  padding: 10px;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-family);
  font-weight: var(--font-weight-semibold, 600);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn-add-cart:hover { background: var(--color-primary-dark); }
.btn-wa-order {
  background: #25d366;
  color: var(--color-white);
  border: none;
  width: 42px;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-lg);
  cursor: pointer;
  transition: filter 0.2s ease;
}
.btn-wa-order:hover { filter: brightness(0.92); }

.shop-loadmore {
  display: block;
  margin: var(--space-2xl) auto;
}
.shop-empty {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--text-muted);
}

/* --- Product modal --- */
.product-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}
.product-modal-overlay.open { display: flex; }
.product-modal {
  background: var(--bg-card);
  border-radius: var(--border-radius-xl);
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
}
.product-modal .modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--color-gray-100);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  z-index: 2;
}
.modal-image {
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  border-radius: var(--border-radius-xl) 0 0 var(--border-radius-xl);
}
.modal-image img { max-width: 100%; max-height: 380px; object-fit: contain; }
.modal-details {
  padding: var(--space-2xl) var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.modal-details .product-price { font-size: var(--font-size-3xl); }
.modal-details h2 {
  font-size: var(--font-size-xl);
  margin: 0;
  line-height: 1.35;
}
.modal-meta {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
.qty-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}
.qty-control button {
  background: var(--color-gray-50);
  border: none;
  width: 38px;
  height: 38px;
  font-size: var(--font-size-lg);
  cursor: pointer;
  color: var(--text-primary);
}
.qty-control span {
  width: 44px;
  text-align: center;
  font-weight: var(--font-weight-bold, 700);
}
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}
.modal-actions .btn { width: 100%; justify-content: center; }
.btn-whatsapp {
  background: #25d366;
  color: var(--color-white);
  border: none;
  padding: 13px 20px;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-family);
  font-weight: var(--font-weight-bold, 700);
  font-size: var(--font-size-base);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: filter 0.2s ease;
}
.btn-whatsapp:hover { filter: brightness(0.92); }

/* --- Cart drawer --- */
.cart-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1050;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: var(--font-size-xl);
  cursor: pointer;
  box-shadow: var(--shadow-xl);
  transition: transform 0.2s ease, background 0.2s ease;
}
.cart-fab:hover { transform: scale(1.08); background: var(--color-primary-dark); }
.cart-fab .cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-accent);
  color: var(--color-white);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold, 700);
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 1150;
  display: none;
}
.cart-drawer-overlay.open { display: block; }
.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: min(420px, 100vw);
  height: 100vh;
  background: var(--bg-card);
  z-index: 1200;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
}
.cart-drawer.open { right: 0; }
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}
.cart-header h3 { margin: 0; font-size: var(--font-size-xl); }
.cart-header button {
  background: none;
  border: none;
  font-size: var(--font-size-xl);
  cursor: pointer;
  color: var(--text-muted);
}
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) var(--space-lg);
}
.cart-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-gray-100);
}
.cart-item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  background: var(--color-white);
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold, 600);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cart-item-price {
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  font-weight: var(--font-weight-bold, 700);
  margin-top: 2px;
}
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: 6px;
}
.cart-item-controls .qty-control button { width: 28px; height: 28px; font-size: var(--font-size-sm); }
.cart-item-controls .qty-control span { width: 32px; font-size: var(--font-size-sm); }
.cart-item-remove {
  background: none;
  border: none;
  color: var(--color-accent);
  cursor: pointer;
  font-size: var(--font-size-sm);
}
.cart-empty-msg {
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-2xl) 0;
}
.cart-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border-color);
  background: var(--bg-section-light);
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-extrabold, 800);
  margin-bottom: var(--space-md);
}
.cart-note {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--space-sm);
}

/* --- Featured products (home page) --- */
/* fixes.css forces `a` color with !important — anchor buttons need the same force */
a.btn.btn-primary, a.btn.btn-primary:hover { color: var(--color-white) !important; }
.featured-section { padding: var(--space-3xl) 0; }
/* Compact cards on the home page */
.featured-section .product-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-md);
}
.featured-section .product-info { padding: var(--space-sm) var(--space-md) var(--space-md); gap: 4px; }
.featured-section .product-name { font-size: var(--font-size-xs); min-height: 2.6em; }
.featured-section .product-brand { font-size: 10px; }
.featured-section .product-price { font-size: var(--font-size-base); }
.featured-section .product-image img { padding: var(--space-xs); }
.featured-cta { text-align: center; margin-top: var(--space-xl); }

/* --- Brand strip (home page) --- */
.brand-strip {
  background: var(--bg-section-light);
  padding: var(--space-2xl) 0;
  text-align: center;
}
.brand-strip-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md) var(--space-xl);
  margin-top: var(--space-lg);
}
.brand-strip-logos span {
  font-weight: var(--font-weight-extrabold, 800);
  font-size: var(--font-size-lg);
  letter-spacing: 1.5px;
  color: var(--color-gray-400);
  transition: color 0.2s ease;
}
.brand-strip-logos span:hover { color: var(--color-primary); }

/* --- Responsive --- */
@media (max-width: 768px) {
  .product-modal { grid-template-columns: 1fr; }
  .modal-image { border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-md); }
  .shop-toolbar { gap: var(--space-sm); }
  .shop-toolbar select { flex: 1; min-width: 130px; }
  .shop-count { width: 100%; margin-left: 0; }
  .shop-hero h1 { font-size: var(--font-size-3xl); }
}

/* --- "Ask AKM" AI assistant --- */
.ai-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 1050;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: white;
  border: none;
  padding: 13px 20px;
  border-radius: 999px;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: var(--font-size-sm);
  cursor: pointer;
  box-shadow: var(--shadow-xl);
  transition: transform 0.2s ease;
}
.ai-fab:hover { transform: scale(1.05); }
.ai-panel {
  position: fixed;
  bottom: 86px;
  left: 24px;
  width: min(380px, calc(100vw - 32px));
  max-height: min(560px, 75vh);
  background: var(--bg-card);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1250;
}
.ai-panel.open { display: flex; }
.ai-head {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: white;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-head span { font-size: var(--font-size-xs); opacity: 0.85; flex: 1; }
.ai-close { background: none; border: none; color: white; cursor: pointer; font-size: var(--font-size-base); }
.ai-msgs {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
}
.ai-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: var(--font-size-sm);
  line-height: 1.55;
}
.ai-msg.bot { background: var(--bg-section-light); align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-msg.user { background: var(--color-primary); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-msg.cards { background: none; padding: 0; max-width: 100%; display: flex; gap: 8px; overflow-x: auto; }
.ai-card {
  flex: 0 0 110px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--font-size-xs);
}
.ai-card img { width: 100%; height: 70px; object-fit: contain; }
.ai-card-name {
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 600;
}
.ai-card-price { color: var(--color-primary); font-weight: 800; }
.ai-inputrow {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border-color);
}
.ai-inputrow input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-family: var(--font-family);
  font-size: 16px;
  outline: none;
}
.ai-inputrow button {
  background: var(--color-primary);
  color: white;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
}
@media (max-width: 768px) {
  .ai-fab { bottom: calc(80px + env(safe-area-inset-bottom)); left: 16px; padding: 12px 16px; }
  .ai-panel { bottom: calc(140px + env(safe-area-inset-bottom)); left: 16px; }
}

/* --- Shop-by-category tiles (home) --- */
.dept-section { padding: var(--space-3xl) 0 0; }
.dept-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--space-md);
}
.dept-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  font-weight: var(--font-weight-bold, 700);
  font-size: var(--font-size-sm);
  color: var(--text-primary) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.dept-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}
.dept-emoji { font-size: 2rem; }
