/*
Theme Name: Mercado Selecto
Theme URI: https://mercadoselecto.local
Author: Enrique Hernández
Description: Tema personalizado para tienda online con WooCommerce, con entregas en Villa Clara y Sancti Spíritus.
Version: 1.0
Text Domain: mercadoselecto
*/

:root {
    --primary: #1a3c6e;
    --primary-dark: #0f2a4a;
    --secondary: #e8b931;
    --secondary-dark: #c99f2a;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --info: #17a2b8;
    --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--dark);
    line-height: 1.6;
    background: #ffffff;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   ANIMACIONES GLOBALES
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: var(--primary);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.header-top {
    background: var(--primary-dark);
    color: white;
    text-align: center;
    padding: 6px 0;
    font-size: 0.85rem;
    font-weight: 500;
}

.header-top a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 700;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 10px;
}

.logo {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
}

.logo span {
    color: var(--secondary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 5px 10px;
}

.nav-menu {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.nav-menu a:hover {
    color: var(--secondary);
}

.nav-menu .filter-section {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-menu .filter-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.nav-menu .filter-btn:hover,
.nav-menu .filter-btn.active {
    background: var(--secondary);
    color: var(--dark);
    border-color: var(--secondary);
}

.cart-icon {
    background: var(--secondary);
    padding: 8px 18px;
    border-radius: 25px;
    color: var(--dark);
    font-weight: 700;
    position: relative;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.cart-icon:hover {
    transform: scale(1.05);
    background: var(--secondary-dark);
}

.cart-icon .cart-count {
    background: var(--danger);
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 0.7rem;
    position: absolute;
    top: -6px;
    right: -6px;
    transition: all 0.3s ease;
}

.cart-icon.bounce {
    animation: bounceIn 0.5s ease;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary), #2a5298);
    color: white;
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: 3.2rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.hero .badge {
    display: inline-block;
    background: var(--secondary);
    color: var(--dark);
    padding: 8px 25px;
    border-radius: 50px;
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.cta-button {
    background: var(--secondary);
    color: var(--dark);
    padding: 16px 45px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    display: inline-block;
    transition: transform 0.3s, box-shadow 0.3s;
    font-size: 1.1rem;
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
}

/* ============================================
   CATEGORÍAS
   ============================================ */
.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin: 50px 0 15px;
    color: var(--dark);
}

.section-subtitle {
    text-align: center;
    color: var(--gray);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    padding: 20px 0 40px;
}

.category-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    text-align: center;
    padding: 25px 15px;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    border: 1px solid #eee;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.category-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
}

.category-card h3 {
    font-size: 1.1rem;
    color: var(--dark);
}

.category-card .count {
    color: var(--gray);
    font-size: 0.85rem;
}

/* ============================================
   PRODUCTOS CON TOOLTIP DE INFO
   ============================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    padding: 20px 0 40px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #f0f0f0;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.product-card .sale-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--danger);
    color: white;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
}

.product-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.product-info {
    padding: 18px 20px 20px;
    position: relative;
}

.product-title {
    font-size: 1rem;
    margin-bottom: 6px;
    font-weight: 600;
}

.product-title a {
    color: var(--dark);
    text-decoration: none;
}

.product-title a:hover {
    color: var(--primary);
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.product-price .old-price {
    text-decoration: line-through;
    color: var(--gray);
    font-size: 0.9rem;
    font-weight: 400;
    margin-left: 8px;
}

.product-info .info-trigger {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    background: var(--info);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 3;
}

.product-info .info-trigger:hover {
    transform: scale(1.15);
    background: var(--primary);
}

.product-info .info-tooltip {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    background: var(--dark);
    color: white;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    width: 220px;
    z-index: 10;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    text-align: left;
    line-height: 1.5;
}

.product-info .info-tooltip::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 10px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--dark);
}

.product-info .info-tooltip.active {
    display: block;
}

.product-info .info-tooltip strong {
    color: var(--secondary);
}

.add-to-cart {
    background: var(--secondary);
    border: none;
    padding: 10px 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    margin-top: 12px;
    transition: background 0.3s, transform 0.2s;
    color: var(--dark);
    font-size: 0.95rem;
}

.add-to-cart:hover {
    background: var(--secondary-dark);
}

.add-to-cart:active {
    transform: scale(0.95);
}

/* ============================================
   PÁGINA DE PRODUCTO INDIVIDUAL
   ============================================ */
.product-single {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    padding: 40px 0;
}

.product-single .product-image img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
}

.product-single .product-details h1 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--dark);
}

.product-single .product-details .price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
}

.product-single .product-details .description {
    margin-bottom: 20px;
    color: var(--gray);
}

.product-single .product-details .product-meta {
    background: var(--light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.product-single .product-details .product-meta p {
    margin: 5px 0;
}

.product-single .product-details .product-meta strong {
    color: var(--dark);
}

.product-single .product-details .quantity {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.product-single .product-details .quantity input {
    width: 60px;
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.product-single .product-details .single-add-to-cart {
    background: var(--secondary);
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.product-single .product-details .single-add-to-cart:hover {
    background: var(--secondary-dark);
    transform: scale(1.02);
}

/* ============================================
   OFERTAS
   ============================================ */
.offers-section {
    background: var(--light);
    padding: 50px 0;
}

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

.offer-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    border-left: 5px solid var(--secondary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}

.offer-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.offer-card .discount {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--danger);
}

.offer-card .product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 8px 0;
}

.offer-card .prices {
    display: flex;
    gap: 15px;
    align-items: center;
}

.offer-card .old-price {
    text-decoration: line-through;
    color: var(--gray);
}

.offer-card .new-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

/* ============================================
   VENTAJAS
   ============================================ */
.features {
    padding: 50px 0;
    background: white;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.feature-item {
    padding: 20px;
    transition: transform 0.3s;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-item .icon {
    font-size: 2.8rem;
    margin-bottom: 12px;
}

.feature-item h4 {
    font-size: 1.1rem;
    color: var(--dark);
}

.feature-item p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* ============================================
   FAQ
   ============================================ */
.faq-section {
    padding: 50px 0;
    background: var(--light);
}

.faq-item {
    border-bottom: 1px solid #dee2e6;
    padding: 18px 0;
    max-width: 800px;
    margin: 0 auto;
}

.faq-question {
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    font-size: 1.05rem;
    color: var(--dark);
    transition: color 0.3s;
}

.faq-question:hover {
    color: var(--primary);
}

.faq-answer {
    display: none;
    padding-top: 12px;
    color: var(--gray);
    line-height: 1.7;
}

.faq-answer.active {
    display: block;
    animation: slideDown 0.3s ease;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--dark);
    color: #ccc;
    padding: 50px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer h3 {
    color: white;
    margin-bottom: 18px;
    font-size: 1.1rem;
}

.footer a {
    color: #ccc;
    text-decoration: none;
    display: block;
    margin: 6px 0;
    transition: color 0.3s;
}

.footer a:hover {
    color: var(--secondary);
}

.footer .social {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.footer .social a {
    font-size: 1.5rem;
}

.footer-newsletter input {
    padding: 10px 15px;
    border-radius: 8px 0 0 8px;
    border: none;
    width: 70%;
    max-width: 250px;
}

.footer-newsletter button {
    padding: 10px 20px;
    border-radius: 0 8px 8px 0;
    border: none;
    background: var(--secondary);
    color: var(--dark);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
}

.footer-newsletter button:hover {
    background: var(--secondary-dark);
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 20px;
    text-align: center;
    font-size: 0.9rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    .product-single {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        padding: 20px 0;
        gap: 15px;
        background: var(--primary);
        border-radius: 0 0 12px 12px;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu .filter-section {
        justify-content: center;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    .hero {
        padding: 50px 0 40px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .product-single {
        gap: 30px;
    }
    
    .product-single .product-details h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.6rem;
    }
    .section-title {
        font-size: 1.6rem;
    }
    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .product-card img {
        height: 150px;
    }
    .product-info {
        padding: 12px;
    }
}
