/* ============================================
   STORE / E-COMMERCE STYLES
   ============================================ */

/* --- Store Page Product Grid --- */
.store-page-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.store-product-card {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
  position: relative;
}

.store-product-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-6px);
}

.store-product-badge {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  z-index: 2;
}

.store-product-img {
  height: 340px;
  background: linear-gradient(145deg, #f4f8f6, #e8edeb);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  position: relative;
  overflow: hidden;
}

.store-product-img img {
  max-height: 85%;
  object-fit: contain;
  transition: transform 0.5s ease;
}

.store-product-card:hover .store-product-img img {
  transform: scale(1.08) rotate(-2deg);
}

/* Quick action overlay on hover */
.store-product-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 82, 87, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.store-product-card:hover .store-product-overlay {
  opacity: 1;
}

.store-product-body {
  padding: var(--space-lg);
}

.store-product-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-gold);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.store-product-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: var(--space-sm);
  color: var(--color-dark);
}

.store-product-desc {
  font-size: 0.88rem;
  color: var(--color-muted);
  margin-bottom: var(--space-md);
  line-height: 1.5;
}

/* Size Selector */
.size-selector {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.size-option {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.size-option:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.size-option.selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.size-option.out-of-stock {
  opacity: 0.3;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Customization Input */
.customization-section {
  background: var(--color-off-white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.customization-section h5 {
  font-size: 0.85rem;
  margin-bottom: var(--space-sm);
  color: var(--color-primary);
}

.custom-inputs {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: var(--space-sm);
}

.custom-inputs input {
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  transition: border-color var(--transition-fast);
}

.custom-inputs input:focus {
  border-color: var(--color-primary);
}

/* Price Row */
.store-product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.store-price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--color-primary);
}

.store-price .original {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-muted);
  text-decoration: line-through;
  margin-right: var(--space-sm);
}

/* --- Shopping Cart Sidebar --- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  display: none;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.cart-overlay.active {
  display: block;
  opacity: 1;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: -420px;
  width: 420px;
  max-width: 100%;
  height: 100vh;
  background: var(--color-white);
  z-index: 9999;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
  transition: right var(--transition-slow);
  display: flex;
  flex-direction: column;
}

.cart-sidebar.open {
  right: 0;
}

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

.cart-header h3 {
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.cart-count {
  width: 24px;
  height: 24px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.cart-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: 1.2rem;
  color: var(--color-muted);
}

.cart-close:hover {
  background: var(--color-off-white);
  color: var(--color-dark);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg) var(--space-xl);
}

.cart-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
}

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

.cart-item-img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  background: var(--color-off-white);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cart-item-img img {
  max-height: 90%;
  object-fit: contain;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 2px;
}

.cart-item-details {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-bottom: var(--space-sm);
}

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

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.qty-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.cart-item-qty span {
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 20px;
  text-align: center;
}

.cart-item-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-primary);
  white-space: nowrap;
}

.cart-item-remove {
  font-size: 0.8rem;
  color: var(--color-error);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.cart-item-remove:hover {
  opacity: 0.7;
}

/* Cart Empty State */
.cart-empty {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--color-muted);
}

.cart-empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.4;
}

.cart-empty h4 {
  color: var(--color-muted);
  margin-bottom: var(--space-sm);
}

/* Cart Footer */
.cart-footer {
  padding: var(--space-lg) var(--space-xl);
  border-top: 2px solid var(--color-border);
  background: var(--color-off-white);
}

.cart-subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.cart-subtotal-label {
  font-weight: 600;
  color: var(--color-text);
}

.cart-subtotal-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--color-primary);
}

.cart-checkout-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-deep));
  color: var(--color-white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  text-align: center;
  display: block;
}

.cart-checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 82, 87, 0.3);
}

/* Floating Cart Button */
.cart-float-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-deep));
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 8px 24px rgba(15, 82, 87, 0.4);
  z-index: 999;
  cursor: pointer;
  transition: all var(--transition-base);
}

.cart-float-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 30px rgba(15, 82, 87, 0.5);
}

.cart-float-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  background: var(--color-gold);
  color: var(--color-primary-deep);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Responsive Store --- */
@media (max-width: 1024px) {
  .store-page-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .store-page-grid {
    grid-template-columns: 1fr;
  }

  .cart-sidebar {
    width: 100%;
  }
}
