/* Contenedor principal */
.wc-cat-botones-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Cabecera */
.wc-cat-botones-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.wc-cat-botones-title {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 28px;
    font-weight: 700;
}

/* Botones principales */
.wc-cat-botones-principales {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.wc-cat-boton-principal {
    background: linear-gradient(135deg, #0066cc 0%, #004d99 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 180px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
}

.wc-cat-boton-principal:hover {
    background: linear-gradient(135deg, #0052a3 0%, #003d73 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 102, 204, 0.3);
}

.wc-cat-boton-principal:active {
    transform: translateY(-1px);
}

/* Contenedor de subcategorías */
.wc-cat-subcategorias-container {
    margin: 25px 0;
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    display: none;
}

.wc-cat-subcategorias-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eaeaea;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
}

.wc-cat-subcategorias-title {
    color: #2c3e50;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.wc-cat-cerrar-subcategorias {
    background: #e74c3c;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.wc-cat-cerrar-subcategorias:hover {
    background: #c0392b;
    transform: rotate(90deg);
}

/* Columna de subcategorías */
.wc-cat-subcategorias-columna {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wc-cat-subcategoria-item {
    margin-bottom: 0;
}

.wc-cat-boton-subcategoria {
    background: white;
    color: #34495e;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.wc-cat-boton-subcategoria:hover {
    border-color: #3498db;
    background: #f8fafc;
    transform: translateX(5px);
    box-shadow: 0 3px 8px rgba(52, 152, 219, 0.15);
}

.wc-cat-subcategoria-nombre {
    font-weight: 500;
    flex-grow: 1;
}

.wc-cat-subcategoria-contador {
    color: #7f8c8d;
    font-size: 13px;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 40px;
    text-align: center;
}

/* Elemento especial para "Todos los productos" */
.wc-cat-todos-productos .wc-cat-boton-subcategoria {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #bdc3c7;
    font-weight: 600;
}

.wc-cat-todos-productos .wc-cat-boton-subcategoria:hover {
    border-color: #3498db;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

/* Contenedor de productos */
.wc-cat-productos-container {
    margin-top: 25px;
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    display: none;
}

.wc-cat-productos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eaeaea;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
}

.wc-cat-productos-title {
    color: #2c3e50;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.wc-cat-cerrar-productos {
    background: #e74c3c;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.wc-cat-cerrar-productos:hover {
    background: #c0392b;
    transform: rotate(90deg);
}

.wc-cat-productos-info {
    padding: 20px;
    text-align: center;
    background: #f8fafc;
    margin: 0 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.wc-cat-productos-info h4 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.wc-cat-contador-productos {
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 500;
}

/* Grid de productos */
.wc-cat-productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.wc-cat-producto-item {
    border: 1px solid #e0e6ed;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.wc-cat-producto-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.wc-cat-producto-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.wc-cat-producto-imagen-container {
    height: 180px;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.wc-cat-producto-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.wc-cat-producto-item:hover .wc-cat-producto-img {
    transform: scale(1.05);
}

.wc-cat-producto-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.wc-cat-producto-titulo {
    font-size: 15px;
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-weight: 600;
    line-height: 1.4;
    flex-grow: 1;
}

.wc-cat-producto-precio {
    color: #27ae60;
    font-weight: 700;
    font-size: 16px;
    margin: 10px 0;
}

.wc-cat-producto-ver {
    color: #3498db;
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
    display: inline-block;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(5px);
}

.wc-cat-producto-item:hover .wc-cat-producto-ver {
    opacity: 1;
    transform: translateY(0);
}

/* Controles de navegación */
.wc-cat-controls {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
}

.wc-cat-volver-subcategorias,
.wc-cat-volver-inicio {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.wc-cat-volver-subcategorias:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.wc-cat-volver-inicio {
    background: #3498db;
}

.wc-cat-volver-inicio:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Estados de carga */
.wc-cat-subcategorias-loading,
.wc-cat-productos-loading {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: #7f8c8d;
}

.wc-cat-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: wc-cat-spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

@keyframes wc-cat-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estados y mensajes */
.wc-cat-info,
.wc-cat-error,
.wc-cat-no-subcategorias,
.wc-cat-no-productos {
    text-align: center;
    padding: 25px;
    font-size: 15px;
    border-radius: 8px;
    margin: 10px 20px;
}

.wc-cat-no-subcategorias,
.wc-cat-no-productos {
    background: #f8f9fa;
    color: #7f8c8d;
    border: 1px dashed #bdc3c7;
}

.wc-cat-ver-productos-directo {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.wc-cat-ver-productos-directo:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.wc-cat-info {
    background: #e8f4fc;
    color: #2980b9;
    border: 1px solid #b3e0ff;
}

.wc-cat-error {
    background: #fdeaea;
    color: #e74c3c;
    border: 1px solid #f8b4b4;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .wc-cat-botones-container {
        padding: 15px;
    }
    
    .wc-cat-botones-header {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .wc-cat-botones-title {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .wc-cat-botones-principales {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .wc-cat-boton-principal {
        min-width: 100%;
        padding: 16px 20px;
        font-size: 15px;
    }
    
    .wc-cat-subcategorias-container,
    .wc-cat-productos-container {
        margin: 20px 0;
    }
    
    .wc-cat-subcategorias-header,
    .wc-cat-productos-header {
        padding: 15px;
    }
    
    .wc-cat-subcategorias-title,
    .wc-cat-productos-title {
        font-size: 18px;
    }
    
    .wc-cat-subcategorias-columna {
        padding: 15px;
        gap: 6px;
    }
    
    .wc-cat-boton-subcategoria {
        padding: 11px 14px;
        font-size: 13.5px;
    }
    
    .wc-cat-subcategoria-contador {
        font-size: 12px;
        min-width: 36px;
    }
    
    .wc-cat-productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
        padding: 15px;
    }
    
    .wc-cat-producto-imagen-container {
        height: 150px;
    }
    
    .wc-cat-producto-info {
        padding: 12px;
    }
    
    .wc-cat-producto-titulo {
        font-size: 14px;
    }
    
    .wc-cat-producto-precio {
        font-size: 15px;
    }
    
    .wc-cat-controls {
        flex-direction: column;
        padding: 15px;
    }
    
    .wc-cat-volver-subcategorias,
    .wc-cat-volver-inicio {
        width: 100%;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .wc-cat-botones-title {
        font-size: 20px;
    }
    
    .wc-cat-boton-principal {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .wc-cat-productos-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .wc-cat-subcategorias-columna {
        padding: 12px;
    }
    
    .wc-cat-boton-subcategoria {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Estilos para botones activos */
.wc-cat-boton-principal.active {
    background: linear-gradient(135deg, #004080 0%, #00264d 100%);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
    animation: wc-cat-pulse 2s infinite;
}

@keyframes wc-cat-pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(52, 152, 219, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
}

.wc-cat-boton-subcategoria.active {
    border-color: #3498db;
    background: #3498db;
    color: white;
    transform: translateX(5px);
}

.wc-cat-boton-subcategoria.active .wc-cat-subcategoria-nombre {
    color: white;
    font-weight: 600;
}

.wc-cat-boton-subcategoria.active .wc-cat-subcategoria-contador {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}