/* ===================================
   RESPONSIVE STYLES - FINAL CLEAN VERSION
   Complete responsive breakpoints and mobile menu
   @package aaapos-prime
   @since 1.0.0
   =================================== */

/* ===================================
   MOBILE MENU TOGGLE BUTTON
   =================================== */
.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: var(--space-2);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
  width: 40px;
  height: 40px;
  position: relative;
}

@media (min-width: 1024px) {
  .mobile-menu-toggle {
    display: none;
  }
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--color-text);
  transition: all 0.3s ease;
  border-radius: 2px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.mobile-menu-toggle span:nth-child(1) {
  top: 10px;
}

.mobile-menu-toggle span:nth-child(2) {
  top: 18.5px;
}

.mobile-menu-toggle span:nth-child(3) {
  top: 27px;
}

/* Active state - Transform to X */
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
  top: 18.5px;
  transform: translateX(-50%) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: translateX(-50%) scale(0);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
  top: 18.5px;
  transform: translateX(-50%) rotate(-45deg);
}

/* ===================================
   MOBILE STYLES (max-width: 767px)
   =================================== */
@media (max-width: 767px) {
  /* Section adjustments */
  .section {
    padding: var(--space-8) 0;
  }

  .section-title {
    font-size: var(--text-2xl);
  }

  /* Header mobile adjustments */
  .header-actions {
    gap: var(--space-2);
  }

  .header-action {
    padding: var(--space-1);
  }

  /* Hero mobile */
  .hero-section {
    min-height: 400px;
  }

  .hero-title {
    font-size: var(--text-2xl);
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .hero-button {
    width: 100%;
    max-width: 280px;
  }

  /* Grid adjustments */
  .products-grid,
  .categories-grid,
  .blog-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  /* Footer mobile */
  .footer-widgets-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom-inner {
    text-align: center;
  }

  /* WooCommerce mobile */
  .woocommerce-cart-form .shop_table {
    display: block;
    overflow-x: auto;
  }

  .woocommerce-checkout {
    grid-template-columns: 1fr;
  }

  /* ===================================
     CHECKOUT PAGE TITLE - MOBILE ONLY
     =================================== */
  body.woocommerce-checkout h1.entry-title {
    font-size: 3rem !important;
  }
}

/* ===================================
   TABLET STYLES (768px - 1023px)
   =================================== */
@media (min-width: 768px) and (max-width: 1023px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-widgets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===================================
   MOBILE & TABLET NAVIGATION (max-width: 1023px)
   NOTE: Sidebar panel, nav-menu, sub-menu, and dropdown arrow styling
   all live in assets/css/components/header/_navigation.css only.
   This file used to duplicate that entire system with !important,
   which fought with and randomly overrode fixes made there.
   Only non-duplicated mobile nav concerns stay here.
   =================================== */
@media (max-width: 1023px) {
  /* Show mobile-only sections */
  .mobile-search-wrapper,
  .mobile-account-section {
    display: block !important;
  }

  /* Prevent body scroll when menu is open */
  body.mobile-menu-open {
    overflow: hidden !important;
  }

  /* Hide desktop dropdowns on mobile */
  .account-dropdown,
  .cart-dropdown {
    display: none !important;
  }
}

/* Mobile specific adjustments */
@media (max-width: 767px) {
  /* Top bar hidden on mobile */
  .top-bar {
    display: none !important;
  }
  
  .site-header {
    top: 0 !important;
  }
  
  body.scrolled .site-header {
    top: 0 !important;
  }
}

/* ===================================
   DESKTOP STYLES (min-width: 1024px)
   NOTE: .main-navigation and .nav-menu desktop layout already handled
   in _navigation.css. Only non-duplicated desktop concerns stay here.
   =================================== */
@media (min-width: 1024px) {
  .mobile-menu-overlay {
    display: none !important;
  }
}

/* ===================================
   LARGE DESKTOP (min-width: 1400px)
   =================================== */
@media (min-width: 1400px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .categories-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===================================
   EXTRA LARGE DESKTOP (min-width: 1920px)
   =================================== */
@media (min-width: 1920px) {
  .products-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ===================================
   ADMIN BAR FIXES
   WordPress admin bar spacing for logged-in users
   =================================== */

/* Desktop Admin Bar (32px) */
.admin-bar .top-bar {
  top: 32px !important;
}

.admin-bar .site-header {
  top: 77px !important;
}

.admin-bar.scrolled .site-header {
  top: 32px !important;
}

/* Mobile Admin Bar (46px when screen < 783px) */
@media screen and (max-width: 782px) {
  .admin-bar .top-bar {
    display: none !important;
  }
  
  .admin-bar .site-header {
    top: 46px !important;
  }
  
  .admin-bar.scrolled .site-header {
    top: 0 !important;
  }
  
  .admin-bar .main-navigation {
    top: 0 !important;
    padding-top: 116px !important;
  }
}

/* Tablet with admin bar */
@media screen and (min-width: 783px) and (max-width: 1023px) {
  .admin-bar .main-navigation {
    top: 0 !important;
    padding-top: 122px !important;
  }
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
  .site-header,
  .site-footer,
  .hero-section,
  .btn,
  .mobile-menu-toggle,
  .mobile-menu-overlay {
    display: none !important;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  body {
    font-size: 12pt;
    line-height: 1.4;
    color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .entry-content {
    width: 100%;
  }
}

/* ===================================
   ACCESSIBILITY - HIGH CONTRAST MODE
   =================================== */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #0000ff;
    --color-secondary: #000080;
    --color-accent: #ffa500;
    --color-text: #000000;
    --color-dark: #000000;
    --color-light: #ffffff;
  }

  .btn--outline {
    border-width: 3px;
  }

  .main-navigation {
    border-left: 3px solid #000;
  }

  .nav-menu > li {
    border-bottom: 2px solid #000 !important;
  }
}

/* ===================================
   ACCESSIBILITY - REDUCED MOTION
   =================================== */
@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;
  }

  .fade-in,
  .slide-up,
  .scale-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .main-navigation,
  .mobile-menu-overlay {
    transition: none !important;
  }

  .main-navigation.active {
    right: 0 !important;
  }
}