  .category-section .category-info {
    padding: 0.75rem;
    box-shadow: none;
  }

/* Extra small phones */
@media (max-width: 400px) {
  .category-section .category-products-grid { grid-template-columns: 1fr; }
  .category-section .product-image-modern { aspect-ratio: 4 / 5; }
  .category-section .btn { padding: 0.3rem 0.45rem; font-size: 0.8rem; }
}
  .category-section .category-large-image {
    width: 70px;
    height: 70px;
    border: 3px solid var(--primary-color);
    margin-bottom: 0.5rem;
  }
  .category-section .category-title { font-size: 1.1rem; margin-bottom: 0.25rem; }
  .category-section .category-description { display: none; }
  .category-section .category-count { font-size: 0.8rem; padding: 4px 10px; margin-bottom: 0.5rem; }
  .category-section .btn-view-more { width: 100%; padding: 8px 16px; font-size: 0.9rem; }
  .category-section { margin-bottom: 2rem; }

@media (min-width: 992px) {
  .site-header .search-form {
    max-width: 720px;
  }
  
  .site-header .navbar-nav {
    gap: 24px;
  }
}

@media (max-width: 991px) and (min-width: 768px) {
  .site-header .logo {
    height: 55px;
    width: 55px;
  }
  
  .site-header .search-form .form-control {
    font-size: 0.9rem;
    padding: 10px 15px;
  }
  
  .site-header .search-form .btn {
    padding: 8px 15px;
  }
  
  .btn-login {
    padding: 5px 10px;
    font-size: 0.9rem;
  }
  
  .site-header .navbar-nav {
    gap: 12px;
    padding: 0.5rem 0;
  }
  
  .site-header .nav-link {
    font-size: 0.9rem;
    padding: 0.5rem 0.6rem;
  }
}

/* Small screens (tablets pequeños) - 576px a 767px */
@media (max-width: 767px) and (min-width: 576px) {
  .site-header {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  
  .site-header .container > .d-flex {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 0;
  }
  
  .site-header .logo {
    height: 50px;
    width: 50px;
  }
  
  /* Navbar centrado */
  .site-header .flex-fill.d-flex.justify-content-center {
    order: 2;
  }
  
  .site-header .navbar-nav .nav-link {
    transition: color 0.2s ease;
    border-radius: 6px;
    margin: 0 2px;
  }
  
  .site-header .navbar-nav .nav-link:hover {
    background: var(--primary-color);
    color: white !important;
  }
  
  /* Search y Cart */
  .site-header .d-flex.align-items-center.gap-2 {
    order: 3;
    margin-top: 10px;
    width: 100%;
    justify-content: center;
    gap: 12px !important;
  }
  
  .site-header .search-form .input-group {
    width: 280px !important;
    border-radius: 6px;
    overflow: hidden;
  }
  
  .site-header .search-form .form-control {
    padding: 8px 12px;
    font-size: 0.9rem;
    border: 1px solid #ddd;
  }
  
  .site-header .search-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.2);
  }
  
  .site-header .search-form .btn {
    padding: 8px 12px;
    border: none;
    background: var(--primary-color);
  }
  
  .cart-btn {
    padding: 8px 10px;
    min-width: 42px;
    min-height: 42px;
    border-radius: 6px;
    background: var(--accent-color);
    border: none;
  }
  
  /* Navigation menu colapsado */
  .site-header .navbar-collapse {
    margin-top: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }
  
  .site-header .navbar-nav {
    gap: 6px;
    padding: 0;
    justify-content: flex-start;
  }
  
  .site-header .nav-link {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
  }
}

/* Extra small screens (móviles) - hasta 575px */
@media (max-width: 575px) {
  .site-header {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  
  .site-header .container {
    padding: 0 12px;
  }
  
  .site-header .container > .d-flex {
    flex-wrap: wrap;
    gap: 8px;
    min-height: 60px;
    padding: 8px 0;
  }
  
  .site-header .logo {
    height: 45px;
    width: 45px;
  }
  
  /* Primera fila: Logo + Toggler + Search/Cart */
  .site-header .navbar-brand {
    order: 1;
  }
  
  .site-header .navbar-toggler {
    order: 2;
    margin-left: auto !important;
    margin-right: 8px !important;
    border: none;
    padding: 6px;
    border-radius: 4px;
    background: var(--primary-color);
  }
  
  .site-header .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  }
  
  /* Search y Cart */
  .site-header .d-flex.align-items-center.gap-2 {
    order: 3;
    margin-left: 0 !important;
    gap: 6px !important;
  }
  
  /* Navbar centrado oculto en móvil, aparece colapsado */
  .site-header .flex-fill.d-flex.justify-content-center {
    order: 4;
    width: 100%;
    margin-top: 10px;
    justify-content: flex-start !important;
  }
  
  .site-header .navbar {
    width: 100%;
  }
  
  /* Search compacto */
  .site-header .search-form .input-group {
    width: 200px !important;
    border-radius: 6px;
    overflow: hidden;
  }
  
  .site-header .search-form .form-control {
    padding: 6px 10px;
    font-size: 0.85rem;
    border: 1px solid #ddd;
  }
  
  .site-header .search-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.2);
  }
  
  .site-header .search-form .btn {
    padding: 6px 10px;
    border: none;
    background: var(--primary-color);
  }
  
  .cart-btn {
    padding: 6px 8px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 6px;
    background: var(--accent-color);
    border: none;
  }
  
  .cart-btn .fa-shopping-bag {
    font-size: 0.9rem;
    color: white;
  }
  
  /* Badge del carrito */
  .cart-btn .badge {
    font-size: 0.6rem;
    padding: 2px 5px;
  }
  
  /* Navigation menu colapsado minimalista - ancho completo */
  .site-header .navbar-collapse {
    margin-top: 12px;
    background: white;
    border-radius: 12px;
    padding: 1rem;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    text-align: left;
    position: relative;
    left: 0;
    right: 0;
  }
  
  .site-header .navbar-nav {
    gap: 0;
    padding: 0;
    justify-content: flex-start;
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
  }
  
  .site-header .nav-link {
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    display: block;
    margin-bottom: 4px;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .site-header .nav-item:last-child .nav-link {
    border-bottom: none;
    margin-bottom: 0;
  }
  
  .site-header .nav-link:hover {
    background: var(--primary-color);
    color: white !important;
    transform: translateX(4px);
  }
  
  /* Dropdown items en móvil */
  .site-header .dropdown-menu {
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border: 1px solid #e9ecef;
    margin-top: 8px;
    background: white;
    position: static !important;
    transform: none !important;
    width: 100% !important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
  }
  
  .site-header .dropdown-menu .dropdown-item {
    font-size: 0.85rem;
    padding: 0.6rem 1.2rem;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .site-header .dropdown-menu .dropdown-item:last-child {
    border-bottom: none;
  }
  
  .site-header .dropdown-menu .dropdown-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(4px);
  }
  
  .site-header .dropdown-menu .dropdown-item .badge {
    font-size: 0.7rem;
    padding: 2px 6px;
  }
}

/* iPhone SE y dispositivos muy pequeños - hasta 374px */
@media (max-width: 374px) {
  .site-header .container {
    padding: 0 8px;
  }
  
  .site-header .logo {
    height: 40px;
    width: 40px;
  }
  
  .site-header .search-form .form-control {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  
  .site-header .search-form .btn {
    padding: 4px 8px;
  }
  
  .cart-btn {
    padding: 4px 6px;
    min-width: 36px;
    min-height: 36px;
  }
  
  .cart-btn .fa-shopping-bag {
    font-size: 0.8rem;
  }
  
  .cart-btn .badge {
    font-size: 0.55rem;
    padding: 1px 4px;
  }
  
  .site-header .nav-link {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
  }
  
  .site-header .dropdown-menu .dropdown-item {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
  }
  
  /* Footer responsive */
  .footer-gradient {
    padding: 2rem 0 !important;
  }
  
  .footer-gradient .row {
    text-align: center;
  }
  
  .footer-gradient .col-lg-4 {
    margin-bottom: 1.5rem;
  }
  
  .footer-gradient .footer-brand {
    justify-content: center;
    margin-bottom: 1rem;
  }
  
  .footer-gradient .footer-logo {
    height: 40px !important;
  }
  
  .footer-gradient h5 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }
  
  .footer-gradient p,
  .footer-gradient .footer-link {
    font-size: 0.85rem;
    line-height: 1.4;
  }
  
  .footer-gradient .social-links {
    justify-content: center;
    gap: 0.75rem;
  }
  
  .footer-gradient .social-links img {
    height: 28px !important;
  }

  /* Product images responsive fixes */
  .product-image,
  .product-image-modern,
  .card-img-top {
    height: 180px !important;
    object-fit: contain !important;
    background: white !important;
    padding: 8px !important;
  }
  
  .category-large-image {
    height: 250px !important;
    object-fit: contain !important;
    background: white !important;
    padding: 4px !important;
  }
  
  .category-image {
    height: 200px !important;
    object-fit: contain !important;
    background: white !important;
    padding: 2px !important;
  }

  /* Product cards mobile */
  .product-card,
  .product-card-modern {
    margin-bottom: 1rem;
  }
  
  .product-card .card-body {
    padding: 0.75rem !important;
  }
  
  .product-title {
    font-size: 0.9rem !important;
    line-height: 1.3;
    margin-bottom: 0.5rem !important;
  }
  
  .product-price {
    font-size: 1rem !important;
    margin-bottom: 0.75rem !important;
  }
  
  /* Buttons mobile visibility */
  .btn-primary,
  .btn-outline-primary,
  .btn-view-more,
  .btn-view-more-compact,
  .btn-sm,
  .btn {
    padding: 0.6rem 1rem !important;
    font-size: 0.9rem !important;
    min-height: 40px !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }
  
  .product-actions {
    margin-top: 0.75rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  
  .product-actions .btn {
    width: 100% !important;
    margin-bottom: 0 !important;
    flex: 1 !important;
  }
  
  /* Specific button colors */
  .btn-primary {
    background: var(--primary-color) !important;
    color: white !important;
  }
  
  .btn-outline-primary {
    background: white !important;
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color) !important;
  }
  
  /* Card body spacing */
  .card-body {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    min-height: 140px !important;
  }



  /* Asegurar que los elementos táctiles tengan tamaño mínimo */
  .site-header .nav-link,
  .site-header .dropdown-item,
  .btn-login,
  .cart-btn {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Fix para orientación horizontal en móviles */
@media (max-height: 500px) and (orientation: landscape) {
  .site-header .container > .d-flex {
    min-height: 50px;
  }
  
  .site-header .logo {
    height: 35px;
    width: 35px;
  }
  
  .site-header .search-form .form-control {
    padding: 6px 12px;
  }
}

/* General responsive adjustments */
@media (max-width: 768px) {
  /* Hero Mobile Override - Forzar estilos móviles - UPDATED */
  .hero-modern {
    padding: 1rem 0 !important;
    margin: 0 !important;
  }
  
  .hero-modern .container {
    background: var(--gradient-primary) !important;
    border-radius: 15px !important;
    padding: 1.5rem !important;
    min-height: auto !important;
    display: block !important;
    position: relative !important;
  }
  
  .hero-modern .row {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    margin: 0 !important;
  }
  
  .hero-modern .col-lg-6:first-child {
    order: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .hero-modern .col-lg-6:last-child {
    order: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .hero-content {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
    padding: 1rem 0 !important;
    text-align: center !important;
    display: block !important;
    z-index: auto !important;
  }
  
  .hero-content h1 {
    font-size: 1.75rem !important;
    margin-bottom: 1rem !important;
    line-height: 1.3 !important;
    color: #000000 !important;
    font-weight: 700 !important;
  }
  
  .hero-content p {
    font-size: 0.95rem !important;
    margin-bottom: 1.5rem !important;
    line-height: 1.4 !important;
    color: #000000 !important;
    opacity: 0.85 !important;
  }
  
  .hero-image-container {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    display: flex !important;
    justify-content: center !important;
    margin-bottom: 1.5rem !important;
    overflow: visible !important;
  }
  
  .hero-image {
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: 220px !important;
    height: 220px !important;
    max-width: 220px !important;
    max-height: 220px !important;
    object-fit: contain !important;
    border-radius: 12px !important;
  }
  
  .btn-hero {
    padding: 12px 30px !important;
    font-size: 1rem !important;
  }


  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }
  
  .navbar-brand span {
    display: none;
  }
  
  .breadcrumb {
    font-size: 0.875rem;
  }
  
  .breadcrumb-item {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
  }
  
  .footer-brand {
    justify-content: center;
    text-align: center;
    flex-direction: column;
    margin-bottom: 1.5rem;
  }
  
  .footer-logo {
    margin-bottom: 0.5rem;
    margin-right: 0 !important;
  }
  
  .footer-description {
    text-align: center;
    margin-bottom: 1rem;
  }
  
  .social-links {
    justify-content: center;
    margin-top: 1rem;
  }
  
  .footer-heading {
    text-align: center;
    margin-bottom: 1rem;
  }
  
  .footer-links {
    text-align: center;
  }
  
  .footer-contact {
    text-align: center;
  }
  
  .footer-developer {
    justify-content: center;
    margin-top: 1rem;
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .footer-dev-link {
    margin-top: 0;
    margin-left: 0 !important;
  }

  /* Footer: mejor espaciado y subrayado centrado del heading en pantallas medias/pequeñas */
  .footer-gradient .row > [class*="col-"] {
    margin-bottom: 1.25rem;
  }
  .footer-heading::after {
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 576px) {

  
  .product-grid {
    grid-template-columns: 1fr;
  }
  
  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
  
  .footer-gradient {
    padding: 2rem 0 !important;
  }
  
  .footer-heading {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
  }
  
  .footer-link, .footer-contact p {
    font-size: 0.85rem;
  }
  
  .footer-social-link {
    width: 32px;
    height: 32px;
  }
  
  .footer-description {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }
  
  .footer-copyright, .footer-dev-text {
    font-size: 0.8rem;
  }

  /* Footer: columnas apiladas, enlaces en grilla compacta y alineación centrada */
  .footer-gradient .row > [class*="col-"] {
    margin-bottom: 1rem;
  }
  .footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 1rem;
    justify-items: center;
  }
  .footer-links li {
    margin-bottom: 0;
  }
  .footer-gradient .text-md-end {
    text-align: center !important;
    margin-top: 0.5rem;
  }
  .footer-logo {
    height: 42px;
    width: 42px;
  }
}

/* Responsive styles for new modern design */
@media (max-width: 768px) {
  
  .section-title {
    font-size: 2rem;
  }
  
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .category-image {
    width: 120px;
    height: 120px;
  }
  
  .product-item {
    flex: 0 0 250px;
  }
  
  /* Mantener 2 columnas en tablets; solo ajustar gaps/padding */
  .category-showcase,
  .category-showcase.reverse {
    grid-template-columns: minmax(260px, 300px) 1fr;
    gap: 1.25rem;
    padding: 1.5rem;
  }
  
  .category-products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .carousel-btn.prev {
    left: -20px;
  }
  
  .carousel-btn.next {
    right: -20px;
  }
}

@media (max-width: 576px) {
  
  .section-title {
    font-size: 1.75rem;
  }
  
  .section-subtitle {
    font-size: 1rem;
  }
  
  /* 4 categories per row on mobile */
  .category-grid { grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
  .category-image { width: 70px; height: 70px; }
  
  .product-item {
    flex: 0 0 220px;
  }
  
  /* Stack category info above products on small phones */
  .category-showcase,
  .category-showcase.reverse {
    grid-template-columns: 1fr;
    grid-template-areas:
      'info'
      'products';
    gap: 0.8rem;
    padding: 0.85rem;
  }
  
  .category-large-image {
    width: 80px;
    height: 80px;
  }
  
  .category-title {
    font-size: 1.4rem;
  }
  
  /* Keep carousel arrows visible but smaller on phones */
  .carousel-btn { display: inline-flex; width: 40px; height: 40px; font-size: 1rem; }
  .carousel-btn.prev { left: 6px; }
  .carousel-btn.next { right: 6px; }

  /* Category showcase: 2 columns for better readability on phones */
  .category-section .category-products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem;
  }
  .category-section .product-card-modern {
    box-shadow: none;
    border-radius: 10px;
  }
  .category-section .product-image-modern {
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }
  .category-section .card-body {
    padding: 0.5rem 0.6rem;
  }
  .category-section .card-body .card-title {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2; /* standard property for compatibility */
  }
  .category-section .card-body .card-text { display: none; }
  .category-section .product-price { font-size: 1rem; }
  .category-section .btn { padding: 0.35rem 0.5rem; font-size: 0.85rem; }
  /* Hide details button to simplify mobile cards */
  .category-section .category-products-grid .btn-outline-primary { display: none; }

  /* Mobile cross-browser compatibility adjustments */
  /* Ensure Safari/iOS doesn't auto-zoom or resize text unexpectedly */
  html, body { -webkit-text-size-adjust: 100%; }
  /* Remove tap highlight on mobile for better UX on buttons/links */
  body { -webkit-tap-highlight-color: rgba(0,0,0,0); }

  /* Fallbacks for older Safari: use grid-gap along with gap */
  .category-grid { grid-gap: 0.6rem; }
  .category-showcase, .category-showcase.reverse { grid-gap: 0.8rem; }
  .category-section .category-products-grid { grid-gap: 0.9rem; }

  /* Utility for full height on mobile browsers with dynamic address bars */
  .min-100dvh { min-height: 100dvh; min-height: -webkit-fill-available; }
}

/* === PRODUCT DETAIL PAGE RESPONSIVE === */
@media (max-width: 768px) {
    .product-detail-info {
        padding: 20px;
    }
    
    .description-header {
        padding: 15px;
    }
    
    .description-content {
        padding: 20px;
    }
    
    .description-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .product-price {
        font-size: 1.5rem;
    }
    
    #productImage,
    img.product-detail-image {
        height: 300px !important;
    }
}
