/* ===================================
   Responsive Styles
   =================================== */

/* Tablet and below (max-width: 992px) */
@media (max-width: 992px) {
  .container {
    padding: 0 var(--spacing-md);
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 1.125rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
  }

  .category-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

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

  /* Toast Notifications - Tablet */
  #toastContainer {
    top: 90px;
    right: 15px;
    max-width: 350px;
  }

  .toast {
    min-width: 280px;
  }
}

/* Mobile and below (max-width: 768px) */
@media (max-width: 768px) {
  /* Container */
  .container {
    padding: 0 1rem;
  }

  /* Header */
  .header-top {
    font-size: 0.75rem;
    padding: 0.5rem 0;
  }

  .header-top .container {
    flex-direction: column;
    gap: var(--spacing-xs);
    text-align: center;
  }

  .header-top-links {
    display: flex;
    gap: var(--spacing-md);
  }

  .header-top-links a {
    margin-left: 0;
  }

  .header-main {
    padding: 0.75rem 0;
  }

  .header-main .container {
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .logo {
    font-size: 1.25rem;
    flex-shrink: 0;
  }

  .logo i {
    font-size: 1.25rem;
  }

  .search-bar {
    order: 4;
    flex-basis: 100%;
    max-width: 100%;
    margin-top: 0.5rem;
  }

  .search-bar input {
    padding: 0.6rem 2.5rem 0.6rem 0.75rem;
    font-size: 0.875rem;
  }

  .search-bar button {
    padding: 0.4rem 0.75rem;
    right: 0.25rem;
  }

  .hide-mobile {
    display: none;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .header-action-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
  }

  .header-action-btn i {
    font-size: 1.1rem;
  }

  .cart-count {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    min-width: 16px;
  }

  /* Mobile Navigation */
  .nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background-color: var(--white);
    z-index: 9999;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-xl);
    overflow-y: auto;
    padding-top: 60px;
  }

  .nav.active {
    left: 0;
  }

  .nav::before {
    content: '\f00d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    color: var(--dark-color);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
  }

  .nav::before:hover {
    background-color: var(--gray-100);
  }

  .nav-list {
    flex-direction: column;
    padding: 0;
    gap: 0;
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid var(--gray-200);
  }

  .nav-item a {
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }

  .nav-item a::after {
    display: none;
  }

  .nav-item a.active {
    background-color: var(--gray-100);
    color: var(--secondary-color);
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
  }

  .mobile-menu-toggle:hover {
    background-color: var(--gray-100);
  }

  /* Mobile Overlay - Slides in with the menu */
  .mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, left 0.3s ease;
  }

  .mobile-overlay.active {
    left: 280px;
    opacity: 1;
    visibility: visible;
  }

  /* Hero */
  .hero {
    height: 400px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  /* Sections */
  .section {
    padding: var(--spacing-lg) 0;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .section-subtitle {
    font-size: 1rem;
  }

  /* Product Grid */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
  }

  .product-image-wrapper {
    height: 200px;
  }

  .product-info {
    padding: var(--spacing-sm);
  }

  .product-title {
    font-size: 1rem;
  }

  .price-current {
    font-size: 1.25rem;
  }

  .price-original {
    font-size: 1rem;
  }

  /* Category Cards */
  .category-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .category-card {
    height: 250px;
  }

  /* Promo Grid */
  .promo-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .promo-card {
    padding: var(--spacing-lg);
  }

  .promo-card i {
    font-size: 2.5rem;
  }

  /* Newsletter */
  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-form input,
  .newsletter-form button {
    width: 100%;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .footer {
    padding: var(--spacing-lg) 0 var(--spacing-md);
  }

  /* Buttons */
  .btn {
    padding: 0.75rem 1.5rem;
  }

  .btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
  }

  /* Toast Notifications - Mobile */
  #toastContainer {
    top: 80px;
    right: 10px;
    left: 10px;
    max-width: calc(100% - 20px);
    gap: 0.75rem;
  }

  .toast {
    min-width: auto;
    width: 100%;
    padding: var(--spacing-sm);
    font-size: 0.875rem;
  }

  .toast div[style*="gap: 1rem"] {
    gap: 0.75rem !important;
  }

  .toast i {
    font-size: 1.25rem !important;
  }

  @keyframes slideInRight {
    from {
      transform: translateY(-20px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  /* Cart Page */
  .cart-container {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .cart-item {
    grid-template-columns: 80px 1fr;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
  }

  .cart-item-image {
    width: 80px;
    height: 80px;
  }

  .cart-item-info h3 {
    font-size: 0.95rem;
  }

  .cart-item-details {
    font-size: 0.8rem;
  }

  .cart-item-price {
    font-size: 1.1rem;
  }

  .cart-item-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }

  .quantity-controls {
    border: 1px solid var(--gray-300);
  }

  .quantity-btn {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .quantity-input {
    width: 50px;
    height: 35px;
    font-size: 0.9rem;
  }

  .cart-summary {
    position: static;
    margin-top: var(--spacing-md);
  }

  .summary-title {
    font-size: 1.25rem;
  }

  /* Products Page */
  .products-page {
    grid-template-columns: 1fr;
  }

  .filters-sidebar {
    margin-bottom: var(--spacing-md);
  }

  /* Make filters more compact on mobile */
  .filter-group {
    margin-bottom: var(--spacing-md);
  }

  .filter-title {
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
  }

  .filter-options {
    gap: var(--spacing-xs);
  }

  .filter-option {
    gap: var(--spacing-xs);
    padding: 0.25rem 0;
  }

  .filter-option input[type="checkbox"],
  .filter-option input[type="radio"] {
    width: 16px;
    height: 16px;
  }

  .filter-option span {
    font-size: 0.875rem;
  }

  /* Size filter in grid on mobile */
  .filter-group:has(input[name="size"]) .filter-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xs);
  }

  .products-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .products-controls {
    width: 100%;
    flex-direction: column-reverse;
    gap: var(--spacing-sm);
  }

  .sort-select,
  .view-toggle {
    width: 100%;
  }

  .sort-select {
    width: 100%;
  }

  .view-toggle {
    justify-content: center;
  }

  /* Product Detail */
  .product-detail-container {
    grid-template-columns: 1fr;
  }

  .main-image-container {
    height: 350px;
  }

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

  .size-options,
  .color-options {
    gap: 0.5rem;
  }

  .size-option {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  /* Checkout */
  .checkout-container {
    padding: 0 1rem;
  }

  .checkout-steps {
    margin-bottom: var(--spacing-lg);
  }

  .checkout-step {
    padding: 0 0.25rem;
  }

  .step-number {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }

  .step-title {
    font-size: 0.75rem;
  }

  .checkout-form-section {
    padding: var(--spacing-md);
  }

  .form-section-title {
    font-size: 1.25rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .payment-method {
    padding: var(--spacing-sm);
    font-size: 0.9rem;
  }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 0.875rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .category-card h3 {
    font-size: 1.5rem;
  }

  .product-image-wrapper {
    height: 250px;
  }

  /* Toast Notifications - Small Mobile */
  #toastContainer {
    top: 70px;
    right: 8px;
    left: 8px;
    max-width: calc(100% - 16px);
    gap: 0.5rem;
  }

  .toast {
    padding: 0.625rem;
    font-size: 0.8125rem;
  }

  .toast div[style*="gap"] {
    gap: 0.5rem !important;
  }

  .toast i {
    font-size: 1.125rem !important;
  }
}

/* Large Desktop (min-width: 1400px) */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }

  .hero h1 {
    font-size: 3.5rem;
  }

  .hero p {
    font-size: 1.375rem;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* Print Styles */
@media print {
  .header,
  .nav,
  .footer,
  .btn,
  .newsletter-section {
    display: none;
  }

  body {
    background-color: var(--white);
    color: var(--dark-color);
  }

  .section {
    padding: 1rem 0;
  }
}

/* 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;
  }
}
