/* styles.css - Cleaned & Refactored */
/* Color Scheme Variables */
:root {
  --cream: #fdf4d5;
  --brown: #5d4a27;
  --accent: #a87856;
  --brown-100: #fef7e6;
  --brown-200: #f5e8d5;
  --brown-300: #e6d5b8;
  --brown-400: #d4b895;
  --brown-500: #c19a6b;
  --brown-600: #a87856;
  --brown-700: #8d6547;
  --brown-800: #5d4a27;
  --brown-900: #4a3c1f;
}

/* Global Styles */
html, body { 
  scroll-behavior: smooth; 
  overflow-x: hidden; 
  height: 100%; 
  font-family: 'Poppins', sans-serif; 
}

form section{
  background-color: var(--cream);
}

/* Page-specific scroll behavior */
.homepage-body {
  scroll-snap-type: none !important;
}

.homepage-body section {
  scroll-snap-align: none !important;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  flex-direction: column;
  text-align: center;
  background-attachment: scroll;
  background-size: cover;
  background-position: center;
  position: relative;
}

body:not(.homepage-body) {
  scroll-snap-type: y mandatory !important;
  overflow-x: hidden;
  height: 100%;
}

body:not(.homepage-body) section {
  scroll-snap-align: start !important;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  position: relative;
}

section::before { 
  content: ""; 
  position:absolute; 
  inset:0; 
  background: rgba(255, 248, 240, 0.3); 
  z-index:-1; 
}

/* Header & Navigation */
.simple-header {
  background-color: transparent;
  position: sticky;
  top: 0;
  z-index: 100;
  pointer-events: none;
}

.logo-link {
  pointer-events: auto;
  display: inline-block;
  transition: transform 0.2s ease;
}

.logo-link:hover {
  transform: scale(1.05);
}

.btn-primary {
  background-color: var(--accent);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* Order Page Navigation */
.order-nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: transparent;
  z-index: 50;
}

.nav-cart-btn {
  position: relative;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.nav-cart-btn:hover {
  background: var(--brown-100);
}

.nav-cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Form Elements */
form section {
  background-color: var(--cream);
}

.form-container {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 25px rgba(93, 74, 39, 0.1);
  border: 1px solid var(--brown-200);
  max-width: 896px;
  margin: 0 auto;
}

/* Cookie Cards */
.cookie-card { 
  cursor: pointer; 
  transition: all 0.3s ease; 
  border: 2px solid transparent;
  background: var(--cream);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(93, 74, 39, 0.1);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
}

.cookie-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(93, 74, 39, 0.15);
  border-color: var(--accent);
}

.cookie-card.active {
  border-color: var(--accent);
  background: var(--brown-100);
  box-shadow: 0 4px 15px rgba(93, 74, 39, 0.2);
}

/* Buttons */
.nav-button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(93, 74, 39, 0.3);
  font-size: 1.1em;
}

.nav-button:hover {
  background: var(--brown-700);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(93, 74, 39, 0.4);
}

.arrow-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(93, 74, 39, 0.3);
  width: 48px;
  height: 48px;
}

.arrow-btn:hover {
  background: var(--brown-700);
  transform: scale(1.1);
}

/* Selection Options */
.delivery-option,
.time-slot-option,
.social-platform-option {
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  margin: 8px 0;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fff;
}

.delivery-option:hover,
.time-slot-option:hover,
.social-platform-option:hover {
  border-color: var(--accent);
  background: var(--brown-100);
}

.delivery-option.active,
.time-slot-option.active,
.social-platform-option.active {
  border-color: var(--accent);
  background: var(--brown-100);
  font-weight: bold;
}

.quick-date-btn{
  border: 2px solid #e5e7eb;
}

.quick-date-btn.active {
  border-color: var(--accent);
  background: var(--brown-100);
  font-weight: bold;
}

#customizeModal .modal-footer button,
#productModal .modal-body button,
#cartModal .modal-footer button{
  background: var(--accent);
  color: white;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active { 
  display: flex; 
}

.modal-content { 
  background: #fff; 
  border-radius: 12px; 
  width: 90%; 
  max-width: 680px; 
  max-height: 85vh; 
  display: flex; 
  flex-direction: column; 
  overflow: hidden; 
}

.modal-header, .modal-footer { 
  padding: 1rem; 
  border-bottom: 1px solid #eee; 
}

.modal-footer { 
  border-top: 1px solid #eee; 
  border-bottom: none; 
}

.modal-body { 
  flex: 1; 
  overflow-y: auto; 
  padding: 1rem; 
}

/* Toast Styles */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  max-width: 300px;
}

.toast.show {
  transform: translateX(0);
}

.toast.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast.warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Footer */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--accent);
  color: white;
  padding: 12px;
  text-align: center;
  font-size: 0.9em;
  z-index: 40;
}

.footer-dark {
  background-color: var(--brown-700);
}

/* Homepage Specific */
.hero-section {
  background: linear-gradient(135deg, rgba(93, 74, 39, 0.9) 0%, rgba(168, 120, 86, 0.8) 100%), url('images/bg-image-hero.JPG') center/cover;
  background-attachment: fixed;
  min-height: 100vh;
}

/* Add these styles to styles.css - Updated Meet the Doughs Section */

/* Meet the Doughs Section - Updated */
.flavors-section {
  padding: 4rem 0;
}

.flavors-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.flavor-card {
  background: var(--cream);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(93, 74, 39, 0.1);
  transition: all 0.3s ease;
  border: 2px solid transparent;
  text-align: center;
}

.flavor-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(93, 74, 39, 0.15);
  border-color: var(--accent);
}

.flavor-image-container {
  width: 100%;
  margin: 0 auto 1.5rem;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

.flavor-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.flavor-name {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--brown-800);
}

.flavor-description {
  font-size: 1rem;
  color: var(--brown-600);
  line-height: 1.6;
}

/* Mobile Carousel Styles */
.flavors-carousel-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 20px;
}

.flavors-carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.flavor-carousel-item {
  min-width: 100%;
  padding: 1rem;
}

.carousel-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
  gap: 1rem;
}

.counter-display {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brown-700);
  background: var(--brown-100);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  min-width: 80px;
  text-align: center;
}

.flavor-carousel-nav {
  background: var(--accent);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.flavor-carousel-nav:hover {
  background: var(--brown-700);
  transform: scale(1.1);
}

.flavor-carousel-nav:disabled {
  background: var(--brown-300);
  cursor: not-allowed;
  transform: none;
}

/* Desktop Grid Layout */
@media (min-width: 1024px) {
  .flavors-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 0 2rem;
  }
  
  .flavors-carousel-container {
    display: none;
  }
}

/* Tablet Layout */
@media (min-width: 768px) and (max-width: 1023px) {
  .flavors-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 0 1.5rem;
  }
  
  .flavors-carousel-container {
    display: none;
  }
}

/* Mobile Layout */
@media (max-width: 767px) {
  .flavors-grid {
    display: none;
  }
  
  .flavors-carousel-container {
    display: block;
    margin: 0 1rem;
  }
  
  .carousel-counter {
    margin: 1rem 0;
  }
}

/* Smooth Carousel Transitions */
.flavors-carousel-track {
  will-change: transform;
}

/* Enhanced image loading states */
.flavor-image.loading {
  opacity: 0.7;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

/* Optimized Image Loading */
.cookie-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: var(--brown-100);
}

.cookie-image.loading {
  opacity: 0.7;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Responsive Design */
@media (max-width: 768px) {
  section { 
    padding: 1rem; 
    padding-bottom: 90px !important;
  }

  .cookie-card {
    padding: 1.5rem;
    min-height: auto;
  }

  .flavor-carousel-image {
    width: 150px;
    height: 150px;
  }

  .flavor-carousel-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  section {
    padding: 0.75rem;
    padding-bottom: 90px !important;
  }
  
  .form-container {
    padding: 1.5rem;
  }
}

/* Color Utilities */
.bg-cream { background-color: var(--cream); }
.bg-brown-100 { background-color: var(--brown-100); }
.bg-brown-200 { background-color: var(--brown-200); }
.text-brown { color: var(--brown); }
.text-accent { color: var(--accent); }

/* Add to styles.css - Mobile Form Consistency */
.form-container {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 10px 25px rgba(93, 74, 39, 0.1);
  border: 1px solid var(--brown-200);
  width: 90%;
  max-width: 896px;
  margin: 0 auto;
}

/* Ensure consistent sizing across all form sections */
#section-2 .form-container,
#section-3 .form-container,
#section-4 .form-container,
#section-6 .form-container,
#section-7 .form-container,
#section-8 .form-container {
  max-width: 400px;
}

#section-5 .form-container {
  max-width: 800px;
}

#section-9 .form-container {
  max-width: 500px;
}

/* Mobile-specific form adjustments */
@media (max-width: 768px) {
  .form-container {
    padding: 1.25rem;
    width: 95%;
    margin: 0 auto;
  }
  
  #section-2 .form-container,
  #section-3 .form-container,
  #section-4 .form-container,
  #section-6 .form-container,
  #section-7 .form-container,
  #section-8 .form-container {
    max-width: 100%;
    width: 100%;
  }
  
  #section-5 .form-container {
    max-width: 100%;
    width: 100%;
    padding: 1rem;
  }
  
  #section-9 .form-container {
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .form-container {
    padding: 1rem;
    width: 98%;
    border-radius: 12px;
  }
  
  section {
    padding: 1.3rem !important;
  }
}

section > div {
  padding: 1.5rem !important;
}

@media (max-width: 768px) {
  #section-5 .grid {
      gap: 1rem;
      margin-top: 32px;
  }

  #section-5 > div{
    margin-top: 80px;
  }
}

/* Customize Modal Styles - Reverted to Previous Design */
.boxsize-list, .cookie-list { 
  display:flex; 
  flex-direction:column; 
  gap:10px; 
  margin-top:12px; 
}

.boxsize-row, .cookie-row { 
  display:flex; 
  align-items:center; 
  justify-content:space-between; 
  border:1px solid #e5e7eb; 
  border-radius:8px; 
  padding:10px 14px; 
  background:#fafafa; 
  cursor:pointer; 
  transition:background .15s; 
}

.boxsize-row:hover, .cookie-row:hover { 
  background:#f3f4f6; 
}

.boxsize-row.active, .cookie-row.active { 
  border-color:var(--accent); 
  background:var(--brown-100); 
}

.cookie-price { 
  font-size:.9rem; 
  color:#6b7280; 
  margin-left:8px; 
}

.quantity-control { 
  display:none; 
  align-items:center; 
  gap:8px; 
}

.cookie-row.active .quantity-control { 
  display:flex; 
}

.cookie-qty-input { 
  width:56px; 
  text-align:center; 
  border:1px solid #d1d5db; 
  border-radius:6px; 
  padding:4px; 
}

.qty-btn { 
  background:#111827; 
  color:#fff; 
  border:none; 
  padding:6px 8px; 
  border-radius:6px; 
  cursor:pointer; 
}

/* Product Modal Fixes */
#productModal .modal-content {
  max-width: 420px;
  margin: 2rem auto;
}

#productImagePlaceholder {
  font-size: 3rem;
}

.quantity-btn {
  transition: all 0.2s ease;
}

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

/* Toast Container Fix */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000; /* Increased z-index */
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  max-width: 300px;
}

.toast.show {
  transform: translateX(0);
}

.toast.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast.warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.toast-icon {
  font-size: 1.2em;
}

.toast-message {
  flex: 1;
  font-weight: 500;
}

@media (max-width: 768px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }
  
  .toast {
    max-width: none;
  }
  
  #productModal .modal-content {
    margin: 1rem;
    width: calc(100% - 2rem);
  }
}