/* ========================================
   East Quogue Pizza & Deli - DESIGN SYSTEM
   Custom styles that work WITH Bootstrap
   ======================================== */

/* Import Old English style font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=UnifrakturMaguntia&display=swap');

/*
  @font-face {
    font-family: 'Old English Text MT';
    src: url('../fonts/OldEnglishTextMT.eot');
    src: url('../fonts/OldEnglishTextMT.eot?#iefix') format('embedded-opentype'),
        url('../fonts/OldEnglishTextMT.woff2') format('woff2'),
        url('../fonts/OldEnglishTextMT.woff') format('woff'),
        url('../fonts/OldEnglishTextMT.ttf') format('truetype'),
        url('../fonts/OldEnglishTextMT.svg#OldEnglishTextMT') format('svg');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
*/

/* === ROOT VARIABLES === */
:root {
  /* Colors */
  --primary-red: #8b1e1e;
  --primary-red-dark: #6e1616;
  --primary-red-light: #b83232;
  --accent-green: #2f7a32;
  --accent-green-dark: #246127;
  
  --bg-beige: #f7f3ef;
  --bg-white: #ffffff;
  
  --text-dark: #333333;
  --text-medium: #555555;
  --text-light: #666666;
  
  /* Shadows */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 6px 18px rgba(0, 0, 0, 0.15);
  
  /* Border Radius */
  --radius-md: 12px;
  --radius-lg: 14px;
  
  /* Typography */
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* === GLOBAL BASE === */
body {
  font-family: var(--font-family);
  background: var(--bg-beige);
  color: var(--text-dark);
  line-height: 1.6;
}

/* === HERO HEADER === */
.hero {
  background: linear-gradient(135deg, var(--primary-red), var(--primary-red-light));
  color: var(--bg-white);
  padding: 40px 0;
  text-align: center;
  border-bottom: 4px solid var(--primary-red-dark);
  box-shadow: var(--shadow-md);
}

/* Hero with Old English Text MT font */
.hero h1 {
  font-family: 'Old English Text MT', 'UnifrakturMaguntia', cursive, serif;
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 2px;
  /*text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);*/
  margin: 0;
}

.hero p {
  font-size: 1.1rem;
  margin-top: 8px;
  margin-bottom: 0;
  opacity: 0.95;
}

@media (max-width: 768px) {
  .hero {
    padding: 30px 16px;
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }
}

/* ===================================
   NAVIGATION BAR - Responsive Hamburger
   =================================== */

.nav-bar {
  background: var(--bg-white, #ffffff);
  border-bottom: 2px solid #ddd;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
  margin-bottom: 20px;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  position: relative;
}

/* Hamburger button (hidden on desktop) */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--primary-red, #8b1e1e);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Hamburger animation when open */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Navigation links container */
.nav-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.nav-left,
.nav-right {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

/* Individual nav links */
.nav-link {
  color: var(--text-dark, #333333);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--bg-beige, #f7f3ef);
  color: var(--primary-red, #8b1e1e);
  text-decoration: none;
}

.nav-link.active {
  background: var(--primary-red-light, #8b1e1e);
  color: var(--bg-white, #ffffff);
}

.nav-link.active:hover {
  background: var(--primary-red-dark, #6e1616);
  color: var(--bg-white, #ffffff);
}

/* Cart summary - always visible */
.cart-summary,
#nav-cart-summary {
  display: inline !important;
  margin-left: 8px;
  font-size: 0.9rem;
  opacity: 1;
  transition: opacity 0.2s ease;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .cart-summary,
  #nav-cart-summary {
    display: block !important;
    margin-left: 0;
    margin-top: 4px;
    font-size: 0.85rem;
  }
}

/* ===================================
   MOBILE STYLES (768px and below)
   =================================== */

@media (max-width: 768px) {
  /* Show hamburger button */
  .hamburger {
    display: flex;
  }

  /* Hide nav links by default */
  .nav-links {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--bg-white, #ffffff);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 80px 20px 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
  }

  /* Show nav when active */
  .nav-links.active {
    left: 0;
  }

  /* Stack nav sections vertically */
  .nav-left,
  .nav-right {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  /* Full width links in mobile */
  .nav-link {
    width: 100%;
    padding: 16px;
    border-radius: 0;
    border-bottom: 1px solid #eee;
    justify-content: flex-start;
  }

  .nav-link:first-child {
    border-top: 1px solid #eee;
  }

  /* Cart summary on mobile */
  .cart-summary {
    display: block;
    margin-left: 0;
    margin-top: 4px;
    font-size: 0.85rem;
    opacity: 0.8;
  }

  /* Overlay background when menu is open */
  .nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
  }

  .nav-overlay.active {
    display: block;
  }
}

/* ===================================
   TABLET ADJUSTMENTS (769px - 991px)
   =================================== */

@media (min-width: 769px) and (max-width: 991px) {
  .nav-container {
    padding: 12px 16px;
  }

  .nav-left,
  .nav-right {
    gap: 12px;
  }

  .nav-link {
    padding: 8px 12px;
    font-size: 0.95rem;
  }

  .cart-summary {
    font-size: 0.85rem;
  }
}

/* === CARDS === */
.card-box {
  background: var(--bg-white);
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border-left: 5px solid var(--primary-red-light);
  margin-bottom: 20px;
}

.card-box.success {
  border-left-color: var(--accent-green);
}

/* === PRODUCT CARDS === */
.product-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.product-card img,
.product-card .card-img-top {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

@media (max-width: 768px) {
  .product-card img,
  .product-card .card-img-top {
    height: 150px;
  }
}

.product-card .card-body {
  padding: 18px;
  flex: 1;
}

.product-card .card-title {
  font-weight: 700;
  color: var(--primary-red);
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.product-card .card-text {
  color: var(--accent-green);
  font-size: 1.1rem;
  font-weight: 700;
}

/* === BUTTONS === */
.btn-primary {
  background: var(--primary-red-light);
  border-color: var(--primary-red);
  color: var(--bg-white);
}

.btn-primary:hover {
  background: var(--primary-red-dark);
  border-color: var(--primary-red-dark);
  color: var(--bg-white);
}

.btn-success {
  background: var(--accent-green);
  border-color: var(--accent-green);
}

.btn-success:hover {
  background: var(--accent-green-dark);
  border-color: var(--accent-green-dark);
}

/* === FORMS === */
.form-label {
  font-weight: 600;
  color: var(--text-dark);
}

.form-control:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 0.25rem rgba(139, 30, 30, 0.25);
}

.form-select:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 0.25rem rgba(139, 30, 30, 0.25);
}

/* === CATEGORY SELECTOR === */
.category-sticky {
  padding: 16px 0;
}

@media (max-width: 768px) {
  .category-sticky {
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--bg-beige);
    padding: 12px 0;
  }
}

/* === CART ITEMS === */
.cart-item {
  background: var(--bg-white);
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.cart-item-details {
  flex: 1;
}

.cart-item-name {
  font-weight: 700;
  color: var(--primary-red);
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.cart-item-options {
  font-size: 0.9rem;
  color: var(--text-medium);
  margin-bottom: 8px;
}

.cart-item-option {
  margin-bottom: 4px;
}

.cart-item-price {
  font-weight: 700;
  color: var(--accent-green);
  font-size: 1.1rem;
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* === PRICE BOXES === */
.price-box {
  background: var(--bg-white);
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--accent-green);
  margin-bottom: 20px;
}

.price-box h5 {
  font-weight: 700;
  color: var(--accent-green);
  margin-bottom: 8px;
}

.price-box .price-amount {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-green);
}

/* === SUMMARY BOX === */
.summary-box {
  background: var(--bg-white);
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--primary-red-light);
  margin-bottom: 20px;
}

.summary-box h5 {
  font-weight: 700;
  color: var(--primary-red);
  margin-bottom: 12px;
}

.summary-box ul {
  list-style: none;
  padding-left: 0;
}

.summary-box li {
  padding: 4px 0;
  color: var(--text-medium);
}

/* === OPTION GROUPS === */
.option-group {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 2px solid #eee;
}

.option-group:last-child {
  border-bottom: none;
}

.option-group h4 {
  font-weight: 600;
  color: var(--primary-red);
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.form-check-input {
  border: 2px solid var(--primary-red);
}

.form-check-input:checked {
  background-color: var(--primary-red);
  border-color: var(--primary-red);
}

.form-check-input:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 0.25rem rgba(139, 30, 30, 0.25);
}

/* === MOBILE STICKY BAR === */
.mobile-sticky-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-white);
  border-top: 2px solid #ddd;
  padding: 12px 16px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
}

@media (max-width: 768px) {
  .mobile-sticky-bar {
    display: block;
  }
}

.sticky-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-green);
}

.sticky-summary {
  font-size: 0.9rem;
  color: var(--text-medium);
}

    /* FOOTER */
    footer {
      margin-top: 60px;
      padding: 20px 0;
      text-align: center;
      color: #666;
      font-size: 0.9rem;
    }
    /* FOOTER */
    footer {
      background: linear-gradient(135deg, #8b1e1e, #b83232);
      color: white;
      padding: 40px 0 20px;
      margin-top: 60px;
    }
    .footer-content {
      max-width: 1200px;
      margin: 0 auto;
      padding: 0 20px;
    }
    .footer-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 30px;
      margin-bottom: 30px;
    }
    .footer-section h4 {
      font-size: 1.2rem;
      font-weight: 700;
      margin-bottom: 15px;
      padding-bottom: 10px;
      border-bottom: 2px solid rgba(255,255,255,0.3);
    }
    .footer-section ul {
      list-style: none;
      padding: 0;
      margin: 0;
    }
    .footer-section ul li {
      margin-bottom: 8px;
      line-height: 1.6;
    }
    .footer-section a {
      color: white;
      text-decoration: none;
      transition: opacity 0.2s;
    }
    .footer-section a:hover {
      opacity: 0.8;
      text-decoration: underline;
    }
    .footer-section i {
      margin-right: 8px;
      color: #ffd700;
    }
    .footer-map {
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
    .footer-bottom {
      border-top: 1px solid rgba(255,255,255,0.2);
      padding-top: 20px;
      margin-top: 20px;
      text-align: center;
      font-size: 0.85rem;
      opacity: 0.9;
    }
    .footer-bottom p {
      margin: 5px 0;
    }
    @media (max-width: 768px) {
      .footer-grid {
        grid-template-columns: 1fr;
      }
    }

   .footer-desc-links {
    text-align: center;
    margin: 25px 0;
    }

    .footer-policy-link {
        color: #fff;
        text-decoration: none;
        margin: 0 12px;
        font-size: 0.9rem;
        display: inline-block;
    }

    .footer-policy-link:hover {
        text-decoration: underline;
        opacity: 0.9;
    }

    /* Better mobile spacing */
    @media (max-width: 768px) {
        .footer-policy-link {
            display: block;
            margin: 6px 0;
        }
    } 

/* === BACK LINK === */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--primary-red) !important;
  text-decoration: none;
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.back-link:hover {
  text-decoration: underline;
  color: var(--primary-red-dark) !important;
}

.back-arrow {
  font-size: 1.3rem;
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state h3 {
  color: var(--text-medium);
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.empty-state p {
  color: var(--text-light);
  margin-bottom: 24px;
}

/* === SECTION TITLE === */
.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-red);
  margin-bottom: 20px;
}

/* === CONTENT SECTION === */
.content-section {
  padding: 32px 0;
}

/* === RESPONSIVE IMAGES === */
.img-fluid {
  max-width: 100%;
  height: auto;
}

.img-rounded {
  border-radius: var(--radius-lg);
}

/* ===================================
   MOBILE: Add to Cart After Options
   =================================== */

/* Desktop: Hide mobile controls */
.mobile-add-to-cart {
  display: none;
}

/* Mobile: Hide desktop controls, show mobile controls */
@media (max-width: 767px) {
  /* Hide desktop quantity and add-to-cart */
  .desktop-cart-controls {
    display: none !important;
  }
  
  /* Show mobile add-to-cart after options */
  .mobile-add-to-cart {
    display: block !important;
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border-left: 5px solid #2f7a32;
  }
  
  .mobile-add-to-cart .quantity-controls {
    margin-bottom: 15px;
  }
  
  .mobile-add-to-cart .btn-add-to-cart {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
  }
}

/* ===================================
   BACK TO TOP BUTTON
   =================================== */

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--primary-red, #8b1e1e);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* Safari fixes - force GPU rendering */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: opacity, visibility;
}

.back-to-top:hover {
  background: var(--primary-red-dark, #6e1616);
  transform: translateY(-3px) translateZ(0);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.back-to-top:active {
  transform: translateY(-1px) translateZ(0);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
    
    /* Safari mobile - force 3D acceleration */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}

/* Prevent auto-scroll on mobile - NUCLEAR OPTION */
@media (max-width: 768px) {
  .product-card,
  .product-card *,
  #productsSection,
  #backToCategories {
    scroll-margin-top: 9999px !important;
  }
  
  html, body {
    overflow-anchor: none !important;
    scroll-behavior: auto !important;
  }
}
/* ===================================
   MOBILE PRODUCT SUMMARY (Product Page)
   =================================== */

/* Hide on desktop */
.mobile-product-summary {
  display: none;
}

/* Show only on mobile */
@media (max-width: 767px) {
  /* Hide desktop controls */
  .desktop-cart-controls {
    display: none !important;
  }
  
  /* Show mobile summary after options */
  .mobile-product-summary {
    display: block !important;
    margin-top: 20px;
  }
  
  /* Style for mobile summary list items */
  #mobile-summary-list li {
    padding: 4px 0;
    color: #555;
  }
}

/* Force back-to-top button visibility on all devices */
#backToTopBtn {
  z-index: 999999 !important;
  pointer-events: auto !important;
  bottom: 100px !important;
}

@media (max-width: 768px) {
  #backToTopBtn {
    z-index: 999999 !important;
    bottom: 100px !important;
  }
}

/* ============================================
   SAFARI-SAFE "RADIO" STYLING USING CHECKBOXES
   ============================================ */

.form-check-input[data-group] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #555;
  background-color: #fff;
  cursor: pointer;
  position: relative;
  margin-top: 2px;
  transition: border-color 0.15s ease;
}

.form-check-input[data-group]:checked::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #555;
}

.form-check-input[data-group]:focus {
  outline: none;
  box-shadow: 0 0 0 0.15rem rgba(139, 30, 30, 0.25);
  border-color: #8b1e1e;
}
