/* Menu Styles PWA-style for Duomo Pizza & Cucina */
/* Mobile-first approach with app-like interface */

/* Main layout */
.menu-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 60px; /* Space for bottom navbar on mobile */
  background-color: #F5F5F5;
  margin-top: 60px; /* Account for navbar */
}

/* Header styles - Fixed top bar */
.menu-header {
  position: fixed;
  top: 60px; /* Account for navbar */
  left: 0;
  right: 0;
  height: 60px;
  background-color: #0A1E2B; /* Primary (navy scuro) */
  display: flex;
  align-items: center;
  justify-content: flex-end; /* Align actions to the right */
  padding: 0 var(--space-md);
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.menu-header .header-actions {
  display: flex;
  gap: var(--space-md);
}

.menu-header .header-actions .search-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.menu-header .header-actions .search-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Menu Categories Top Navbar */
.menu-categories-navbar {
  position: fixed;
  top: 60px; /* Below the main navbar only */
  left: 0;
  right: 0;
  height: 90px; /* Increased height for more vertical space */
  background-color: #0A1E2B; /* Primary (navy scuro) */
  z-index: 998;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow-x: hidden; /* Hide scrollbar on the navbar itself */
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch; /* Enable momentum scrolling on iOS */
}

.menu-categories-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 var(--space-md);
}

.menu-categories-container {
  display: flex;
  height: 100%;
  align-items: center;
  padding: 0 var(--space-sm);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  flex-grow: 1;
  margin: 0 var(--space-lg);
  white-space: nowrap;
  cursor: grab; /* Aggiungi cursore grab */
  user-select: none; /* Previene selezione testo durante drag */
}

.menu-categories-container.dragging {
  cursor: grabbing; /* Cursore grabbing durante drag */
  scroll-behavior: auto; /* Disabilita smooth durante drag per reattività */
  scroll-snap-type: none; /* Disabilita snap durante drag */
}

/* Previeni selezione durante drag */
.menu-categories-container.dragging * {
  pointer-events: none;
  user-select: none;
}

.menu-categories-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Chevron buttons */
.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
}

.scroll-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.scroll-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.scroll-btn-left {
  left: var(--space-md);
}

.scroll-btn-right {
  right: var(--space-md);
}

/* Chevron buttons are always visible */
.scroll-btn {
  display: flex;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #FFFFFF;
  transition: all 0.3s ease;
  font-size: 0.8rem;
  min-width: 90px;
  height: 70px;
  margin: 0 var(--space-sm);
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: var(--space-sm) var(--space-sm);
  border: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  scroll-snap-align: start; /* Aggiungi snap align */
}

.category-item i {
  font-size: 20px;
  margin-bottom: var(--space-xs);
}

.category-item .category-icon {
  width: 20px;
  height: 20px;
  margin-bottom: var(--space-xs);
  filter: invert(100%); /* Make it white to match other icons */
}

.category-item span {
  font-size: 11px;
  text-align: center;
}

.category-item:hover,
.category-item.active {
  background-color: #F39200; /* Highlight (arancione) */
  color: #FFFFFF;
  transform: translateY(-2px);
  text-decoration: none; /* Ensure no text decoration */
  border: none; /* Ensure no border */
}

/* Add space for anchor links to account for fixed navbar */
.category-section {
  scroll-margin-top: 150px; /* Default for mobile: main navbar (60px) + categories navbar (90px) */
}

@media (min-width: 768px) {
  .category-section {
    scroll-margin-top: 160px; /* Tablet: main navbar (70px) + categories navbar (90px) */
  }
}

@media (min-width: 1024px) {
  .category-section {
    scroll-margin-top: 170px; /* Desktop: main navbar (80px) + categories navbar (90px) */
  }
}

/* Menu content */
.menu-content {
  padding: var(--space-md);
  margin-top: 150px; /* Default for mobile: main navbar (60px) + categories navbar (90px) */
}

@media (min-width: 768px) {
  .menu-content {
    margin-top: 160px; /* Tablet: main navbar (70px) + categories navbar (90px) */
  }
}

@media (min-width: 1024px) {
  .menu-content {
    margin-top: 170px; /* Desktop: main navbar (80px) + categories navbar (90px) */
  }
}

/* Category sections */
.category-section {
  margin-bottom: var(--space-xl);
}

.category-section h2 {
  margin-bottom: var(--space-md);
  color: #0A1E2B; /* Primary (navy scuro) */
  font-size: var(--font-size-xl);
}

.pizza-info {
  background-color: #fff8e1;
  border-left: 4px solid #F39200;
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  border-radius: 0 8px 8px 0;
}

.pizza-info p {
  margin: 0 0 var(--space-xs) 0;
  font-size: var(--font-size-sm);
  color: #333;
}

.pizza-info p strong {
  color: #0A1E2B;
}

/* Allergen badges - rounded rectangles with red borders and label */
.product-title-with-allergens {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.allergen-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.allergen-label {
  font-size: 10px;
  color: #666666;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.allergen-badges {
  display: flex;
  gap: 5px;
  align-items: center;
}

.allergen-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  background-color: white;
  color: #c63f41; /* Red color matching product titles */
  border: 2px solid #c63f41;
  border-radius: 8px;
  font-size: 12px;
  font-weight: bold;
  cursor: help;
  transition: all 0.2s ease;
  padding: 0 4px;
}

.allergen-badge:hover {
  transform: scale(1.1);
  background-color: #c63f41;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ========================================
   FLOATING COMBO TAB
======================================== */

.combo-floating-tab {
    position: fixed;
    left: -45px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    background: linear-gradient(135deg, #0A1E2B 0%, #163d54 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 2px;
    z-index: 997;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.combo-floating-tab:hover {
    left: -40px;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #F39200 0%, #d67d00 100%);
}

/* ========================================
   COMBO MODAL
======================================== */

.combo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1002;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.combo-modal.active {
    display: flex;
}

.combo-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 30, 43, 0.85);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.combo-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

.combo-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e74c3c;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    z-index: 2;
}

.combo-modal-close:hover {
    background: #c0392b;
    transform: rotate(90deg);
}

.combo-modal-title {
    text-align: center;
    color: #0A1E2B;
    font-size: 28px;
    margin-bottom: 30px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   COMBO CARDS
======================================== */

.combo-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.combo-card {
    background: linear-gradient(135deg, #0A1E2B 0%, #0A1E2B 100%);
    border-radius: 12px;
    padding: 24px;
    color: white;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid #F39200;
}

.combo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.combo-card-special {
    background: linear-gradient(135deg, #0A1E2B 0%, #0A1E2B 100%);
    border: 2px solid #F39200;
}

.combo-card-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.combo-card-text {
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

.combo-price {
    color: #FF6B6B;
    font-weight: 800;
    font-size: 18px;
    display: inline-block;
    padding: 2px 8px;
    background: white;
    border-radius: 6px;
    margin-left: 4px;
}

/* ========================================
   ANIMATIONS
======================================== */

 @keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

 @keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   RESPONSIVE
======================================== */

 @media (max-width: 768px) {
    .combo-modal-content {
        padding: 30px 20px;
        max-height: 85vh;
    }
    
    .combo-modal-title {
        font-size: 24px;
    }
    
    .combo-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .combo-card-icon {
        font-size: 48px;
    }
    
    .combo-floating-tab {
        left: -50px;
        font-size: 12px;
        padding: 10px 20px;
    }
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: 1fr; /* Mobile: 1 column */
  gap: 16px; /* Mobile gap */
  margin-bottom: var(--space-lg);
}

/* Product card */
.product-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  background: white;
  border-radius: 12px; /* Border-radius cards: 12px */
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); /* Box-shadow soft */
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Transition: 0.3s cubic-bezier */
  min-height: 120px; /* Product card height mobile: min-height 120px */
}

.product-card:hover {
  transform: translateY(-3px);
}

.product-card-content {
  flex-grow: 1;
  padding: var(--space-md);
}

.product-card-title {
  margin: 0 0 var(--space-xs) 0;
  font-size: var(--font-size-lg);
  color: #c63f41; /* Red color for pizza names */
  font-weight: 600;
}

.product-card-ingredients {
  margin: 0 0 var(--space-xs) 0;
  font-size: var(--font-size-sm);
  color: #666666; /* Text light */
  font-style: italic;
}

.product-card-description {
  margin: 0 0 var(--space-xs) 0;
  font-size: var(--font-size-sm);
  color: #666666; /* Text light */
  line-height: 1.4;
}

.product-card-price {
  font-weight: 700;
  color: #c63f41; /* Red color for prices */
  margin: 0;
  font-size: var(--font-size-lg);
}

/* Bottom navbar - Fixed bottom - Category Navigation */
.bottom-navbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px; /* Bottom navbar: height 60px */
  background: white;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 999; /* Bottom navbar: z-index 999 */
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1); /* Bottom navbar: box-shadow top */
  padding: 0 var(--space-sm);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #666666; /* Text light */
  transition: color 0.3s ease;
  font-size: 0.8rem;
  min-width: 60px;
  padding: var(--space-xs) 0;
}

.nav-item i {
  font-size: 24px; /* Bottom navbar icons: size 24px */
  margin-bottom: var(--space-xs);
}

.nav-item span {
  font-size: 11px; /* Bottom navbar text: 11px */
}

.nav-item.active,
.nav-item:hover {
  color: #F39200; /* Highlight (arancione) */
}

/* DESKTOP LAYOUT */
@media (min-width: 768px) {
  .menu-page {
    margin-top: 70px; /* Account for navbar */
  }
  
  .menu-header {
    top: 70px; /* Account for navbar */
  }
  
  .menu-categories-navbar {
    top: 70px; /* Position below main navbar on tablet */
    height: 90px; /* Increased height for more vertical space */
    overflow-x: hidden; /* Hide scrollbar on the navbar itself */
    overflow-y: hidden;
  }
  
  /* Desktop grid: 2 columns */
  .product-grid {
    grid-template-columns: repeat(2, 1fr); /* Grid 2 colonne */
    gap: 24px; /* Gap grid: 24px desktop */
  }
  
  /* Hide bottom navbar on desktop */
  .bottom-navbar {
    display: none;
  }
  
  /* Show footer on desktop */
  .menu-footer {
    display: block;
  }
}

@media (min-width: 1024px) {
  /* Desktop grid: 3 columns */
  .product-grid {
    grid-template-columns: repeat(3, 1fr); /* Grid 3 colonne */
  }
  
  .menu-categories-navbar {
    top: 80px; /* Position below main navbar on desktop */
    height: 90px; /* Increased height for more vertical space */
    overflow-x: hidden; /* Hide scrollbar on the navbar itself */
    overflow-y: hidden;
  }
}

@media (min-width: 1024px) {
  /* Desktop grid: 3 columns */
  .product-grid {
    grid-template-columns: repeat(3, 1fr); /* Grid 3 colonne */
  }
}

/* Touch and mobile specific styles */
@media (max-width: 767px) {
  /* Add safe area inset for iPhone */
  .bottom-navbar {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  
  .menu-categories-navbar {
    top: 60px; /* Position below main navbar on mobile */
    height: 90px; /* Increased height for more vertical space */
    overflow-x: hidden; /* Hide scrollbar on the navbar itself */
    overflow-y: hidden;
  }
  
  .menu-page {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0)); /* Space for bottom navbar with safe area */
  }
  
  /* Hide footer on mobile */
  .menu-footer {
    display: none;
  }
}

/* Touch action optimization */
.product-card,
.nav-item {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Search overlay */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-overlay .search-form {
  width: 90%;
  max-width: 500px;
  display: flex;
  margin-bottom: var(--space-lg);
}

.search-overlay input {
  flex-grow: 1;
  padding: var(--space-md);
  font-size: 1.2rem;
  border: none;
  border-radius: 8px 0 0 8px;
}

.search-overlay button {
  padding: var(--space-md) var(--space-lg);
  background-color: #F39200;
  color: white;
  border: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
}

.close-search {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}