/* ============================================
   PPV MOBILE RESPONSIVE
   Complete mobile-first responsive overrides
   ============================================ */

/* ============================================
   MOBILE NAV DRAWER
   ============================================ */

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: var(--space-1);
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.mobile-nav.open {
  max-height: 400px;
  padding: var(--space-3) 0 var(--space-4);
}

.mobile-nav-link {
  display: block;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-lg);
  transition: all 0.15s ease;
  text-decoration: none;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background: var(--surface-elevated);
  color: var(--cyan-400);
}

.mobile-menu-toggle {
  display: none !important;
}

.mobile-menu-toggle.active svg line:nth-child(1) {
  transform: rotate(45deg) translate(5px, -3px);
  transform-origin: center;
}
.mobile-menu-toggle.active svg line:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.active svg line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, 3px);
  transform-origin: center;
}

/* ============================================
   TABLET (max 1024px)
   ============================================ */

@media (max-width: 1024px) {
  .mobile-menu-toggle {
    display: flex !important;
  }

  .mobile-nav {
    display: flex;
  }

  /* Header: hide currency on smaller tablets */
  .currency-selector {
    display: none;
  }

  /* Hero: single column */
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  /* Categories grid */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Quality steps */
  .quality-steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   MOBILE (max 768px)
   ============================================ */

@media (max-width: 768px) {
  /* Base font slightly smaller */
  html {
    font-size: 16px;
  }

  /* Header adjustments */
  .header-inner {
    min-height: 56px;
    padding: var(--space-1) 0;
  }

  .logo-tagline {
    display: none;
  }

  .logo-mark {
    width: 36px;
    height: 36px;
  }

  .logo-name {
    font-size: var(--text-md);
  }

  /* Lang toggle smaller */
  .lang-toggle {
    gap: 1px !important;
  }

  .pp-lang-btn {
    padding: 3px 5px !important;
    font-size: 10px !important;
  }

  /* Product detail page */
  .pdp-layout {
    grid-template-columns: 1fr !important;
    gap: var(--space-6);
  }

  .pdp-gallery {
    position: static !important;
  }

  .pdp-main-image {
    aspect-ratio: 4/3;
    max-height: 280px;
  }

  /* Key facts grid */
  .key-facts {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-3);
  }

  /* Trust badges row on product pages - wrap */
  .pdp-layout [style*="display:flex"][style*="gap:var(--space-6)"] {
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  /* Hero section */
  .hero {
    padding: var(--space-10) 0;
  }

  .hero-title {
    font-size: var(--text-3xl) !important;
  }

  .hero-subtitle {
    font-size: var(--text-md);
  }

  .hero-visual {
    height: 250px;
  }

  /* Stats grid */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .counter-value {
    font-size: var(--text-3xl);
  }

  /* Section spacing */
  .section {
    padding: var(--space-12) 0;
  }

  .section-lg {
    padding: var(--space-16) 0;
  }

  .section-header {
    margin-bottom: var(--space-8);
  }

  .section-title {
    font-size: var(--text-2xl);
  }

  .section-description {
    font-size: var(--text-md);
  }

  /* Footer */
  .footer {
    padding: var(--space-10) 0 var(--space-6);
    margin-top: var(--space-12);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .footer-brand-description {
    max-width: none;
  }

  /* Page hero */
  .page-hero {
    padding: var(--space-10) 0 var(--space-6);
  }

  .page-hero h1 {
    font-size: var(--text-2xl);
  }

  /* Accordion */
  .accordion-header h3 {
    font-size: var(--text-md);
  }

  /* Buttons */
  .btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-sm);
  }

  /* About page grid-3: single column on mobile */
  .grid-3 {
    grid-template-columns: 1fr !important;
    gap: var(--space-3);
  }

  /* Product cards grid - 2 columns on tablet */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-3);
  }

  .product-card {
    padding: var(--space-3);
  }

  .product-name {
    font-size: var(--text-sm);
  }

  .product-price {
    font-size: var(--text-lg);
  }

  .product-image {
    aspect-ratio: 1;
  }

  .product-category {
    font-size: var(--text-xs);
  }

  .product-card .btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    white-space: nowrap;
  }

  .product-variant-selector {
    display: none;
  }

  .product-description {
    display: none;
  }

  .product-tags {
    display: none;
  }

  /* Shop filter */
  .filter-topbar {
    border-radius: var(--radius-lg);
  }

  .filter-topbar-row {
    padding: var(--space-3) var(--space-4);
  }
}

/* ============================================
   SMALL MOBILE (max 480px)
   ============================================ */

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  :root {
    --container-padding: var(--space-3);
  }

  /* Header */
  .header-inner {
    gap: var(--space-2);
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .header-actions {
    gap: var(--space-2);
  }

  /* Search button stays visible on small screens */
  #pp-search-btn {
    display: flex;
  }

  /* Hero */
  .hero {
    padding: var(--space-8) 0;
  }

  .hero-title {
    font-size: var(--text-2xl) !important;
  }

  .hero-subtitle {
    font-size: var(--text-sm);
  }

  .hero-visual {
    height: 200px;
    display: none;
  }

  /* About page grid-3: single column on small phones */
  .grid-3 {
    grid-template-columns: 1fr !important;
    gap: var(--space-2);
  }

  /* Generic grids stay 2x2 on small phones (use-case, quality cards) */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-2);
  }

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

  /* Compact use-case / generic cards on mobile */
  .grid-4 > .card,
  .grid-4 > a.card {
    padding: var(--space-3);
  }

  .grid-4 > .card .product-image,
  .grid-4 > a.card .product-image {
    aspect-ratio: 3/2;
    min-height: 0;
  }

  .grid-4 > .card h3,
  .grid-4 > a.card h3 {
    font-size: var(--text-sm) !important;
    margin-bottom: 2px;
  }

  .grid-4 > .card p,
  .grid-4 > a.card p {
    font-size: 10px !important;
    line-height: 1.3;
  }

  /* Landing page bestseller: 2 per row */
  #top-products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-2);
  }

  /* Shop page: 3 per row */
  #pp-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: var(--space-2);
  }

  /* Compact product cards on small phones */
  .product-card {
    padding: var(--space-2);
  }

  .product-card .product-image {
    aspect-ratio: 1;
    min-height: 0;
  }

  .product-card .product-category {
    font-size: 8px;
  }

  .product-card .product-name {
    font-size: 10px;
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }

  .product-card .product-price {
    font-size: var(--text-sm);
  }

  .product-card .btn {
    padding: 3px 6px;
    font-size: 9px;
    white-space: nowrap;
  }

  .product-variant-selector {
    display: none;
  }

  .product-description {
    display: none;
  }

  .product-tags {
    display: none;
  }

  .product-actions-stacked .btn-cart-full {
    padding: 3px 6px;
    font-size: 9px;
  }

  /* Product detail */
  .pdp-main-image {
    max-height: 220px;
  }

  h1 {
    font-size: var(--text-2xl) !important;
  }

  /* Key facts single column */
  .key-facts {
    grid-template-columns: 1fr !important;
  }

  /* Price row stacked */
  .product-price-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  /* Categories grid single column */
  .categories-grid {
    grid-template-columns: 1fr !important;
  }

  /* Trust items */
  .trust-items {
    grid-template-columns: 1fr !important;
    gap: var(--space-3);
  }

  .trust-item {
    padding: var(--space-3);
  }

  /* Quality steps single */
  .quality-steps {
    grid-template-columns: 1fr !important;
  }

  /* Cookie banner */
  .cookieBanner {
    padding: var(--space-3) var(--space-4);
  }

  .cookieInner {
    gap: var(--space-3);
  }

  .cookieActions {
    flex-direction: column;
    width: 100%;
  }

  .cookieActions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Disclaimer */
  .disclaimer {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-xs);
  }

  /* Footer */
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: var(--space-3);
  }

  .footer-legal {
    flex-direction: column;
    gap: var(--space-2);
  }

  /* Exit intent popup */
  .exit-intent-popup {
    padding: var(--space-5) var(--space-3) !important;
    max-width: calc(100vw - 32px);
  }

  .exit-intent-message {
    font-size: var(--text-md) !important;
  }
}

/* ============================================
   VERY SMALL (max 360px) - older/smaller phones
   ============================================ */

@media (max-width: 360px) {
  html {
    font-size: 14px;
  }

  :root {
    --container-padding: var(--space-2);
  }

  .logo-name {
    font-size: var(--text-sm);
  }

  .hero-title {
    font-size: var(--text-xl) !important;
  }

  .btn {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
  }

  .btn-lg {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
  }
}

/* ============================================
   LANDSCAPE PHONES
   ============================================ */

@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: var(--space-6) 0;
  }

  .hero-visual {
    display: none;
  }

  .hero-title {
    font-size: var(--text-2xl) !important;
  }

  .section {
    padding: var(--space-8) 0;
  }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */

@media (hover: none) and (pointer: coarse) {
  /* Larger tap targets */
  .nav-link,
  .mobile-nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .btn {
    min-height: 44px;
  }

  .icon-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .accordion-header {
    min-height: 48px;
    padding: var(--space-3) var(--space-4);
  }

  .filter-toggle-btn {
    min-height: 44px;
  }

  /* Remove hover effects on touch */
  .card:hover,
  .product-card:hover,
  .trust-item:hover {
    transform: none;
  }

  .btn-primary:hover {
    transform: none;
  }

  .btn-secondary:hover {
    transform: none;
  }
}

/* ============================================
   SAFE AREA (notch/home indicator)
   ============================================ */

@supports (padding: env(safe-area-inset-bottom)) {
  .footer {
    padding-bottom: calc(var(--space-8) + env(safe-area-inset-bottom));
  }

  .cookieBanner {
    padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
  }

  .header {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}
