/*
Theme Name: Maya Mayoreo Theme
Description: Tema personalizado para la tienda Maya Mayoreo con diseño moderno y funcional
Version: 1.0
Author: Maya Creativa
*/

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* (revert) se quitan estilos específicos de JZ cards */

/* Header */
.site-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
}

.header-top {
    background: rgba(0,0,0,0.1);
    padding: 10px 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
}

.site-logo img {
    height: 50px;
    margin-right: 15px;
}

/* Buscador */
.search-container {
    flex: 1;
    max-width: 500px;
    margin: 0 30px;
}

.search-form {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    background: rgba(255,255,255,0.9);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #ff6b6b;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: #ee5a24;
    transform: translateY(-50%) scale(1.1);
}

/* Navegación */
.main-navigation {
    background: rgba(0,0,0,0.1);
    padding: 15px 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-menu a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* Submenu de categorías */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 300px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border-radius: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.nav-menu li:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu ul {
    list-style: none;
    padding: 20px;
}

.submenu li {
    margin-bottom: 10px;
}

.submenu a {
    color: #333;
    padding: 8px 12px;
    border-radius: 5px;
    display: block;
    transition: all 0.3s ease;
}

.submenu a:hover {
    background: #ff6b6b;
    color: white;
    transform: translateX(5px);
}

/* Estilos para la barra de scroll del submenu */
.submenu::-webkit-scrollbar {
    width: 6px;
}

.submenu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.submenu::-webkit-scrollbar-thumb {
    background: #ff6b6b;
    border-radius: 3px;
}

.submenu::-webkit-scrollbar-thumb:hover {
    background: #ee5a24;
}

/* Indicador de scroll en el submenu */
.submenu-scroll-indicator {
    position: sticky;
    bottom: 0;
    background: linear-gradient(transparent, rgba(255,255,255,0.9));
    padding: 10px 20px;
    text-align: center;
    font-size: 12px;
    color: #666;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.submenu-scroll-indicator i {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

/* Botones de acción */
.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.action-button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-button:hover {
    background: white;
    color: #ff6b6b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.cart-button {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
}

.cart-text {
    margin-left: 8px;
}

/* Contenido principal */
.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    padding-top: 140px; /* Espacio para el header fijo */
}

/* Grid de categorías */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.category-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* Diferentes tamaños para el grid */
.category-card:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
}

.category-card:nth-child(2) {
    grid-column: span 1;
    grid-row: span 1;
}

.category-card:nth-child(3) {
    grid-column: span 1;
    grid-row: span 2;
}

.category-card:nth-child(4) {
    grid-column: span 2;
    grid-row: span 1;
}

.category-card:nth-child(5) {
    grid-column: span 1;
    grid-row: span 1;
}

.category-card:nth-child(6) {
    grid-column: span 1;
    grid-row: span 1;
}

.category-card:nth-child(7) {
    grid-column: span 2;
    grid-row: span 1;
}

.category-card:nth-child(8) {
    grid-column: span 1;
    grid-row: span 2;
}

.category-card:nth-child(9) {
    grid-column: span 1;
    grid-row: span 1;
}

.category-card:nth-child(10) {
    grid-column: span 1;
    grid-row: span 1;
}

.category-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    position: relative;
    overflow: hidden;
}

.category-card:nth-child(1) .category-image {
    height: 300px;
    font-size: 72px;
}

.category-card:nth-child(3) .category-image,
.category-card:nth-child(8) .category-image {
    height: 250px;
    font-size: 60px;
}

.category-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover .category-image::before {
    opacity: 1;
}

.category-content {
    padding: 25px;
}

.category-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.category-card:nth-child(1) .category-title {
    font-size: 32px;
}

.category-description {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.category-count {
    background: #ff6b6b;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
}

/* Footer */
.site-footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-logo {
    font-size: 24px;
    font-weight: bold;
    color: #ff6b6b;
}

.footer-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #ff6b6b;
}

.whatsapp-link {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #25d366;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.whatsapp-link:hover {
    background: #128c7e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 20px;
    color: #bdc3c7;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .site-main {
        padding-top: 180px; /* Más espacio en móvil para el header más alto */
    }
    
    .header-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .search-container {
        order: 2;
        margin: 0;
        max-width: 100%;
    }
    
    .header-actions {
        order: 3;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu a {
        justify-content: center;
        padding: 15px;
    }
    
    .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(0,0,0,0.1);
        margin-top: 10px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .category-card {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }
    
    .category-card:nth-child(1) .category-image {
        height: 200px;
        font-size: 48px;
    }
    
    .category-card:nth-child(1) .category-title {
        font-size: 24px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
    
    /* Responsive para la tabla de categorías */
    .categories-table-container {
        margin: 0 20px;
        overflow-x: auto;
    }
    
    .categories-table {
        min-width: 600px;
    }
    
    .categories-table th,
    .categories-table td {
        padding: 12px 10px;
        font-size: 14px;
    }
    
    .category-table-info {
        gap: 8px;
    }
    
    .category-image-cell {
        width: 150px;
        height: 50px;
    }
    
    .category-fallback-icon {
        font-size: 24px;
    }
    
    .category-name {
        font-size: 12px;
    }
    
    .category-name-overlay {
        padding: 6px 8px;
    }
    
    .view-category-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-card {
    animation: fadeInUp 0.6s ease forwards;
}

.category-card:nth-child(1) { animation-delay: 0.1s; }
.category-card:nth-child(2) { animation-delay: 0.2s; }
.category-card:nth-child(3) { animation-delay: 0.3s; }
.category-card:nth-child(4) { animation-delay: 0.4s; }
.category-card:nth-child(5) { animation-delay: 0.5s; }
.category-card:nth-child(6) { animation-delay: 0.6s; }
.category-card:nth-child(7) { animation-delay: 0.7s; }
.category-card:nth-child(8) { animation-delay: 0.8s; }
.category-card:nth-child(9) { animation-delay: 0.9s; }
.category-card:nth-child(10) { animation-delay: 1.0s; }

/* Sección de todas las categorías */
.all-categories-section {
    margin-top: 60px;
    padding: 40px 0;
}

.all-categories-section h3 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 30px;
    color: #333;
    font-weight: bold;
}

.categories-table-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    margin: 0 auto;
    max-width: 800px;
}

.categories-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.categories-table thead {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.categories-table th {
    padding: 20px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 16px;
}

.categories-table th:first-child {
    border-top-left-radius: 15px;
}

.categories-table th:last-child {
    border-top-right-radius: 15px;
}

.categories-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.categories-table tbody tr:hover {
    background-color: #f8f9fa;
}

.categories-table tbody tr:last-child {
    border-bottom: none;
}

.categories-table td {
    padding: 15px;
    vertical-align: middle;
}

.category-table-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-image-cell {
    width: 200px;
    height: 60px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    background-color: #f8f9fa;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.category-image-cell:hover {
    transform: scale(1.02);
}

.category-fallback-icon {
    font-size: 32px;
    color: #ff6b6b;
}

.category-name-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-name {
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    font-size: 14px;
    text-align: center;
    line-height: 1.2;
}

.product-count {
    background: #ff6b6b;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
}

.view-category-btn {
    background: #ff6b6b;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.view-category-btn:hover {
    background: #ee5a24;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.view-category-btn i {
    font-size: 12px;
}

/* Notificaciones */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid #28a745;
}

.notification-error {
    border-left: 4px solid #dc3545;
}

.notification-info {
    border-left: 4px solid #17a2b8;
}

.notification-warning {
    border-left: 4px solid #ffc107;
}

.notification-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    color: #333;
}

/* Resultados de búsqueda */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 5px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-image img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.result-info h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
}

.result-info h4 a {
    color: #333;
    text-decoration: none;
}

.result-info h4 a:hover {
    color: #ff6b6b;
}

.result-price {
    color: #ff6b6b;
    font-weight: 600;
    font-size: 14px;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #666;
}

/* Botón scroll to top */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-to-top:hover {
    background: #ee5a24;
    transform: translateY(-2px);
}

/* Animaciones */
.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados de hover mejorados */
.category-card.hovered,
.product-card.hovered {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

/* Contador de caracteres */
.char-counter {
    font-size: 12px;
    color: #666;
    text-align: right;
    margin-top: 5px;
}

.char-counter.warning {
    color: #ff6b6b;
}

/* Estados de botones */
.add-to-cart-btn.added {
    background: #28a745 !important;
    color: white !important;
}

.add-to-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Campos de error */
input.error,
select.error,
textarea.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Header scrolled */
.site-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

/* Lazy loading */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.lazy.loaded {
    opacity: 1;
}
