/* =====================================================
   VIOLET BOO BAKERY - SHOP PAGE STYLES
   Premium Pastel Theme - Phase 3 Refinements
   ===================================================== */

/* -------------------------
   Shop Main Section (Clean, no pink header)
   ------------------------- */
.shop-main {
  margin-top: 35px; /* Space for nav scallop effect */
  padding-top: var(--space-xl);
}

/* -------------------------
   Shop Hero & Filters
   ------------------------- */
.shop-hero {
  text-align: center;
  padding: var(--space-xl) 0 var(--space-lg);
}

.shop-hero h1 {
  margin-bottom: var(--space-md);
  font-size: clamp(2rem, 5vw, 2.8rem);
  color: var(--violet-deep);
}

.shop-hero p {
  margin-bottom: var(--space-sm);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.05rem;
  color: var(--muted);
}

.shop-hero .note {
  font-size: 0.95rem;
  color: var(--violet);
  font-weight: 600;
  margin-top: var(--space-md);
}

/* Filter Buttons */
.filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-lg) 0;
  margin-bottom: var(--space-lg);
}

.filters button {
  padding: 12px 22px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  border: 2px solid rgba(155, 127, 209, 0.15);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  backdrop-filter: blur(8px);
}

.filters button:hover {
  border-color: var(--violet-light);
  background: var(--white);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(155, 127, 209, 0.15);
}

.filters button.active {
  background: linear-gradient(135deg, var(--violet), var(--violet-deep));
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(107, 75, 171, 0.3);
}

/* Category Icon Styling */
.filter-icon {
  font-size: 1.2em;
  margin-right: 6px;
  display: inline-block;
  transition: transform var(--transition);
}

.filter-text {
  display: inline-block;
}

/* Show icons by default */
.filters button {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hide icons when category-icons setting is disabled */
body:not(.category-icons-enabled) .filter-icon {
  display: none;
}

body:not(.category-icons-enabled) .filter-text {
  margin-left: 0;
}

/* Enhanced icon hover effects when enabled */
.category-icons-enabled .filters button:hover .filter-icon {
  transform: scale(1.2) rotate(5deg);
}

/* Christmas theme category icons */
.christmas-theme .filter-icon {
  filter: drop-shadow(0 2px 4px rgba(196, 30, 58, 0.3));
}

.christmas-theme .filters button:hover .filter-icon {
  transform: scale(1.3) rotate(10deg);
  filter: drop-shadow(0 3px 6px rgba(196, 30, 58, 0.5));
}

/* Mobile optimization for category icons */
@media (max-width: 768px) {
  .filter-icon {
    font-size: 1em;
    margin-right: 4px;
  }
  
  .filters button {
    padding: 10px 16px;
    font-size: 0.85rem;
  }
  
  .category-icons-enabled .filters button:hover .filter-icon {
    transform: scale(1.1) rotate(3deg);
  }
}

/* -------------------------
   Shop Header Section (Fallback)
   ------------------------- */
.shop-header {
  text-align: center;
  padding: var(--space-2xl) 0;
  background: linear-gradient(180deg, var(--pink-soft) 0%, var(--cream) 100%);
}

.shop-header h1 {
  margin-bottom: var(--space-sm);
}

.shop-header p {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* -------------------------
   Product Grid
   ------------------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-xl);
  padding: var(--space-lg) 0;
}

/* -------------------------
   Product Card - Premium Design
   ------------------------- */
.product-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 
    0 10px 40px rgba(155, 127, 209, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: all var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 
    0 20px 50px rgba(155, 127, 209, 0.18),
    0 8px 20px rgba(0, 0, 0, 0.06);
}

/* Product Image Container */
.product-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--lilac-soft);
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s var(--ease-out);
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

/* Weekly Special Badge */
.product-ribbon {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, var(--violet), var(--violet-deep));
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(107, 75, 171, 0.4);
  z-index: 2;
}

/* Sold Out Banner */
.product-sold-out {
  position: absolute;
  inset: 0;
  background: rgba(61, 47, 88, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.product-sold-out span {
  background: var(--white);
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  transform: rotate(-5deg);
  box-shadow: var(--shadow);
}

/* Product Content */
.product-content {
  padding: var(--space-xl);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--violet);
  background: var(--lilac-soft);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-sm);
  align-self: flex-start;
}

.product-content h3 {
  margin-bottom: var(--space-sm);
  font-size: 1.4rem;
  color: var(--text);
}

.product-description {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
  flex: 1;
}

/* Product Footer */
.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: auto;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.product-price {
  font-family: "Pacifico", cursive;
  font-size: 1.6rem;
  color: var(--violet-deep);
}

.product-buttons {
  display: flex;
  gap: var(--space-sm);
}

.product-buttons .button {
  padding: 10px 18px;
  font-size: 0.85rem;
}

.product-buttons .button.alt {
  padding: 10px 14px;
}

/* Sold out state */
.product-card.sold-out {
  opacity: 0.85;
}

/* Only disable the Order/Add to Cart button, not the Enquire button */
.product-card.sold-out .product-buttons .button:not(.alt) {
  background: var(--lilac-soft);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
  pointer-events: none;
}

.product-card.sold-out .product-buttons .button:not(.alt):hover {
  transform: none;
}

/* Enquire button should still be clickable on sold out items */
.product-card.sold-out .product-buttons .button.alt {
  cursor: pointer;
  pointer-events: auto;
}

/* -------------------------
   Enquiry Form Panel (Inline Card)
   ------------------------- */
.enquiry-panel {
  background: linear-gradient(145deg, var(--white) 0%, var(--lilac-soft) 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-lg) var(--space-xl);
  margin-top: var(--space-xl);
  box-shadow: var(--shadow);
  border: 2px solid rgba(155, 127, 209, 0.1);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.enquiry-panel h2 {
  margin-bottom: var(--space-xs);
  color: var(--text);
  text-align: center;
  font-size: 1.4rem;
}

.enquiry-panel > p {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-sm);
  color: var(--muted);
  font-size: 0.85rem;
}

.enquiry-panel form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm) var(--space-md);
  max-width: 100%;
  margin: 0 auto;
}

.enquiry-panel .field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.enquiry-panel .field.full-width {
  grid-column: 1 / -1;
}

.enquiry-panel label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text);
}

.enquiry-panel input,
.enquiry-panel textarea,
.enquiry-panel select {
  padding: var(--space-xs) var(--space-sm);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--white);
  transition: all var(--transition);
}

.enquiry-panel input:focus,
.enquiry-panel textarea:focus,
.enquiry-panel select:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(155, 127, 209, 0.15);
}

.enquiry-panel input::placeholder,
.enquiry-panel textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.enquiry-panel textarea {
  resize: vertical;
  min-height: 60px;
}

.enquiry-panel button[type="submit"] {
  margin-top: var(--space-xs);
  justify-self: center;
  grid-column: 1 / -1;
  min-width: 160px;
}

.enquiry-panel [data-enquiry-status] {
  text-align: center;
  font-weight: 600;
  margin-top: var(--space-sm);
}

.enquiry-panel [data-enquiry-status].success {
  color: #2d8a4e;
}

.enquiry-panel [data-enquiry-status].error {
  color: #c53030;
}

/* -------------------------
   Shop Status Bar
   ------------------------- */
.shop-status {
  text-align: center;
  padding: var(--space-lg);
  color: var(--muted);
  font-size: 0.95rem;
}

/* -------------------------
   Empty State
   ------------------------- */
.shop-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-3xl);
}

.shop-empty h3 {
  margin-bottom: var(--space-sm);
}

.shop-empty p {
  color: var(--muted);
}

/* -------------------------
   Scale-in Animation for Cards
   ------------------------- */
.product-card {
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  animation: card-scale-in 0.5s var(--ease-spring) forwards;
}

.product-card:nth-child(1) { animation-delay: 0ms; }
.product-card:nth-child(2) { animation-delay: 80ms; }
.product-card:nth-child(3) { animation-delay: 160ms; }
.product-card:nth-child(4) { animation-delay: 240ms; }
.product-card:nth-child(5) { animation-delay: 320ms; }
.product-card:nth-child(6) { animation-delay: 400ms; }
.product-card:nth-child(7) { animation-delay: 480ms; }
.product-card:nth-child(8) { animation-delay: 560ms; }

@keyframes card-scale-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* -------------------------
   Responsive Adjustments
   ------------------------- */
@media (max-width: 768px) {
  .shop-scallop-header {
    padding: var(--space-xl) 0 var(--space-2xl);
  }
  
  .product-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .filters {
    gap: var(--space-xs);
  }
  
  .filters button {
    padding: 8px 14px;
    font-size: 0.8rem;
  }
  
  .enquiry-panel {
    padding: var(--space-lg);
    margin-top: var(--space-2xl);
  }
  
  .enquiry-panel form {
    gap: var(--space-sm);
  }
}

/* -------------------------
   Basket Toast Notification
   ------------------------- */
.cart-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, var(--violet) 0%, var(--violet-deep) 100%);
  color: white;
  padding: 16px 24px;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 40px rgba(107, 75, 171, 0.4);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s var(--ease-out);
  font-weight: 600;
}

.cart-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.cart-toast .toast-link {
  color: var(--pink);
  text-decoration: none;
  font-weight: 700;
}

.cart-toast .toast-link:hover {
  text-decoration: underline;
}

/* -------------------------
   Basket Badge in Nav
   ------------------------- */
.cart-link {
  position: relative;
}

.cart-badge {
  background: var(--pink);
  color: var(--violet-deep);
  font-size: 0.7rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
}

/* =====================================================
   CHRISTMAS THEME OVERRIDES FOR SHOP PAGE
   ===================================================== */
.christmas-theme .shop-title {
  color: var(--christmas-red) !important;
}

.christmas-theme .shop-intro {
  color: var(--christmas-green) !important;
}

.christmas-theme .category-btn {
  color: var(--christmas-green) !important;
  border-color: var(--christmas-green) !important;
}

.christmas-theme .category-btn:hover,
.christmas-theme .category-btn.active {
  background: linear-gradient(135deg, var(--christmas-red), var(--christmas-pine)) !important;
  color: white !important;
}

.christmas-theme .product-card .product-title {
  color: var(--christmas-red) !important;
}

.christmas-theme .product-card .product-category {
  color: var(--christmas-green) !important;
}

.christmas-theme .product-card .product-price {
  color: var(--christmas-red) !important;
}

.christmas-theme .product-card .button.alt {
  color: #ffffff !important;
  border-color: var(--christmas-gold) !important;
  background: linear-gradient(135deg, var(--christmas-red) 0%, #a01830 100%) !important;
}

.christmas-theme .product-card .button.alt:hover {
  background: linear-gradient(135deg, var(--christmas-green) 0%, var(--christmas-pine) 100%) !important;
  color: #ffffff !important;
}

.christmas-theme .weekly-badge {
  background: linear-gradient(135deg, var(--christmas-red), var(--christmas-pine)) !important;
}

.christmas-theme .basket-toast {
  background: linear-gradient(135deg, var(--christmas-green) 0%, var(--christmas-pine) 100%) !important;
}

.christmas-theme .cart-badge {
  background: var(--christmas-red) !important;
  color: white !important;
}

.christmas-theme .enquiry-panel {
  border-color: var(--christmas-gold) !important;
}

.christmas-theme .enquiry-panel h3 {
  color: var(--christmas-red) !important;
}

.christmas-theme .enquiry-panel label {
  color: var(--christmas-green) !important;
}
