/**
 * AMICO Online Shop - Responsive Design & Luxury Mobile Experience
 * Specially optimized for iPhone (390px), Android (360px), iPad (768px/1024px) & Retina screens
 */

/* ==========================================================================
   MOBILE NAVIGATION DRAWER
   ========================================================================== */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 85%;
  max-width: 350px;
  height: 100%;
  background-color: var(--color-midnight-navy);
  color: var(--color-warm-ivory);
  z-index: 1051;
  box-shadow: 15px 0 50px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 420ms var(--ease-luxury);
  padding: 1.75rem 1.5rem;
  border-right: 1px solid rgba(197, 164, 109, 0.25);
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(197, 164, 109, 0.25);
}

.mobile-nav-close {
  color: var(--color-warm-ivory);
  font-size: 1.75rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all var(--transition-fast);
}

.mobile-nav-close:hover {
  background: var(--color-champagne-gold);
  color: var(--on-gold);
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem 0;
  flex: 1;
  overflow-y: auto;
}

.mobile-nav-link {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  color: var(--color-warm-ivory);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-transform: capitalize;
  transition: all var(--transition-fast);
  padding: 0.25rem 0;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--color-champagne-gold);
  transform: translateX(6px);
}

.mobile-nav-footer {
  border-top: 1px solid rgba(197, 164, 109, 0.25);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: rgba(245, 241, 232, 0.75);
}

.mobile-nav-footer a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color var(--transition-fast);
}

.mobile-nav-footer a:hover {
  color: var(--color-champagne-gold);
}

/* ==========================================================================
   STICKY MOBILE BOTTOM BAR (PRODUCT DETAIL PAGE)
   ========================================================================== */
.mobile-sticky-action-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(197, 164, 109, 0.3);
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  z-index: 95;
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.08);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.mobile-bar-price-info {
  display: flex;
  flex-direction: column;
}

.mobile-bar-price-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.mobile-bar-price-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.mobile-bar-cta {
  flex: 1;
  max-width: 220px;
}

/* ==========================================================================
   TABLET BREAKPOINT (max-width: 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .main-nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: var(--text-primary);
    border-radius: 50%;
    transition: background-color var(--transition-fast);
  }

  .mobile-menu-toggle:hover {
    background-color: var(--surface-raised);
  }

  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .category-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .brands-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .express-features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }

  .brand-story-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .promo-banner-grid {
    grid-template-columns: 1fr;
  }

  .promo-banner-media {
    min-height: 280px;
  }
}

/* ==========================================================================
   MOBILE BREAKPOINT (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  :root {
    --header-height: 72px;
  }

  /* App-like Header */
  .site-header {
    background-color: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(197, 164, 109, 0.25);
  }

  .brand-logo-img {
    width: 38px;
    height: 38px;
  }

  .brand-name {
    font-size: 1.35rem;
  }

  .brand-subtitle {
    font-size: 0.6rem;
    letter-spacing: 0.22em;
  }

  /* Mobile Hero */
  .hero-section {
    min-height: 76vh;
    padding: 3rem 0;
  }

  .hero-content {
    padding: 2.5rem 1rem;
  }

  .hero-badge {
    font-size: 0.68rem;
    padding: 0.35rem 1rem;
    letter-spacing: 0.18em;
  }

  .hero-title {
    font-size: 2.35rem;
    line-height: 1.15;
    margin-bottom: 1rem;
  }

  .hero-description {
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 2rem;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

  .hero-cta-group .btn {
    width: 100%;
    padding: 0.95rem;
  }

  /* Mobile Product Grid */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  .product-card {
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  }

  .product-card-content {
    padding: 0.85rem;
  }

  .product-card-title {
    font-size: 1.05rem;
    line-height: 1.25;
    margin-bottom: 0.35rem;
  }

  .product-card-brand {
    font-size: 0.65rem;
  }

  .product-card-current-price {
    font-size: 1.05rem;
  }

  /* Quick view stays available on touch: compact round icon button */
  .product-card-overlay-actions {
    opacity: 1;
    transform: none;
    left: auto;
    right: 8px;
    bottom: 8px;
  }

  .quick-view-btn {
    flex: none;
    width: 38px;
    height: 38px;
    padding: 0;
    font-size: 0; /* hides the text label, keeps the icon */
    gap: 0;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  }

  .quick-view-btn svg {
    width: 18px;
    height: 18px;
  }

  /* No sticky hover-lift on touch */
  .product-card:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border-color: var(--color-border-light);
  }

  .product-card:hover .product-card-img {
    transform: none;
  }

  /* Mobile Categories */
  .category-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .category-card {
    padding: 1.1rem;
    aspect-ratio: 1/1;
    border-radius: var(--border-radius);
  }

  .category-card-name {
    font-size: 1.25rem;
  }

  .category-card-action {
    font-size: 0.68rem;
  }

  /* Mobile Brands */
  .brands-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .brand-showcase-card {
    padding: 1.5rem;
  }

  /* Express Strip */
  .express-features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Announcement Bar Mobile Tuning */
  .announcement-bar {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    padding: 0.55rem 0.75rem;
    line-height: 1.35;
    text-align: center;
  }

  .announcement-content {
    justify-content: center;
    text-align: center;
    width: 100%;
  }

  /* Promo Campaign Banner Mobile Optimization */
  .promo-campaign-banner {
    border-radius: var(--border-radius);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(197, 164, 109, 0.35);
  }

  .promo-banner-grid {
    grid-template-columns: 1fr;
  }

  .promo-banner-content {
    padding: 2.25rem 1.5rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .promo-banner-content h2 {
    font-size: clamp(1.75rem, 5.5vw, 2.25rem);
    line-height: 1.22;
    margin-bottom: 0.85rem;
    color: var(--color-warm-ivory);
    font-family: var(--font-heading);
    font-weight: 600;
    text-wrap: balance;
  }

  .promo-banner-content p {
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 1.5rem;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
    color: rgba(245, 241, 232, 0.9);
    text-wrap: pretty;
  }

  .promo-banner-actions {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .promo-banner-btn {
    width: 100%;
    max-width: 280px;
    padding: 0.95rem 1.75rem;
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-align: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(197, 164, 109, 0.25);
  }

  .promo-banner-media {
    position: relative;
    width: 100%;
    height: 240px;
    min-height: 240px;
    max-height: 280px;
    border-top: 1px solid rgba(197, 164, 109, 0.22);
    overflow: hidden;
  }

  .promo-banner-media::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5) 0%, transparent 40%, rgba(0, 0, 0, 0.35) 100%);
    z-index: 1;
    pointer-events: none;
  }

  .promo-banner-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  /* Sticky Mobile Bar on Product Detail */
  .mobile-sticky-action-bar {
    display: flex;
  }

  /* Product Details Layout */
  .product-main-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .product-gallery-sticky {
    position: static;
  }

  .product-page-title {
    font-size: 1.85rem;
  }

  .product-main-price {
    font-size: 1.65rem;
  }

  .product-actions-bar {
    flex-direction: column;
  }

  .product-actions-bar .qty-counter {
    width: 100%;
    justify-content: space-between;
  }

  /* Modals & Drawers */
  .cart-drawer {
    max-width: 100%;
  }

  /* Quick view becomes a bottom sheet */
  .modal-dialog {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: none;
    max-height: 88vh;
    max-height: 88dvh;
    padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    transform: translateY(100%);
  }

  .modal-dialog.open {
    transform: translateY(0);
  }

  .modal-close-btn {
    margin: 0 0 -40px auto;
    top: 0;
  }

  .quick-view-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
  }

  .quick-view-gallery {
    aspect-ratio: 1 / 1;
    max-height: 38vh;
    width: 100%;
  }

  .quick-view-title {
    font-size: 1.5rem;
    padding-right: 0.5rem;
  }

  .quick-view-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
  }

  .quick-view-actions {
    gap: 0.6rem;
    align-items: stretch;
  }

  .quick-view-actions .btn {
    padding: 0.8rem 0.75rem;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
  }

  .quantity-stepper button {
    width: 38px;
    height: 100%;
    min-height: 48px;
  }

  /* Product detail page */
  .product-detail-container {
    padding-top: 1.25rem;
    padding-bottom: 3.5rem;
  }

  .product-breadcrumbs {
    flex-wrap: wrap;
    row-gap: 0.15rem;
    margin-bottom: 1.25rem;
    font-size: 0.75rem;
  }

  .product-main-image-wrap {
    aspect-ratio: 1 / 1;
    cursor: default;
  }

  .product-rating-row {
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
    margin-bottom: 1rem;
  }

  .product-price-section {
    flex-wrap: wrap;
    gap: 0.4rem 0.85rem;
    padding-bottom: 1.1rem;
    margin-bottom: 1.25rem;
  }

  .product-description-text {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
  }

  .variant-pill {
    height: 44px; /* comfortable tap target */
  }

  .product-actions-bar {
    gap: 0.75rem;
  }

  .product-actions-bar .btn {
    width: 100%;
    white-space: normal;
  }

  .qty-counter button {
    width: 52px;
  }

  .qty-counter span {
    flex: 1;
  }

  .express-delivery-guarantee-card {
    padding: 1rem;
  }

  .guarantee-row {
    align-items: flex-start;
    line-height: 1.5;
  }

  .product-tabs-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
  }

  .tabs-nav {
    gap: 1.5rem;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .tabs-nav::-webkit-scrollbar {
    display: none;
  }

  .tab-nav-btn {
    font-size: 1.1rem;
    flex-shrink: 0;
  }

  .specs-table td {
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
    vertical-align: top;
  }

  .specs-table td:first-child {
    width: 38%;
  }

  .reviews-head {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }

  .cart-page-grid {
    grid-template-columns: 1fr;
  }

  .cart-table-header {
    display: none;
  }

  .cart-table-row {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .cart-row-total {
    text-align: left;
  }
}

/* ==========================================================================
   SMALL MOBILE BREAKPOINT (max-width: 390px)
   ========================================================================== */
@media (max-width: 480px) {
  /* Header would overflow at 360px: track-order lives in the menu drawer anyway */
  .header-actions a.header-action-btn[href="track-order.html"] {
    display: none;
  }

  .header-action-btn,
  .mobile-menu-toggle {
    width: 40px;
    height: 40px;
  }

  .brand-subtitle {
    letter-spacing: 0.14em;
  }
}

@media (max-width: 390px) {
  .brand-name {
    font-size: 1.25rem;
  }

  .brand-logo-img {
    width: 34px;
    height: 34px;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .announcement-bar {
    font-size: 0.65rem;
    letter-spacing: 0.03em;
    padding: 0.5rem 0.5rem;
  }

  .promo-banner-content {
    padding: 1.75rem 1.15rem 1.35rem;
  }

  .promo-banner-content h2 {
    font-size: 1.55rem;
    line-height: 1.24;
    margin-bottom: 0.75rem;
  }

  .promo-banner-content p {
    font-size: 0.88rem;
    line-height: 1.58;
    margin-bottom: 1.25rem;
  }

  .promo-banner-btn {
    max-width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 0.82rem;
  }

  .promo-banner-media {
    height: 200px;
    min-height: 200px;
  }

  .products-grid {
    gap: 0.65rem;
  }

  .product-card-title {
    font-size: 0.95rem;
  }

  .product-card-badge {
    top: 8px;
    left: 8px;
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
  }
}

/* ==========================================================================
   REDUCED MOTION SUPPORT
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-background-img {
    animation: none !important;
    transform: none !important;
  }
}
