/* ========================================
   ESTILOS RESPONSIVE MEJORADOS
   Pinche Supplies - Mobile First
======================================== */

/* ========================================
   BASE - Mejoras generales
======================================== */
* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

/* ========================================
   TABLET - 768px a 1024px
======================================== */
@media (max-width: 1024px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .header-container {
    gap: 1rem;
    padding: 1rem 1.5rem;
  }

  .search-bar-rosamonkey {
    max-width: 400px;
  }

  .nav-container-rosamonkey {
    gap: 1.5rem;
  }

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

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

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

/* ========================================
   MÓVIL - Menos de 768px
======================================== */
@media (max-width: 768px) {
  /* HEADER */
  .header-container {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }

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

  .logo-img {
    height: 40px;
    max-width: 150px;
  }

  /* Búsqueda móvil */
  .search-toggle-mobile {
    display: flex;
  }

  .search-bar-rosamonkey {
    display: none;
  }

  .mobile-search {
    display: block;
  }

  .search-bar {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin-top: 0.5rem;
  }

  /* NAVEGACIÓN MÓVIL */
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-rosamonkey {
    position: fixed;
    top: 65px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 65px);
    background: #fff;
    transition: left 0.3s ease;
    overflow-y: auto;
    z-index: 999;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }

  .nav-rosamonkey.active {
    left: 0;
  }

  .nav-container-rosamonkey {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 0;
  }

  .nav-link-rosamonkey {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 1rem;
  }

  .nav-link-rosamonkey::after {
    display: none;
  }

  /* Megamenú móvil */
  .megamenu {
    position: static;
    width: 100%;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav-dropdown.active .megamenu {
    max-height: 2000px;
  }

  .megamenu-container {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1.5rem;
  }

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

  .product-card {
    padding: 0.75rem;
  }

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

  .product-price {
    font-size: 1.1rem;
  }

  /* CHECKOUT */
  .checkout-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .checkout-form,
  .checkout-summary {
    padding: 1.5rem;
  }

  .form-group {
    margin-bottom: 1rem;
  }

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

  /* CARRITO */
  .cart-container {
    grid-template-columns: 1fr;
  }

  .cart-item {
    grid-template-columns: 80px 1fr;
    gap: 1rem;
    padding: 1rem;
  }

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

  .cart-item-details {
    grid-column: 1 / -1;
  }

  .cart-item-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  /* CATEGORÍAS */
  .categories-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* CARRUSEL */
  .hero-carousel {
    height: 350px;
  }

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

  .carousel-subtitle {
    font-size: 0.95rem;
  }

  .carousel-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .carousel-control {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  .carousel-control.prev {
    left: 0.5rem;
  }

  .carousel-control.next {
    right: 0.5rem;
  }

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

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .newsletter-form {
    flex-direction: column;
    gap: 0.75rem;
  }

  /* ACCOUNT/AUTH */
  .auth-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .auth-card,
  .auth-benefits {
    padding: 1.5rem;
  }

  .account-content {
    grid-template-columns: 1fr;
  }

  .account-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  /* ADMIN PANEL */
  .admin-sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    height: 100vh;
    width: 280px;
    transition: left 0.3s ease;
    z-index: 1000;
  }

  .admin-sidebar.active {
    left: 0;
  }

  .admin-content {
    margin-left: 0;
    padding: 1rem;
  }

  .stat-cards {
    grid-template-columns: 1fr;
  }

  .data-table {
    overflow-x: auto;
  }

  .data-table table {
    min-width: 600px;
  }

  /* Overlay cuando el menú está abierto */
  body.menu-open::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
  }

  body.menu-open {
    overflow: hidden;
  }
}

/* ========================================
   MÓVIL PEQUEÑO - Menos de 480px
======================================== */
@media (max-width: 480px) {
  /* PRODUCTOS - 1 columna */
  .products-grid {
    grid-template-columns: 1fr;
  }

  /* HEADER */
  .header-container {
    padding: 0.5rem 0.75rem;
  }

  .header-actions-rosamonkey {
    gap: 0.25rem;
  }

  .icon-btn {
    padding: 0.5rem;
    font-size: 1rem;
  }

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

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

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

  /* CARRUSEL */
  .hero-carousel {
    height: 300px;
  }

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

  .carousel-subtitle {
    font-size: 0.85rem;
  }

  /* FORMULARIOS */
  .form-control,
  .form-input,
  input,
  select,
  textarea {
    font-size: 16px; /* Evita zoom en iOS */
  }

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

  /* CHECKOUT */
  .checkout-form,
  .checkout-summary {
    padding: 1rem;
  }

  .summary-row {
    font-size: 0.9rem;
  }

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

  /* CUPONES */
  .coupon-form {
    flex-direction: column;
  }

  .coupon-input {
    width: 100%;
  }

  /* ACCOUNT */
  .auth-header h1,
  .account-header h1 {
    font-size: 1.5rem;
  }

  .account-main {
    padding: 1rem;
  }

  .account-sidebar {
    grid-template-columns: 1fr;
  }

  /* MODALS */
  .modal-content {
    margin: 1rem;
    max-width: calc(100% - 2rem);
  }
}

/* ========================================
   LANDSCAPE - Orientación horizontal
======================================== */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-carousel {
    height: 300px;
  }

  .nav-rosamonkey {
    height: 100vh;
  }
}

/* ========================================
   ACCESIBILIDAD
======================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   IMPRESIÓN
======================================== */
@media print {
  .nav-rosamonkey,
  .mobile-menu-toggle,
  .header-actions-rosamonkey,
  .footer,
  .btn {
    display: none;
  }

  .checkout-container,
  .cart-container {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   UTILIDADES RESPONSIVE
======================================== */
.hide-mobile {
  display: block;
}

.show-mobile {
  display: none;
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none;
  }

  .show-mobile {
    display: block;
  }
}
