/* ===== MOBILE MENU ===== */
.hamburger-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  z-index: 60;
}
.hamburger-btn span {
  width: 20px; height: 1.5px;
  background: #fff;
  transition: transform 0.3s, opacity 0.3s, background 0.3s;
}
.header:hover .hamburger-btn span,
.header.scrolled .hamburger-btn span { background: #111; }

.hamburger-btn.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 5px); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -5px); }

.mobile-menu-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,0.5);
  opacity: 0; visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s, visibility 0.35s;
}
.mobile-menu-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

.mobile-menu {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 320px; max-width: 85vw;
  background: #fff; color: #111;
  z-index: 9999;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.mobile-menu-overlay.open .mobile-menu { transform: translateX(0); }

.mobile-menu-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid #eee;
}
.mobile-menu-header img { height: 32px; filter: invert(1) brightness(1.1); }
.mobile-menu-close {
  background: none; border: none; cursor: pointer; color: #111;
  display: flex; padding: 4px;
}

.mobile-menu-nav { padding: 16px 0; flex: 1; }

.mobile-nav-item { border-bottom: 1px solid #f0f0f0; }

.mobile-nav-link {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px; font-weight: 500; letter-spacing: 1.8px;
  color: #111; text-decoration: none;
  cursor: pointer; background: none; border: none; width: 100%;
  text-align: left;
}
.mobile-nav-link svg { transition: transform 0.3s; color: #999; }
.mobile-nav-link.open svg { transform: rotate(180deg); }

.mobile-submenu {
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s ease;
  background: #fafafa;
}
.mobile-submenu.open { max-height: 600px; }

.mobile-submenu-heading {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-size: 14px; font-weight: 400;
  color: #999; padding: 12px 32px 4px;
}

.mobile-submenu a {
  display: block; padding: 10px 32px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px; color: #555; text-decoration: none;
  transition: color 0.2s;
}
.mobile-submenu a:hover { color: #111; }

.mobile-menu-footer {
  padding: 24px; border-top: 1px solid #eee;
  display: flex; flex-direction: column; gap: 20px;
}

.mobile-menu-footer a {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px; color: #111; text-decoration: none;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-footer a svg {
  color: #999;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 900px) {
  .hamburger-btn { display: flex; }

  /* Header adjustments */
  .header { padding: 12px 16px 12px; }
  .header.scrolled { padding: 12px 16px; }
  
  .header-left, .header-right { 
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 0;
  }
  
  .header-right { justify-content: flex-end; }

  /* Hide search and location in main header on mobile */
  #search-btn, #location-btn, #home-btn { display: none !important; }

  .header-center { 
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .logo img { 
    height: 30px; /* Smaller logo */
    max-width: 140px;
    object-fit: contain;
  }
  
  .header.scrolled .logo { display: block; }
  .header.scrolled .logo img { height: 26px; }

  /* Hero */
  .hero-title { font-size: clamp(28px, 7vw, 48px); }
  .hero-cta { padding: 14px 32px; font-size: 11px; }

  /* Categories */
  .category-section { padding: 48px 16px 56px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .category-label { font-size: 11px; letter-spacing: 1px; }

  /* Carousel */
  .carousel-section { padding: 40px 0 50px; }
  .carousel-track { padding: 0 16px; gap: 16px; }
  .carousel-item { flex: 0 0 160px; }
  .carousel-img { width: 160px; height: 160px; }
  .carousel-name { font-size: 11px; }
  .carousel-desc { font-size: 10px; }
  .carousel-controls { padding: 0 16px; gap: 12px; margin-top: 24px; }
  .carousel-progress { width: 140px; }

  /* Article */
  .article-wrap { flex-direction: column; }
  .article-img { flex: none; }
  .article-content { padding: 40px 20px; }
  .article-title { font-size: clamp(22px, 5vw, 32px); }
  .article-text { font-size: 13px; }

  /* Jewelry page */
  .jewelry-page { padding: 80px 16px 60px; }
  .jewelry-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
  .jewelry-page-title { font-size: clamp(28px, 6vw, 42px); }
  .jewelry-header { margin-bottom: 32px; }

  /* Product page */
  .product-detail { grid-template-columns: 1fr; gap: 32px; padding: 80px 16px 40px; }
  .product-gallery { position: static; }
  .product-thumbs { gap: 8px; }
  .product-thumb { width: 64px; height: 64px; }
  .product-detail-name { font-size: clamp(24px, 5vw, 36px); }
  .product-info { padding-top: 0; }

  .also-like-section { padding: 40px 16px 60px; }
  .also-like-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .also-like-title { font-size: clamp(22px, 5vw, 32px); margin-bottom: 24px; }

  /* Footer */
  .site-footer { padding: 40px 16px 0; }
  .footer-main { grid-template-columns: 1fr; gap: 28px; padding-bottom: 32px; }
  .footer-brand p { max-width: 100%; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; padding: 20px 0; }
}

@media (max-width: 400px) {
  .category-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .jewelry-grid { gap: 16px 8px; }
  .product-name, .product-detail-price { font-size: 12px; }
  .cart-drawer { width: 100vw; max-width: 100vw; }
}

/* ===== CHECKOUT MOBILE ===== */
@media (max-width: 900px) {
  /* Show back arrow on checkout, hide it on desktop */
  .checkout-back-btn { display: flex !important; align-items: center; color: #111; }

  /* Checkout grid stacks */
  .checkout-grid { flex-direction: column; }
  .checkout-main, .checkout-sidebar { width: 100%; }
  .checkout-sidebar { order: -1; } /* Show summary first on mobile */

  /* Checkout form padding */
  .checkout-container { padding: 16px; }
  .checkout-section { padding: 20px 0; }
  .input-grid { grid-template-columns: 1fr; }

  /* Place order button */
  .place-order-btn { width: 100%; font-size: 12px; padding: 16px; }

  /* Order summary card */
  .order-summary-card { padding: 20px 16px; }
}

/* ===== iOS SPECIFIC FIXES ===== */
/* Prevent horizontal scroll — on body only, NOT html (html overflow:hidden breaks macOS Chrome scroll routing) */
body { overflow-x: hidden; -webkit-text-size-adjust: 100%; }

/* Fix input zoom on iOS (inputs need 16px to not trigger zoom) */
@media (max-width: 900px) {
  input, select, textarea {
    font-size: 16px !important;
  }
  /* But keep small font on admin form labels */
  .form-label { font-size: 12px !important; }
}


/* ===== NEW FEATURES MOBILE (Shop the Look, Login, Look Modal) ===== */

/* ── Login Page ── */
@media (max-width: 768px) {
  /* login.html is self-contained but add safety styles */
  body.login-page {
    padding: 0;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ── Shop the Look Section (Homepage) ── */
@media (max-width: 900px) {
  .shop-look-section {
    padding: 16px 20px 40px;
    max-width: 100%;
  }
  .shop-look-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .shop-look-img-wrap {
    aspect-ratio: 3 / 4;
  }
  .shop-look-title {
    font-size: 13px;
  }
  .shop-look-btn {
    font-size: 10px;
    letter-spacing: 1.5px;
  }
  .shop-look-info {
    padding: 10px 0 0;
    gap: 6px;
  }
}

@media (max-width: 540px) {
  .shop-look-section {
    padding: 12px 12px 32px;
  }
  .shop-look-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .shop-look-img-wrap {
    aspect-ratio: 4 / 5;
  }
  .shop-look-title {
    font-size: 12px;
  }
  .shop-look-btn {
    font-size: 9px;
    letter-spacing: 1px;
  }
}

@media (max-width: 380px) {
  .shop-look-img-wrap {
    aspect-ratio: 1 / 1;
  }
}

/* ── Shop the Look Modal ── */
@media (max-width: 768px) {
  #look-modal > div {
    flex-direction: column !important;
    height: 100dvh;
    overflow-y: auto;
  }
  #look-modal > div > div:first-child {
    width: 100% !important;
    height: 50vw;
    min-height: 220px;
    max-height: 340px;
    flex-shrink: 0;
  }
  #look-modal > div > div:last-child {
    flex: 1;
    padding: 24px 20px 40px !important;
    overflow-y: visible;
  }
  #look-modal h2 {
    font-size: 18px !important;
    margin-bottom: 20px !important;
  }
  #look-modal-products {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }
  #look-modal-close {
    top: 12px !important;
    left: auto !important;
    right: 16px !important;
    transform: none !important;
  }
  #look-modal {
    transform: translateY(100%);
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                visibility 0s linear 0.45s !important;
  }
  #look-modal.look-open {
    transform: translateY(0) !important;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                visibility 0s linear 0s !important;
  }
}

@media (max-width: 400px) {
  #look-modal-products {
    grid-template-columns: 1fr !important;
  }
  #look-modal > div > div:first-child {
    height: 40vw;
    min-height: 180px;
  }
}

/* ── Mobile Home Button ── */
.mobile-home-btn {
  display: none; /* hidden on desktop */
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text, #1a1a1a);
  text-decoration: none;
  margin-left: 4px;
  flex-shrink: 0;
}
.mobile-home-btn:hover { color: #c8a96e; }
@media (max-width: 768px) {
  .mobile-home-btn { display: flex; }
}
