/* ============================================================
   LensesWear — Responsive Overrides
   Loaded after style.css. Inline styles are beaten with !important.
   ============================================================ */

img { max-width: 100%; }

/* ---------- Product Detail ---------- */
@media (max-width: 1024px) {
  .product-detail { grid-template-columns: 1fr !important; gap: 40px !important; }
  .product-gallery { position: static !important; }
}
@media (max-width: 480px) {
  .product-detail { gap: 32px !important; }
  .product-thumb, .product-thumb img { width: 64px !important; height: 64px !important; }
  .eyesight-inputs { grid-template-columns: 1fr !important; }
  .product-specs > div { flex-wrap: wrap; gap: 4px; }
  .product-specs > div > span:first-child { width: 100% !important; }
}

/* ---------- Cart ---------- */
.cart-layout { grid-template-columns: minmax(0, 1fr) 380px !important; }
.cart-items { min-width: 0; }
.cart-items-header, .cart-item { min-width: 0; }
.cart-summary { min-width: 0; }
#couponForm { min-width: 0; }
#couponForm input { min-width: 0; }
#couponForm button { flex-shrink: 0; white-space: nowrap; }

.cart-summary .btn-primary,
.checkout-summary .btn-primary { justify-content: center; }

@media (max-width: 768px) {
  .cart-actions .btn { padding: 10px 20px; font-size: 0.8rem; }
  .cart-summary .btn-primary,
  .checkout-summary .btn-primary { padding: 12px 20px; font-size: 0.8rem; }
}

@media (max-width: 1024px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr) !important; gap: 24px !important; }
  .cart-summary { position: static !important; }
}
@media (max-width: 1024px) {
  .cart-items-header { display: none !important; }
  .cart-item { grid-template-columns: 1fr !important; gap: 12px !important; position: relative !important; padding: 24px 0 !important; align-items: stretch !important; }
  .cart-item-main { padding-right: 28px; min-width: 0; flex-wrap: wrap; gap: 12px; }
  .cart-item-main > div { flex: 1 1 0; min-width: 0; }
  .cart-item-main h4,
  .cart-item-main p { overflow-wrap: break-word; word-break: break-word; }
  .cart-item-price,
  .cart-item-total { display: flex !important; justify-content: space-between !important; align-items: center !important; text-align: left !important; font-weight: 600; min-width: 0; }
  .cart-item-price::before,
  .cart-item-total::before { content: attr(data-label); color: var(--text-light); font-size: 0.85rem; font-weight: 400; }
  .cart-item-qty { display: flex !important; justify-content: flex-end !important; align-items: center !important; gap: 8px; }
  .cart-item-qty::before { content: attr(data-label); margin-right: auto; color: var(--text-light); font-size: 0.85rem; font-weight: 400; }
  .cart-item-remove { position: absolute !important; top: 12px !important; right: 0 !important; }
}

/* ---------- Checkout ---------- */
@media (max-width: 1024px) {
  .checkout-grid { grid-template-columns: 1fr !important; gap: 24px !important; }
  .checkout-summary { position: static !important; }
}
@media (max-width: 480px) {
  .checkout-field-row { grid-template-columns: 1fr !important; }
}

/* ---------- Contact ---------- */
@media (max-width: 768px) {
  .contact-cards { grid-template-columns: 1fr !important; gap: 16px !important; margin-bottom: 40px !important; }
  .contact-form-row { grid-template-columns: 1fr !important; }
}

/* ---------- About ---------- */
@media (max-width: 768px) {
  .about-values { grid-template-columns: 1fr !important; }
}

/* ---------- Shop: mobile full-screen filter modal ---------- */
.shop-filter-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 0px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
}
.shop-sidebar-header { display: none; }

@media (max-width: 768px) {
  .shop-filter-toggle { display: inline-flex; }
  .shop-sidebar {
    position: fixed !important;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100% !important;
    height: 100%;
    background: var(--white);
    z-index: 9999;
    overflow-y: auto;
    padding: 24px 20px 40px;
    display: block !important;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  .shop-sidebar.open { transform: translateX(0); }
  .shop-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
  }
  .shop-sidebar-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
  }
  .shop-sidebar-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: none;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .shop-sidebar-close:hover { border-color: var(--gold); color: var(--gold); }
}

/* ---------- Shop: toolbar stacks on mobile ---------- */
@media (max-width: 768px) {
  .shop-toolbar-right {
    flex-wrap: wrap;
    width: 100%;
    gap: 10px;
  }
  .shop-filter-toggle { flex: 1 1 100%; justify-content: start; }
  .shop-toolbar-right label { margin-right: auto; }
  .shop-sort { flex: 1 1 auto; }
}

/* ---------- Service Bar: marquee only on tablet & mobile ---------- */
.service-bar-track .service-bar-inner[aria-hidden="true"] { display: none; }

@media (max-width: 1024px) {
  .service-bar { overflow: hidden; }
  .service-bar-track {
    display: flex;
    width: max-content;
    animation: serviceMarquee 30s linear infinite;
  }
  .service-bar:hover .service-bar-track { animation-play-state: paused; }
  .service-bar-inner {
    display: flex !important;
    grid-template-columns: none !important;
    width: max-content;
    flex-shrink: 0;
  }
  .service-bar-item { white-space: nowrap; }
}

@keyframes serviceMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .service-bar-track { animation: none; }
}

/* ---------- Home: fine-tuning ---------- */
@media (max-width: 480px) {
  .section-card-image img { max-height: 220px; }
  .cart-item-main img { width: 60px !important; height: 60px !important; }
  .hero-features {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    margin-top: 28px;
  }
  .hero-feature-item {
    flex-direction: column !important;
    gap: 6px;
    text-align: center;
    justify-content: center;
  }
  .hero-feature-icon { width: 30px; height: 30px; }
  .hero-feature-icon svg { width: 24px; height: 24px; }
  .hero-feature-title { font-size: 0.72rem; }
  .hero-feature-sub { font-size: 0.66rem; }
}
