/* Apple-inspired Modern CSS with Mobile-First Design */

:root {
  --apple-blue: #0071e3;
  --apple-dark: #111;
  --apple-bg: #f5f5f7;
  --apple-glass: rgba(255,255,255,0.85);
  --apple-radius: 22px;
  --apple-shadow: 0 4px 24px rgba(0,0,0,0.08);
  --mobile-padding: 1rem;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  margin: 0;
  background: var(--apple-bg);
  color: var(--apple-dark);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

/* NAVIGATION BAR - Mobile First */
.apple-navbar {
  background: var(--apple-glass);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.apple-nav {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem var(--mobile-padding);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  height: 44px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--apple-dark);
  text-decoration: none;
  transition: transform 0.18s;
}

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

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  gap: 4px;
  z-index: 101;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--apple-dark);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.nav-links {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--apple-glass);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  list-style: none;
  margin: 0;
  padding: 1rem;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  border-radius: 0 0 16px 16px;
}

.nav-links.mobile-menu-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.nav-links li {
  display: flex;
  margin: 0.25rem 0;
}

.nav-links a {
  color: var(--apple-dark);
  background: transparent;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  transition: all 0.22s;
  width: 100%;
  text-align: center;
}

.nav-links a:hover, .nav-links a:focus {
  background: #f2f2f7;
  color: var(--apple-blue);
  transform: scale(1.02);
}

/* HERO SECTION - Mobile Optimized */
.hero, .apple-hero {
  text-align: center;
  padding: 3rem var(--mobile-padding) 2.5rem;
  background: var(--apple-bg);
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 2rem;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

.apple-btn, button {
  background: linear-gradient(135deg, var(--apple-blue), #005bb5);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  min-height: 44px; /* iOS touch target */
  touch-action: manipulation;
}

.apple-btn:hover, button:hover {
  background: linear-gradient(135deg, #005bb5, #003f8a);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.apple-btn:active, button:active {
  transform: translateY(0);
}

/* PRODUCTS SECTION - Mobile Grid */
.products, .apple-products {
  padding: 2rem var(--mobile-padding);
  background: #fff;
}

.section-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.product-grid, .apple-product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  justify-items: center;
}

.product-card {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 1.5rem;
  border-radius: 24px;
  box-shadow: var(--apple-shadow);
  width: 100%;
  max-width: 320px;
  text-align: center;
  transition: transform 0.25s cubic-bezier(.4,2,.6,1), box-shadow 0.25s;
  animation: fadeIn 0.8s;
}

.product-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0,113,227,0.10);
}

.product-card img, .product-main-img {
  width: 100%;
  max-width: 250px;
  height: 200px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  display: block;
  margin: 0 auto 1rem auto;
  transition: box-shadow 0.2s;
  cursor: pointer;
}

.product-card img:hover, .product-main-img:hover {
  box-shadow: 0 6px 24px rgba(0,113,227,0.12);
}

.product-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0.5rem 0 0.25rem 0;
  color: var(--apple-dark);
  letter-spacing: 0.3px;
}

.product-price {
  color: var(--apple-blue);
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  display: block;
}

/* CART & CONTACT - Mobile Optimized */
.cart, .contact {
  padding: 1.5rem var(--mobile-padding);
  background: #fff;
  border-radius: 20px;
  margin: 1.5rem var(--mobile-padding);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.cart h3, .contact h3 {
  margin-top: 0;
  font-size: 1.4rem;
}

.cart ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.cart li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.contact p {
  font-size: 1.1rem;
  margin: 0.75rem 0;
}

.contact a {
  display: inline-block;
  background: #25d366;
  color: white;
  padding: 0.875rem 1.5rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 1rem;
  transition: background 0.3s;
  min-height: 44px;
  touch-action: manipulation;
}

.contact a:hover {
  background: #20ba5a;
}

/* FOOTER */
.apple-footer {
  background: var(--apple-dark);
  color: #fff;
  text-align: center;
  padding: 2rem var(--mobile-padding);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

/* MODAL - Mobile Optimized */
.img-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; 
  top: 0; 
  width: 100vw; 
  height: 100vh;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  padding: var(--mobile-padding);
}

.img-modal-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #fff;
  padding: 1rem;
  border-radius: 16px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
}

.img-modal-content img {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
  margin: 0 auto;
}

.img-modal-close {
  position: absolute;
  top: 20px;
  right: 25px;
  color: #fff;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ANIMATIONS */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px);}
  to { opacity: 1; transform: translateY(0);}
}

/* RESPONSIVE DESIGN - Tablet and Desktop */
@media (min-width: 768px) {
  .mobile-menu-toggle {
    display: none;
  }
  
  .nav-links {
    position: static;
    flex-direction: row;
    background: transparent;
    box-shadow: none;
    transform: none;
    opacity: 1;
    visibility: visible;
    padding: 0;
    gap: 1rem;
  }
  
  .nav-links a {
    width: auto;
    padding: 0.5rem 1rem;
  }
  
  .hero-title {
    font-size: 3rem;
  }
  
  .hero-subtitle {
    font-size: 1.4rem;
  }
  
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .section-title {
    font-size: 2.2rem;
  }
  
  .cart, .contact {
    max-width: 600px;
    margin: 2rem auto;
  }
  
  .img-modal-content {
    flex-direction: row;
    padding: 1.5rem;
  }
  
  .img-modal-content img {
    max-width: 250px;
    max-height: 70vh;
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .hero-title {
    font-size: 3.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.6rem;
  }
  
  .apple-nav {
    padding: 0.75rem 2rem;
  }
  
  .hero, .apple-hero {
    padding: 4rem 2rem 3rem;
  }
  
  .products, .apple-products {
    padding: 3rem 2rem;
  }
}

@media (min-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Touch and Accessibility Improvements */
@media (hover: none) and (pointer: coarse) {
  .product-card:hover {
    transform: none;
  }
  
  .apple-btn:hover, button:hover {
    transform: none;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .product-card img, .product-main-img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --apple-bg: #1a1a1a;
    --apple-dark: #f5f5f7;
    --apple-glass: rgba(29,29,31,0.85);
  }
  
  body {
    background: var(--apple-bg);
    color: var(--apple-dark);
  }
  
  .products, .apple-products,
  .cart, .contact {
    background: #2a2a2a;
  }
  
  .product-card {
    background: rgba(42,42,46,0.9);
    border-color: rgba(255,255,255,0.1);
  }
}