/*!
 * Humo Sagrado Theme - Home Page Styles
 * Version: 1.0.0
 * Description: Estilos específicos para la página de inicio
 */

/* ==========================================================================
   VARIABLES Y CONFIGURACIÓN
   ========================================================================== */

:root {
    --hero-height: 550px;
    --hero-min-height: 550px;
    --hero-max-width: 1920px;
    --section-padding: 0;
    --section-padding-mobile: 0;
    --grid-gap: 30px;
    --card-border-radius: 12px;
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero-section {
    position: relative;
    height: var(--hero-height);
    min-height: var(--hero-min-height);
    overflow: hidden;
    display: flex;
    align-items: center;
    width: 100vw;
    max-width: var(--hero-max-width);
    margin: 0 auto;
    margin-left: calc(-50vw + 50%);
}

.hero-carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(139, 69, 19, 0.7) 0%,
        rgba(210, 105, 30, 0.5) 50%,
        rgba(244, 164, 96, 0.3) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--color-text-white);
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
    opacity: 0.95;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-cta {
    animation: fadeInUp 1s ease-out 0.4s both;
}

/* Espaciado para múltiples botones */
.hero-actions,
.cta-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.hero-actions .btn + .btn,
.cta-actions .btn + .btn {
    margin-left: 20px;
}

@media (max-width: 768px) {
    .hero-actions,
    .cta-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .hero-actions .btn + .btn,
    .cta-actions .btn + .btn {
        margin-left: 0;
    }
}

.hero-cta .btn {
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 50px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hero-cta .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Controles del carrusel */
.hero-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 3;
}

.hero-prev,
.hero-next {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
}

.hero-prev:hover,
.hero-next:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.hero-indicators {
    display: flex;
    gap: 10px;
}

.hero-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.hero-indicator.active {
    background: white;
    transform: scale(1.2);
}

/* ==========================================================================
   SECCIONES GENERALES
   ========================================================================== */

.home-page section {
    padding: var(--section-padding);
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--color-text-dark);
    margin-bottom: var(--spacing-sm);
    position: relative;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    border-radius: 2px;
}

.section-description {
    font-size: 1.1rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

.section-cta {
    text-align: center;
    margin-top: var(--spacing-lg);
}

/* ==========================================================================
   SLIDER DE CATEGORÍAS
   ========================================================================== */

.categories-section {
    background: var(--color-bg-light);
}

.categories-slider-container {
    position: relative;
    margin-bottom: var(--spacing-lg);
}

.categories-slider {
    overflow: hidden;
    border-radius: var(--card-border-radius);
}

.categories-track {
    display: flex;
    transition: transform 0.5s ease;
    gap: var(--grid-gap);
}

.category-slide {
    flex: 0 0 calc(33.333% - (var(--grid-gap) * 2 / 3));
    min-width: 0;
}

/* Navegación del slider */
.categories-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    z-index: 10;
    box-shadow: var(--shadow-card);
}

.categories-nav:hover {
    background: white;
    box-shadow: var(--shadow-hover);
    transform: translateY(-50%) scale(1.1);
}

.categories-nav:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.categories-prev {
    left: -25px;
}

.categories-next {
    right: -25px;
}

.categories-nav svg {
    color: var(--color-text-dark);
    transition: var(--transition-smooth);
}

.categories-nav:hover svg {
    color: var(--color-primary);
}

/* Indicadores */
.categories-indicators {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: var(--spacing-md);
}

.categories-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.categories-indicator.active,
.categories-indicator:hover {
    background: var(--color-primary);
    transform: scale(1.2);
}

.categories-indicator:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .category-slide {
        flex: 0 0 calc(50% - (var(--grid-gap) / 2));
    }
    
    .categories-nav {
        width: 40px;
        height: 40px;
    }
    
    .categories-prev {
        left: -20px;
    }
    
    .categories-next {
        right: -20px;
    }
}

@media (max-width: 480px) {
    .category-slide {
        flex: 0 0 100%;
    }
    
    .categories-nav {
        width: 35px;
        height: 35px;
    }
    
    .categories-prev {
        left: -17px;
    }
    
    .categories-next {
        right: -17px;
    }
}

.category-card {
    background: white;
    border-radius: var(--card-border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition-smooth);
    position: relative;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.category-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.category-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.category-card:hover .category-image img {
    transform: scale(1.05);
}

.category-content {
    padding: var(--spacing-md);
}

.category-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: var(--spacing-xs);
}

.category-description {
    color: var(--color-text-light);
    line-height: 1.5;
    margin-bottom: var(--spacing-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-count {
    font-size: 0.9rem;
    color: var(--color-primary);
    font-weight: 500;
}

/* ==========================================================================
   PRODUCTOS POPULARES Y NUEVOS
   ========================================================================== */

.popular-products-section,
.new-products-section {
    position: relative;
}

.new-products-section {
    background: var(--color-bg-light);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--grid-gap);
    margin-bottom: var(--spacing-lg);
}

/* Estilos para productos personalizados */
.product-item-wrapper {
    width: 100%;
}

.product-card {
    background: white;
    border-radius: var(--card-border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition-smooth);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: var(--spacing-md);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 var(--spacing-sm) 0;
    line-height: 1.4;
}

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

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

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: var(--spacing-sm) 0;
}

.product-actions {
    margin-top: auto;
    padding-top: var(--spacing-sm);
}

.no-products-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--color-text-light);
    font-style: italic;
}

/* Estilos para productos WooCommerce */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--grid-gap);
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce ul.products li.product {
    background: white;
    border-radius: var(--card-border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition-smooth);
    position: relative;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.woocommerce ul.products li.product .woocommerce-loop-product__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.woocommerce ul.products li.product img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.woocommerce ul.products li.product:hover img {
    transform: scale(1.05);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: var(--spacing-sm) 0;
    padding: 0 var(--spacing-sm);
}

.woocommerce ul.products li.product .price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
    padding: 0 var(--spacing-sm) var(--spacing-sm);
}

/* ==========================================================================
   SECCIÓN ABOUT
   ========================================================================== */

.about-section {
    background: linear-gradient(135deg, var(--color-bg-white) 0%, var(--color-bg-light) 100%);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.about-item {
    text-align: center;
    padding: var(--spacing-lg);
    background: white;
    border-radius: var(--card-border-radius);
    box-shadow: var(--shadow-card);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.about-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.about-item:hover::before {
    left: 100%;
}

.about-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.about-illustration {
    margin-bottom: var(--spacing-md);
    display: flex;
    justify-content: center;
}

.about-illustration svg {
    transition: var(--transition-smooth);
}

.about-item:hover .about-illustration svg {
    transform: scale(1.1) rotate(5deg);
}

.about-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: var(--spacing-sm);
}

.about-content p {
    color: var(--color-text-light);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.about-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: var(--transition-smooth);
}

.about-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.about-link:hover::after {
    width: 100%;
}

/* ==========================================================================
   SECCIÓN DE REVIEWS
   ========================================================================== */

.reviews-section {
    background: var(--color-bg-dark);
    color: white;
    position: relative;
    overflow: hidden;
}

.reviews-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    pointer-events: none;
}

.reviews-section .section-header h2,
.reviews-section .section-description {
    color: white;
}

.reviews-slider {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.reviews-container {
    display: flex;
    gap: var(--spacing-lg);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: var(--spacing-sm);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.reviews-container::-webkit-scrollbar {
    display: none;
}

.review-card {
    flex: 0 0 100%;
    scroll-snap-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--card-border-radius);
    padding: var(--spacing-lg);
    text-align: center;
    transition: var(--transition-smooth);
}

.review-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
}

.review-rating {
    margin-bottom: var(--spacing-md);
    font-size: 1.5rem;
}

.review-rating .star {
    color: #ffd700;
    margin: 0 2px;
}

.review-rating .star:not(.filled) {
    color: rgba(255, 255, 255, 0.3);
}

.review-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
    font-style: italic;
    color: white;
}

.review-text p {
    margin: 0;
}

.review-author {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: var(--spacing-sm);
}

.author-name {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
    color: white;
}

.author-location {
    font-size: 0.9rem;
    opacity: 0.8;
    color: white;
}

.reviews-controls {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.reviews-prev,
.reviews-next {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
}

.reviews-prev:hover,
.reviews-next:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* ==========================================================================
   ANIMACIONES
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animaciones de entrada para elementos */
.category-card,
.about-item,
.review-card {
    animation: fadeInUp 0.6s ease-out;
}

.category-card:nth-child(even) {
    animation: slideInLeft 0.6s ease-out;
}

.category-card:nth-child(odd) {
    animation: slideInRight 0.6s ease-out;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1024px) {
    :root {
        --hero-height: 450px;
        --hero-min-height: 450px;
        --section-padding: 60px 0;
        --grid-gap: 25px;
    }
    
    .categories-grid,
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .about-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: var(--spacing-lg);
    }
}

@media (max-width: 768px) {
    :root {
        --hero-height: 400px;
        --hero-min-height: 400px;
        --section-padding: var(--section-padding-mobile);
        --grid-gap: 20px;
    }
    
    .hero-content {
        padding: 0 var(--spacing-sm);
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-controls {
        bottom: 20px;
        gap: 15px;
    }
    
    .hero-prev,
    .hero-next {
        width: 40px;
        height: 40px;
    }
    
    .categories-grid,
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .about-item {
        padding: var(--spacing-md);
    }
    
    .reviews-container {
        gap: var(--spacing-md);
    }
    
    .review-card {
        padding: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    :root {
        --hero-height: 350px;
        --hero-min-height: 350px;
        --section-padding: 40px 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-cta .btn {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .categories-grid,
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .category-image {
        height: 180px;
    }
    
    .about-illustration svg {
        width: 60px;
        height: 60px;
    }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-slide {
        transition: none;
    }
    
    .reviews-container {
        scroll-behavior: auto;
    }
}

/* Focus styles */
.hero-prev:focus,
.hero-next:focus,
.hero-indicator:focus,
.reviews-prev:focus,
.reviews-next:focus,
.category-link:focus,
.about-link:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .hero-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .category-card,
    .about-item,
    .review-card {
        border: 2px solid var(--color-text-dark);
    }
}

/* Print styles */
@media print {
    .hero-section,
    .reviews-section {
        display: none;
    }
    
    .categories-grid,
    .products-grid,
    .about-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .category-card,
    .about-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ======================================================================
   CTA de Inicio: botones sin animación, blancos con texto negro
   - "Ver todas las categorías" (sección categorías)
   - "Ver Todos" (productos destacados y nuevos)
   ====================================================================== */
.categories-section .section-cta .btn.btn-outline,
.featured-products-section .section-header-actions .btn.btn-outline {
    background: #3D1A24 !important;
    color: #f3f1f1 !important;
    border: 2px solid #ccc !important; /* borde gris */
    box-shadow: none !important;
    transition: var(--transition-smooth) !important; /* reactivar animación */
}

.categories-section .section-cta .btn.btn-outline:hover,
.featured-products-section .section-header-actions .btn.btn-outline:hover {
    background: #3D1A24 !important;
    color: #f3f1f1 !important;
    border-color: #bbb !important; /* borde gris ligeramente más oscuro */
    transform: translateY(-2px) !important; /* animación sutil */
}

.categories-section .section-cta .btn.btn-outline svg,
.featured-products-section .section-header-actions .btn.btn-outline svg {
    fill: #000 !important;
    stroke: #000 !important;
}