/*!
 * PizzaShopPro - Mobile-First Responsive Optimization
 * Version: 2.0.0
 * Optimized for all devices: Mobile (320px+), Tablet (768px+), Desktop (1024px+)
 */

/* ==========================================================================
   MOBILE-FIRST BASE STYLES (320px+)
   ========================================================================== */

/* Reset for touch-friendly interactions */
* {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  -webkit-touch-callout: none;
}

body {
  font-size: 16px !important;
  line-height: 1.6 !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden !important;
}

/* Ensure all images are responsive */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Touch-friendly buttons and links */
a, button, .btn {
  min-height: 44px !important;
  min-width: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  touch-action: manipulation;
}

/* ==========================================================================
   MOBILE HEADER OPTIMIZATION (All Sizes)
   ========================================================================== */

.header-topbar {
  padding: 1.25rem 0 !important;
  font-size: 1rem !important;
  min-height: auto !important;
}

.topbar-content {
  padding: 0 1.5rem !important;
  flex-direction: column !important;
  gap: 1.5rem !important;
  text-align: center !important;
}

.contact-info {
  flex-direction: column !important;
  gap: 1rem !important;
  width: 100% !important;
  align-items: center !important;
}

.contact-item {
  font-size: 1.1rem !important;
  padding: 0.75rem 1rem !important;
  width: 100% !important;
  justify-content: center !important;
  white-space: normal !important;
  text-align: center !important;
  background: rgba(255, 255, 255, 0.15) !important;
  border-radius: 0.75rem !important;
  margin-bottom: 0.5rem !important;
}

.contact-item span {
  display: block !important;
  width: 100% !important;
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
}

.contact-item a {
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
}

.contact-item svg {
  width: 20px !important;
  height: 20px !important;
  margin-right: 0.75rem !important;
}

.topbar-actions {
  width: 100% !important;
  flex-direction: column !important;
  gap: 1rem !important;
}

.social-link {
  width: 100% !important;
  margin-right: 0 !important;
  justify-content: center !important;
  padding: 1rem 2rem !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  min-height: 52px !important;
}

.order-btn {
  width: 100% !important;
  padding: 1.25rem 2rem !important;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  justify-content: center !important;
  min-height: 56px !important;
  letter-spacing: 0.5px !important;
}

/* Mobile Header Main */
.header-main {
  padding: 1rem 0 !important;
}

.header-content {
  padding: 0 1rem !important;
  gap: 1rem !important;
}

.logo-main {
  font-size: 2.25rem !important;
  line-height: 1.1 !important;
}

.logo-tagline {
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  margin-top: 0.25rem !important;
}

/* Mobile Navigation */
.main-navigation {
  order: 3 !important;
  width: 100% !important;
}

.mobile-menu-toggle {
  display: flex !important;
  padding: 0.75rem !important;
  background: rgba(255, 255, 255, 0.15) !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.nav-menu {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: #2c3e50 !important;
  flex-direction: column !important;
  padding: 5rem 2rem 2rem !important;
  gap: 0.5rem !important;
  z-index: 9999 !important;
  transform: translateX(-100%) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.nav-menu.active {
  transform: translateX(0) !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.nav-menu li {
  width: 100% !important;
  margin: 0 !important;
}

.nav-menu a {
  width: 100% !important;
  padding: 1.25rem 1.5rem !important;
  font-size: 1.125rem !important;
  text-align: center !important;
  border-radius: 12px !important;
  margin-bottom: 0.5rem !important;
}

.nav-order-btn {
  margin-top: 1rem !important;
  padding: 1.25rem 2rem !important;
  font-size: 1rem !important;
}

.header-actions {
  gap: 0.5rem !important;
  margin-left: 0 !important;
}

.search-toggle,
.cart-toggle {
  width: 48px !important;
  height: 48px !important;
  padding: 0.75rem !important;
  font-size: 1.5rem !important;
  background: rgba(255, 255, 255, 0.15) !important;
  border-radius: 0.75rem !important;
}

/* ==========================================================================
   MOBILE HERO SECTION OPTIMIZATION
   ========================================================================== */

.hero {
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
}

.hero-content {
  padding: 1rem !important;
}

.hero-text {
  max-width: 100% !important;
  padding: 1rem !important;
}

.title-main {
  font-size: clamp(2.5rem, 12vw, 4.5rem) !important;
  line-height: 1.1 !important;
  margin-bottom: 1rem !important;
}

.title-sub {
  font-size: clamp(0.85rem, 2.5vw, 1.1rem) !important;
  padding: 0.5rem 1rem !important;
  margin-bottom: 1rem !important;
  max-width: 90% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.hero-description {
  font-size: clamp(0.9rem, 2.2vw, 1.1rem) !important;
  padding: 1.25rem !important;
  margin-bottom: 2rem !important;
  max-width: 100% !important;
  line-height: 1.6 !important;
}

.hero-buttons {
  flex-direction: column !important;
  gap: 1rem !important;
  width: 100% !important;
  max-width: 400px !important;
  margin: 0 auto 1.5rem !important;
}

.hero-buttons .btn {
  width: 100% !important;
  padding: 1.25rem 2rem !important;
  font-size: 1rem !important;
  justify-content: center !important;
}

.hero-features {
  gap: 1rem !important;
  flex-wrap: wrap !important;
}

.feature-item {
  font-size: 0.85rem !important;
  padding: 0.6rem 1rem !important;
  flex: 1 1 auto !important;
  min-width: 140px !important;
}

.scroll-indicator {
  bottom: 1rem !important;
}

.scroll-arrow {
  width: 44px !important;
  height: 44px !important;
}

/* ==========================================================================
   MOBILE SECTIONS & CONTAINERS
   ========================================================================== */

.container {
  padding: 0 1rem !important;
  max-width: 100% !important;
}

.section {
  padding: 3rem 0 !important;
}

.section-header {
  margin-bottom: 2.5rem !important;
  padding: 0 0.5rem !important;
}

.section-title {
  font-size: clamp(2rem, 8vw, 2.5rem) !important;
  margin-bottom: 1rem !important;
  line-height: 1.2 !important;
}

.section-subtitle {
  font-size: clamp(1rem, 4vw, 1.25rem) !important;
  padding: 0 1rem !important;
}

/* ==========================================================================
   MOBILE CARD & GRID LAYOUTS
   ========================================================================== */

.pizza-grid,
.menu-grid,
.deals-grid,
.card-grid,
.values-grid,
.team-grid,
.posts-grid {
  grid-template-columns: 1fr !important;
  gap: 1.5rem !important;
  padding: 0 0.5rem !important;
}

.pizza-card,
.menu-item,
.deal-card,
.card,
.value-card,
.team-member,
.post-card {
  margin-bottom: 1.5rem !important;
  transform: none !important;
}

.featured-pizza,
.featured-deal {
  transform: none !important;
  margin: 0 !important;
}

.pizza-card {
  border-radius: 1.5rem !important;
}

.pizza-info {
  padding: 1.5rem !important;
}

.pizza-name {
  font-size: 1.35rem !important;
  margin-bottom: 0.75rem !important;
}

.pizza-description {
  font-size: 0.95rem !important;
  margin-bottom: 1.25rem !important;
  line-height: 1.6 !important;
}

.pizza-details {
  margin-bottom: 1.25rem !important;
  flex-wrap: wrap !important;
  gap: 0.75rem !important;
}

.pizza-btn,
.deal-btn {
  width: 100% !important;
  padding: 1.125rem 1.75rem !important;
  font-size: 0.95rem !important;
}

/* Menu Items */
.menu-item {
  padding: 1.5rem !important;
}

.menu-item-name {
  font-size: 1.25rem !important;
  margin-bottom: 0.75rem !important;
}

.menu-item-desc {
  font-size: 0.9rem !important;
  margin-bottom: 1rem !important;
  line-height: 1.6 !important;
}

/* Deal Cards */
.deal-card {
  padding: 2rem !important;
}

.deal-title {
  font-size: 1.35rem !important;
}

.deal-description {
  font-size: 0.95rem !important;
  margin-bottom: 1.25rem !important;
}

.deal-badge {
  top: -10px !important;
  right: 10px !important;
  padding: 0.6rem 1.25rem !important;
  font-size: 0.8rem !important;
}

/* ==========================================================================
   MOBILE TYPOGRAPHY
   ========================================================================== */

h1 {
  font-size: clamp(2rem, 8vw, 3rem) !important;
  line-height: 1.2 !important;
  margin-bottom: 1rem !important;
}

h2 {
  font-size: clamp(1.75rem, 7vw, 2.5rem) !important;
  line-height: 1.3 !important;
  margin-bottom: 0.875rem !important;
}

h3 {
  font-size: clamp(1.35rem, 5vw, 1.75rem) !important;
  line-height: 1.4 !important;
  margin-bottom: 0.75rem !important;
}

h4 {
  font-size: clamp(1.15rem, 4vw, 1.35rem) !important;
  line-height: 1.4 !important;
}

p {
  font-size: clamp(0.95rem, 3vw, 1.05rem) !important;
  line-height: 1.6 !important;
  margin-bottom: 1rem !important;
}

.lead {
  font-size: clamp(1.05rem, 4vw, 1.25rem) !important;
  line-height: 1.6 !important;
  margin-bottom: 1.5rem !important;
}

/* ==========================================================================
   MOBILE BUTTONS
   ========================================================================== */

.btn {
  padding: 1rem 1.75rem !important;
  font-size: 0.95rem !important;
  border-radius: 2rem !important;
  min-height: 48px !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
}

.btn-lg {
  padding: 1.125rem 2rem !important;
  font-size: 1rem !important;
  min-height: 52px !important;
}

.btn-xl {
  padding: 1.25rem 2.25rem !important;
  font-size: 1.05rem !important;
  min-height: 56px !important;
}

.btn-block {
  width: 100% !important;
  justify-content: center !important;
}

/* ==========================================================================
   MOBILE FORMS
   ========================================================================== */

.form-group {
  margin-bottom: 1.25rem !important;
}

.form-group label {
  font-size: 0.95rem !important;
  margin-bottom: 0.5rem !important;
  display: block !important;
  font-weight: 600 !important;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100% !important;
  padding: 1rem !important;
  font-size: 1rem !important;
  border-radius: 0.75rem !important;
  border: 2px solid rgba(0, 0, 0, 0.1) !important;
  min-height: 48px !important;
}

.form-group textarea {
  min-height: 120px !important;
  resize: vertical !important;
}

.contact-grid {
  grid-template-columns: 1fr !important;
  gap: 2rem !important;
}

.contact-item {
  margin-bottom: 1.5rem !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 1rem !important;
}

.contact-icon {
  font-size: 1.5rem !important;
  flex-shrink: 0 !important;
}

/* ==========================================================================
   MOBILE MENU FILTER
   ========================================================================== */

.menu-categories {
  flex-wrap: wrap !important;
  gap: 0.75rem !important;
  justify-content: center !important;
  padding: 0 1rem !important;
}

.menu-category {
  padding: 0.75rem 1.25rem !important;
  font-size: 0.9rem !important;
  min-height: 44px !important;
  flex: 1 1 auto !important;
  min-width: 100px !important;
}

/* ==========================================================================
   MOBILE PAGE-SPECIFIC STYLES
   ========================================================================== */

/* Links Page Specific Mobile Fixes */
.links-page-title {
  font-size: clamp(2.5rem, 10vw, 3.5rem) !important;
  margin-bottom: 1.5rem !important;
  line-height: 1.2 !important;
}

.links-page-subtitle {
  font-size: clamp(1.1rem, 4vw, 1.3rem) !important;
  line-height: 1.5 !important;
  margin-bottom: 2rem !important;
}

.link-card {
  padding: 1.5rem !important;
  margin-bottom: 1rem !important;
  border-radius: 1.5rem !important;
  min-height: 80px !important;
}

.link-title {
  font-size: clamp(1.3rem, 5vw, 1.6rem) !important;
  font-weight: 700 !important;
  margin-bottom: 0.5rem !important;
  line-height: 1.3 !important;
}

.link-description {
  font-size: clamp(1rem, 3vw, 1.1rem) !important;
  line-height: 1.5 !important;
  margin: 0 !important;
}

.link-icon {
  width: 70px !important;
  height: 70px !important;
  border-radius: 1.2rem !important;
  margin-right: 1rem !important;
}

.link-icon svg {
  width: 32px !important;
  height: 32px !important;
}

.link-arrow {
  width: 32px !important;
  height: 32px !important;
}

.btn-outline {
  padding: 1.25rem 2.5rem !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  min-height: 56px !important;
  border-radius: 2rem !important;
}

/* Page Hero */
.page-hero {
  padding: 2rem 1rem !important;
  text-align: center !important;
}

.page-title {
  font-size: clamp(2rem, 8vw, 2.5rem) !important;
  margin-bottom: 0.75rem !important;
}

/* About Page */
.two-col {
  grid-template-columns: 1fr !important;
  gap: 2rem !important;
}

.about-story,
.about-values,
.about-team {
  margin-bottom: 3rem !important;
}

/* Contact Page */
.map-wrapper {
  margin-top: 2rem !important;
}

.map-placeholder iframe {
  height: 250px !important;
  border-radius: 1rem !important;
}

/* Footer */
.footer-widgets {
  grid-template-columns: 1fr !important;
  gap: 2rem !important;
  padding: 0 1rem !important;
}

.footer-bottom {
  flex-direction: column !important;
  gap: 1rem !important;
  text-align: center !important;
  padding: 1.5rem 1rem !important;
}

.footer-navigation ul {
  flex-direction: column !important;
  gap: 0.75rem !important;
}

.site-footer {
  padding: 2.5rem 0 1rem !important;
}

/* ==========================================================================
   MOBILE MODALS & OVERLAYS
   ========================================================================== */

.search-modal {
  padding: 1rem !important;
}

.search-modal-content {
  width: 100% !important;
  max-width: none !important;
  margin: 1rem !important;
  border-radius: 1.5rem !important;
}

.search-modal-header {
  padding: 1.25rem !important;
}

.search-modal-body {
  padding: 1.25rem !important;
}

.search-field-enhanced {
  padding: 1rem 1.25rem !important;
  font-size: 1rem !important;
}

/* Cart Sidebar */
.cart-sidebar {
  width: 100% !important;
  max-width: 100% !important;
}

/* ==========================================================================
   MOBILE UTILITIES
   ========================================================================== */

.back-to-top {
  bottom: 1.5rem !important;
  right: 1.5rem !important;
  width: 50px !important;
  height: 50px !important;
  font-size: 1.5rem !important;
}

/* Hide/Show utilities */
.mobile-only {
  display: block !important;
}

.desktop-only {
  display: none !important;
}

/* Text alignment */
.mobile-center {
  text-align: center !important;
}

/* ==========================================================================
   TABLET STYLES (768px+)
   ========================================================================== */

@media (min-width: 768px) {
  body {
    font-size: 16px !important;
  }

  .topbar-content {
    flex-direction: row !important;
    text-align: left !important;
  }

  .contact-info {
    flex-direction: row !important;
    gap: 1.5rem !important;
    width: auto !important;
  }

  .contact-item {
    width: auto !important;
    white-space: nowrap !important;
    font-size: 0.875rem !important;
  }

  .topbar-actions {
    flex-direction: row !important;
    width: auto !important;
  }

  .social-link,
  .order-btn {
    width: auto !important;
  }

  .container {
    padding: 0 2rem !important;
  }

  .section {
    padding: 4rem 0 !important;
  }

  .pizza-grid,
  .menu-grid,
  .deals-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem !important;
  }

  .hero-buttons {
    flex-direction: row !important;
    max-width: none !important;
  }

  .hero-buttons .btn {
    width: auto !important;
    min-width: 180px !important;
  }

  .contact-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .values-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .mobile-only {
    display: none !important;
  }

  .tablet-up {
    display: block !important;
  }
}

/* ==========================================================================
   DESKTOP STYLES (1024px+)
   ========================================================================== */

@media (min-width: 1024px) {
  .container {
    max-width: 1280px !important;
    padding: 0 2rem !important;
  }

  .mobile-menu-toggle {
    display: none !important;
  }

  .nav-menu {
    position: static !important;
    flex-direction: row !important;
    padding: 0 !important;
    background: transparent !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    overflow: visible !important;
  }

  .nav-menu li {
    width: auto !important;
  }

  .nav-menu a {
    width: auto !important;
    padding: 0.75rem 1.25rem !important;
    font-size: 0.95rem !important;
    margin-bottom: 0 !important;
  }

  .header-actions {
    margin-left: auto !important;
  }

  .section {
    padding: 5rem 0 !important;
  }

  .pizza-grid,
  .menu-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 3rem !important;
  }

  .deals-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
  }

  .values-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .team-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .two-col {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .desktop-only {
    display: block !important;
  }
}

/* ==========================================================================
   LARGE DESKTOP STYLES (1440px+)
   ========================================================================== */

@media (min-width: 1440px) {
  .container {
    max-width: 1400px !important;
  }

  .pizza-grid {
    gap: 3.5rem !important;
  }
}

/* ==========================================================================
   ACCESSIBILITY & TOUCH IMPROVEMENTS
   ========================================================================== */

/* Larger touch targets for mobile */
@media (max-width: 768px) {
  a:not(.btn),
  button:not(.btn) {
    padding: 0.5rem !important;
  }

  /* Focus states for keyboard navigation */
  *:focus {
    outline: 3px solid rgba(220, 38, 38, 0.5) !important;
    outline-offset: 2px !important;
  }

  /* Improve text readability on mobile */
  body {
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
  }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
  .header-topbar,
  .mobile-menu-toggle,
  .header-actions,
  .hero-buttons,
  .btn,
  .back-to-top,
  .search-modal,
  .cart-sidebar,
  .site-footer {
    display: none !important;
  }

  body {
    font-size: 12pt !important;
    line-height: 1.5 !important;
  }

  .container {
    max-width: 100% !important;
    padding: 0 !important;
  }
}

/* ==========================================================================
   ORIENTATION SPECIFIC STYLES
   ========================================================================== */

@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    height: auto !important;
    min-height: 100vh !important;
    padding: 2rem 0 !important;
  }

  .hero-content {
    padding: 2rem 1rem !important;
  }
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

/* Hardware acceleration for smooth animations on mobile */
.pizza-card,
.menu-item,
.btn,
.nav-menu {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000px;
  perspective: 1000px;
}

/* Optimize images for mobile */
@media (max-width: 768px) {
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

