/* Store — Cart */


/* ============================================
   CART ICON - Floating Premium Button
   ============================================ */
.cart-icon {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 68px;
  height: 68px;
  background: var(--background-white, var(--bg-surface));
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg), 0 0 0 1px color-mix(in oklch, black 5%, transparent);
  cursor: pointer;
  z-index: var(--z-modal);
  transition: var(--transition-bounce);
  color: var(--primary-color, var(--primary-color));
  font-size: var(--text-2xl);
  border: none;
}

.cart-icon::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  opacity: 0;
  z-index: -1;
  transition: var(--transition);
}

.cart-icon:hover {
  transform: scale(1.1) translateY(-4px);
  box-shadow: var(--shadow-2xl);
}

.cart-icon:hover::before {
  opacity: 0.15;
  animation: pulse-ring 1.5s ease-out infinite;
}

.cart-icon.has-items {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-xl), var(--shadow-primary);
  border-color: transparent;
}

.cart-icon.has-items:hover {
  transform: scale(1.1) translateY(-4px);
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.3;
  }

  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  min-width: 26px;
  height: 26px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--bg-surface);
  box-shadow: var(--primary-shadow-sm);
  transition: var(--transition-bounce);
}

.cart-icon.has-items .cart-count {
  background: white;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

@media (min-width: 768px) {
  .cart-icon {
    top: 32px;
    bottom: auto;
    width: 64px;
    height: 64px;
  }
}

/* ============================================
   MODALS - Ultra Premium Design
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  background: var(--overlay-dark);
  backdrop-filter: var(--overlay-blur);
  -webkit-backdrop-filter: var(--overlay-blur);
  z-index: var(--z-toast);
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal.hidden {
  display: none !important;
}

.modal-content {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  box-shadow: var(--shadow-2xl), 0 0 80px color-mix(in oklch, black 10%, transparent);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

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

/* Modal Header */
.modal-header {
  background: var(--primary-gradient);
  padding: var(--space-7) var(--space-7) var(--space-6);
  position: relative;
  color: white;
}

.modal-header::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.modal-header h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  position: relative;
  z-index: var(--z-content);
}

.modal-header h2 i {
  font-size: var(--text-lg);
  opacity: 0.9;
}

/* Close Modal Button */
.close-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: var(--text-2xl);
  transition: var(--transition);
  z-index: var(--z-above);
  line-height: 1;
}

.close-modal:hover {
  background: var(--bg-surface);
  color: var(--primary-color);
  transform: rotate(90deg) scale(1.1);
}

/* ============================================
   CART ITEMS - Premium List Design
   ============================================ */
.cart-items {
  padding: 0;
  max-height: 35vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
  flex: 1;
  min-height: 0;
}

.cart-items::-webkit-scrollbar {
  width: 6px;
}

.cart-items::-webkit-scrollbar-track {
  background: transparent;
}

.cart-items::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-muted);
}

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-light);
  align-items: center;
  background: var(--bg-surface);
  transition: var(--transition);
  position: relative;
}

.cart-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: var(--transition);
}

.cart-item:hover {
  background: linear-gradient(90deg, color-mix(in oklch, var(--primary-color) 2%, transparent) 0%, transparent 100%);
}

.cart-item:hover::before {
  opacity: 1;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--bg-body) 0%, var(--bg-muted) 100%);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.cart-item:hover .cart-item-image img {
  transform: scale(1.05);
}

.cart-item-image i {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--text-3xl);
}

.cart-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.cart-item-info h4 {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text-color);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: var(--leading-snug);
}

.cart-item-price {
  color: var(--primary-color);
  font-weight: 700;
  font-size: var(--text-base);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Quantity Controls - Premium */
.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--background-color);
  padding: var(--space-2);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

.quantity-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-color);
  font-size: var(--text-base);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}

.quantity-btn:hover {
  background: var(--primary-gradient);
  color: white;
  transform: scale(1.1);
  box-shadow: var(--shadow-sm);
}

.quantity-btn:active {
  transform: scale(0.95);
}

.quantity,
.quantity-display {
  font-weight: 700;
  font-size: var(--text-base);
  min-width: 28px;
  text-align: center;
  color: var(--text-color);
}

/* Cart Item Total */
.cart-item-total {
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--text-color);
  min-width: 80px;
  text-align: right;
}

/* Remove Item Button - Premium */
.remove-item {
  color: var(--error-color);
  background: color-mix(in oklch, var(--error-color) 8%, transparent);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: var(--text-sm);
}

.remove-item:hover {
  background: var(--error-color);
  color: white;
  transform: scale(1.1) rotate(10deg);
  box-shadow: 0 4px 15px color-mix(in oklch, var(--error-color) 30%, transparent);
}

.remove-item:active {
  transform: scale(0.95);
}

/* ============================================
   CART SUMMARY - Premium Design
   ============================================ */
.cart-summary {
  padding: var(--space-7);
  background: linear-gradient(180deg, var(--background-color) 0%, var(--bg-muted) 100%);
  border-top: 1px solid var(--border-color);
  position: relative;
}

.cart-summary::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--space-7);
  right: var(--space-7);
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--primary-light) 50%, transparent 100%);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 2px dashed var(--border-color);
}

.cart-total span:first-child {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.total-amount {
  font-size: var(--text-4xl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-color);
  line-height: 1;
  letter-spacing: 0;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cart-actions {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-4);
}

.cart-actions .btn {
  padding: var(--space-4) var(--space-5);
}



/* ============================================
   EMPTY CART PREMIUM STATE
   ============================================ */
.cart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
}

.cart-empty-icon {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--background-color) 0%, var(--bg-muted) 100%);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
}

.cart-empty-icon i {
  font-size: var(--text-4xl);
  color: var(--text-muted);
}

.cart-empty-state h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: var(--space-2);
}

.cart-empty-state p {
  font-size: var(--text-sm);
  color: var(--text-light);
  margin-bottom: var(--space-6);
  max-width: 280px;
}

.cart-empty-state .btn {
  padding: var(--space-3) var(--space-7);
}


/* 5. Sticky Bottom Cart Bar */
.sticky-cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-modal);
  background: var(--primary-gradient);
  color: white;
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow-lg);
  padding-bottom: max(var(--space-4), env(safe-area-inset-bottom));
}

.sticky-cart-bar.visible {
  transform: translateY(0);
}

.sticky-cart-bar .cart-bar-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 700;
  font-size: var(--text-base);
}

.sticky-cart-bar .cart-bar-info .cart-bar-count {
  background: rgba(255, 255, 255, 0.25);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 700;
}

.sticky-cart-bar .cart-bar-total {
  font-size: var(--text-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.sticky-cart-bar .cart-bar-total i {
  font-size: var(--text-sm);
  opacity: 0.8;
}

/* When cart bar is visible, offset mobile bottom nav */
.sticky-cart-bar.visible~.mobile-bottom-nav {
  transform: translateY(60px);
}

/* Desktop: center cart bar */
@media (min-width: 769px) {
  .sticky-cart-bar {
    max-width: 500px;
    left: 50%;
    transform: translate(-50%, 100%);
    bottom: 20px;
    border-radius: var(--radius-lg);
  }

  .sticky-cart-bar.visible {
    transform: translate(-50%, 0);
  }
}

/* Mobile product detail sheet adjustments */
@media (max-width: 768px) {
  .sheet-image {
    height: 220px;
  }

  .sheet-body {
    padding: var(--space-4) var(--space-5) var(--space-7);
    padding-bottom: max(var(--space-7), env(safe-area-inset-bottom));
  }

  .sheet-body .sheet-name {
    font-size: var(--text-lg);
  }

  .category-section-header h2 {
    font-size: var(--text-lg);
  }
}
