/* =================================
   CONFIGURACIÓN Y VARIABLES GLOBALES
   ================================= */
:root {
    --primary-color: #d1a3a3; /* Un rosa palo elegante */
    --secondary-color: #4a4a4a;
    --background-color: #fdfdfd; /* Se usará en secciones de contenido */
    --font-main: 'Montserrat', sans-serif;
    --font-headings: 'Playfair Display', serif;
}

body {
    font-family: var(--font-main);
    margin: 0;
    color: var(--secondary-color);
    background-color: transparent; /* El fondo lo manejará el video */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.9); /* Fondo blanco semitransparente para contenido */
    border-radius: 8px;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* =================================
   VIDEO DE FONDO GLOBAL (CON DESENFOQUE)
   ================================= */
#global-background-video {
    position: fixed; /* Lo fija en la pantalla */
    right: 0;
    bottom: 0;
    min-width: 100%; 
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -100; /* Lo envía detrás de todo el contenido */
    object-fit: cover; /* Asegura que cubra todo el espacio sin deformarse */
    filter: brightness(70%) blur(4px); /* Reduce brillo y aplica desenfoque */
}

.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Capa oscura al 50% */
    z-index: -99; /* Se posiciona entre el video y el contenido */
}


/* =================================
   HEADER Y NAVEGACIÓN
   ================================= */
.main-header {
    background-color: transparent;
    padding: 1rem 2rem;
    /* Al eliminar 'position: sticky', el header vuelve al flujo normal */
    z-index: 1000; 
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-nav .logo {
    font-family: var(--font-headings);
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff; /* Color blanco para que resalte */
    text-decoration: none;
}

.main-nav .desktop-nav {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
}

.main-nav a {
    text-decoration: none;
    color: #fff; /* Color blanco para que resalte */
    font-weight: 700;
    transition: color 0.3s ease;
    /* Sombra para legibilidad */
    text-shadow: 0px 1px 5px rgba(0, 0, 0, 0.7);
}

.main-nav a:hover, .cart-icon:hover {
    color: var(--primary-color);
}

/* Ocultamos el botón y el menú móvil en escritorio por defecto */
.nav-toggle,
.mobile-nav {
    display: none;
}


/* =================================
   SECCIÓN HERO (PORTADA)
   ================================= */
.hero-section {
    position: relative;
    height: 70vh; /* Altura reducida para no ocupar toda la pantalla */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 2rem;
}

.hero-content {
    animation: fadeIn 2s ease-in-out;
}

.hero-content h1 {
    font-family: var(--font-headings);
    font-size: 4rem;
    margin: 0;
    text-shadow: 0px 2px 8px rgba(0, 0, 0, 0.8);
}

.hero-content p {
    font-size: 1.2rem;
    text-shadow: 0px 2px 8px rgba(0, 0, 0, 0.8);
}

/* Contenido general de las páginas */
.content-section h2 {
    font-family: var(--font-headings);
    text-align: center;
    margin-bottom: 2rem;
}


/* =================================
   BOTONES Y COMPONENTES
   ================================= */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    margin: 1rem 0;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    background-color: #b88a8a;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #7f8c8d;
}
.btn-secondary:hover {
    background-color: #6c7a7b;
}

.btn-checkout {
    width: 100%;
    text-align: center;
    padding: 1rem;
    font-size: 1.2rem;
}

.price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}


/* =================================
   TIENDA - PRODUCT GRID
   ================================= */
.shop-page h1.shop-title {
    color: var(--secondary-color);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    text-align: center;
    padding: 0 1rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    margin-left: -1rem;
    margin-right: -1rem;
    width: calc(100% + 2rem);
}

.product-card h3 {
    font-family: var(--font-headings);
    margin: 1rem 0;
}

.product-card .add-to-cart-form .btn {
    margin: 0;
}


/* =================================
   PÁGINA DEL CARRITO
   ================================= */
.cart-page h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-family: var(--font-headings);
}

.cart-empty {
    text-align: center;
    padding: 4rem;
    background-color: #fff;
    border-radius: 10px;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.cart-table th, .cart-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.product-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
}

.quantity-input {
    width: 60px;
    padding: 0.5rem;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.remove-link {
    color: #e74c3c;
    text-decoration: none;
    font-size: 0.9rem;
}

.cart-actions {
    text-align: right;
    margin-bottom: 2rem;
}

.cart-summary {
    background-color: #f8f8f8;
    padding: 2rem;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}


/* =================================
   PÁGINA DE TALLERES
   ================================= */
.hero-workshops {
    padding: 4rem 2rem;
    text-align: center;
    background-color: rgba(248, 248, 248, 0.9);
    border-radius: 10px;
    margin-bottom: 3rem;
}

.section-title {
    text-align: center;
    font-family: var(--font-headings);
    font-size: 2rem;
    margin-bottom: 2rem;
}

.workshops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.workshop-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 1.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
}

.workshop-tag {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: bold;
}
.workshop-tag.online {
    background-color: #3498db;
}

.workshop-date {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 1rem;
}

.workshop-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}


/* =================================
   PANEL DE ADMINISTRACIÓN
   ================================= */
.admin-page h1 { text-align: center; }
.admin-section { margin-bottom: 3rem; }
.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}
.admin-section-header h2 { margin: 0; }
.table-responsive { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 1rem; border-bottom: 1px solid #eee; }

.actions-cell {
    display: flex;
    gap: 0.5rem; /* Espacio entre botones */
}
.btn-edit {
    background-color: #3498db; /* Azul */
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}
.btn-edit:hover {
    background-color: #2980b9;
}
.btn-delete {
    background-color: #e74c3c;
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}
.btn-delete:hover { background-color: #c0392b; }

.form-container { padding: 2rem; background: #f9f9f9; border-radius: 8px; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: .5rem; font-weight: 700; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: .8rem; border-radius: 4px; border: 1px solid #ccc; }

.alert { padding: 1rem; margin-bottom: 1rem; border-radius: 5px; font-weight: bold; }
.alert-success { background-color: #d4edda; color: #155724; }
.alert-danger { background-color: #f8d7da; color: #721c24; }


/* =================================
   FOOTER
   ================================= */
.main-footer {
    text-align: center;
    padding: 2rem;
    color: white;
    background-color: transparent;
    text-shadow: 0px 1px 4px rgba(0, 0, 0, 0.6);
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =================================================================
   DISEÑO RESPONSIVO - ADAPTACIÓN PARA TABLETS Y MÓVILES
   ================================================================= */

@media (max-width: 768px) {

    /* --- Ajustes Generales --- */
    .container {
        padding: 1rem;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    /* --- Menú de Navegación Móvil --- */
    .main-nav .desktop-nav {
        display: none; /* Ocultamos el menú de escritorio */
    }

    .nav-toggle {
        display: block; /* Mostramos el botón hamburguesa */
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 10px;
        z-index: 1001; /* Debe estar por encima de todo */
    }

    .hamburger {
        display: block;
        position: relative;
        width: 24px;
        height: 2px;
        background: white;
        transition: all 0.2s ease-in-out;
    }

    .hamburger::before,
    .hamburger::after {
        content: '';
        position: absolute;
        width: 24px;
        height: 2px;
        background: white;
        transition: all 0.2s ease-in-out;
    }

    .hamburger::before { top: -8px; }
    .hamburger::after { bottom: -8px; }

    .nav-toggle.is-active .hamburger {
        background: transparent; /* La línea del medio desaparece */
    }
    .nav-toggle.is-active .hamburger::before {
        transform: rotate(45deg) translate(5px, 6px);
    }
    .nav-toggle.is-active .hamburger::after {
        transform: rotate(-45deg) translate(5px, -6px);
    }


    .mobile-nav {
        display: block;
        position: fixed;
        top: 0;
        left: -100%; /* Oculto fuera de la pantalla */
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: rgba(25, 25, 25, 0.95);
        backdrop-filter: blur(10px);
        padding-top: 80px;
        transition: left 0.3s ease-in-out;
        z-index: 1000;
    }

    .mobile-nav.is-active {
        left: 0; /* Lo mostramos */
    }

    .mobile-nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-nav li a {
        display: block;
        padding: 1.5rem 2rem;
        color: white;
        text-decoration: none;
        font-size: 1.2rem;
        font-weight: bold;
    }

    /* --- Ajustes de Portada (Hero) --- */
    .hero-section {
        height: 60vh;
    }
    .hero-content h1 {
        font-size: 2.5rem; /* Reducimos el tamaño del título */
    }
    .hero-content p {
        font-size: 1rem;
    }


    /* --- Ajustes de Tablas (Admin y Carrito) --- */
    .table-responsive {
        /* Esto hace que si la tabla es muy ancha, se pueda deslizar horizontalmente */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
        border: 1px solid #ddd;
    }
    
    /* --- Ajustes de Formularios --- */
    .cart-summary {
        margin-left: 0;
        max-width: 100%;
    }
    
    .admin-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

}
/* =================================
   ESTILOS PARA STOCK AGOTADO (DISEÑO MEJORADO)
   ================================= */

/* El product-card ya tiene 'position: relative', lo que es perfecto. */

/* 1. La nueva etiqueta de "AGOTADO" en la esquina */
.stock-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #e74c3c; /* Un rojo notorio */
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 10;
    line-height: 1.5;
    /* La capa blanca ya no es necesaria, así que quitamos los estilos de tamaño completo */
}

/* 2. Reseteamos el estilo del texto interior por si acaso */
.stock-overlay span {
    background-color: transparent;
    transform: none;
    font-size: inherit;
    padding: 0;
}

/* 3. El efecto de indisponibilidad en la imagen */
/* Este selector inteligente aplica el estilo a la imagen SÓLO si el div 'stock-overlay' existe */
.stock-overlay ~ img {
    filter: grayscale(90%); /* La imagen se pone casi en blanco y negro */
    opacity: 0.7;           /* La hacemos un poco transparente */
}

/* 4. El estilo para el botón deshabilitado (sin cambios) */
.btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}
/* =================================
   ESTILOS PARA EL LOGO
   ================================= */
.logo-img {
    max-height: 150px; /* AUMENTAMOS EL TAMAÑO (antes era 50px) */
    width: auto;
    display: block;
    /* Efecto para que el logo resalte sobre el video */
    filter: drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.7));
    transition: transform 0.3s ease; /* Añadimos una transición suave */
}

.logo-img:hover {
    transform: scale(1.05); /* Efecto sutil al pasar el mouse */
}
/* --- Estilos para Marca en Tarjeta de Taller --- */
.workshop-card {
    padding-top: 50px; /* Hacemos espacio para el logo arriba */
}
.workshop-brand {
    position: absolute;
    top: -25px; /* Posicionamos el logo mitad adentro, mitad afuera */
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 50%;
    padding: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.workshop-brand img {
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
}
/* =================================
   ESTILOS PARA FOOTER CON REDES SOCIALES
   ================================= */
.main-footer {
    padding: 2.5rem 1rem;
    color: white;
    background-color: transparent;
    text-shadow: 0px 1px 4px rgba(0, 0, 0, 0.6);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-title {
    margin: 0 0 1rem 0;
    font-weight: bold;
    font-size: 1.1rem;
}

.footer-social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: white;
    font-weight: bold;
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-link:hover {
    transform: scale(1.1);
}

.social-link.lovedalia-link:hover {
    color: #f8cdda; /* Un rosa claro al pasar el mouse */
}
.social-link.chanita-link:hover {
    color: #e6cba8; /* Un color tierra claro al pasar el mouse */
}

.social-link svg {
    width: 24px;
    height: 24px;
}

.copyright-text {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.7;
}


/* =================================
   ESTILOS SECCIÓN PROMO EN PÁGINA
   ================================= */
.social-promo-section {
    text-align: center;
    padding: 2rem;
    background-color: rgba(255,255,255,0.9);
    border-radius: 8px;
    margin-top: 2rem;
}

.social-promo-section h2 {
    font-family: var(--font-headings);
    margin-top: 0;
}

.social-promo-section .footer-social-links a {
    color: var(--secondary-color); /* Color oscuro para que se lea bien */
    text-shadow: none;
    font-size: 1.2rem;
}
/* =================================
   NUEVO DISEÑO PARA PÁGINA DE EVENTOS (CORREGIDO)
   ================================= */

.events-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.event-card-new {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    padding: 1rem; /* CAMBIO: Añadimos un margen interno a toda la tarjeta */
    gap: 1.5rem;
}

.event-card-new:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.event-image {
    flex: 0 0 180px;
    width: 180px;
    height: 180px;
    object-fit: cover;
    order: 2; /* CAMBIO: Movemos la imagen a la derecha (segunda posición) */
    border-radius: 8px; /* CAMBIO: Redondeamos las esquinas de la foto */
}

.event-content {
    padding: 0; /* Quitamos el padding viejo para no duplicar */
    flex: 1;
    order: 1; /* CAMBIO: Movemos el texto a la izquierda (primera posición) */
}

.event-content h3 {
    font-family: var(--font-headings);
    color: var(--primary-color);
    margin-top: 0;
    font-size: 1.5rem;
}

.event-content p {
    margin: 0.5rem 0;
    color: #555;
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Ocultamos el diseño antiguo (si aún existe) */
.event-card {
    display: none;
}


/* --- Adaptación para celulares --- */
@media (max-width: 600px) {
    .event-card-new {
        flex-direction: column;
        padding: 0; /* Quitamos padding para que la imagen ocupe todo el ancho */
        gap: 0;
    }

    .event-image {
        width: 100%;
        height: 180px;
        flex-basis: auto;
        order: 1; /* En móvil, la imagen va primero (arriba) */
        border-radius: 0;
    }
    
    .event-content {
        order: 2; /* En móvil, el texto va segundo (abajo) */
        padding: 1.5rem;
    }
}
/* =================================
   SECCIÓN DE PACKING - INDEX.PHP
   ================================= */

.packing-section {
    display: flex;
    align-items: center;
    gap: 3rem; /* Espacio entre la imagen y el texto */
    margin-top: 0; /* Lo pegamos a la sección de arriba */
}

.packing-image-container,
.packing-text-container {
    flex: 1; /* Hacemos que ambos contenedores ocupen el 50% del espacio */
    min-width: 300px; 
}

.packing-image-container img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.packing-text-container h2 {
    font-family: var(--font-headings);
    color: var(--primary-color);
    font-size: 2.2rem;
    margin-top: 0;
}

.packing-text-container p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
}


/* --- Adaptación para celulares y tablets --- */
@media (max-width: 768px) {
    .packing-section {
        flex-direction: column; /* Ponemos la imagen encima del texto */
        gap: 2rem;
    }
    
    .packing-text-container h2 {
        text-align: center;
    }
}
/* --- Estilo unificado para subtítulos con emojis --- */
.content-section h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Espacio entre el emoji y el texto */
    font-family: var(--font-headings);
    color: var(--secondary-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}
.image-search-wrapper {
    display: flex;
    gap: 0.5rem;
}
.image-search-wrapper input {
    flex-grow: 1;
}
.image-search-wrapper button {
    margin: 0;
    flex-shrink: 0;
}
/* --- Estilos para Fecha y Hora en Tarjeta de Taller --- */

.workshop-date, .workshop-time, .workshop-address {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.5rem; /* Reducimos el espacio inferior */
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Quitamos el margen superior de la descripción para que todo quede más junto */
.workshop-card p:not([class]) {
    margin-top: 1rem;
}
/* =================================
   ESTILOS PÁGINA DE DESPACHOS (CORREGIDO)
   ================================= */
.shipping-section {
    margin-bottom: 3rem;
}
.shipping-section h2 {
    font-family: var(--font-headings);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}
.shipping-content-wrapper {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.shipping-map, .shipping-rates {
    flex: 1;
    min-width: 300px;
}
.shipping-map img {
    width: 100%;
    border-radius: 8px;
    margin-top: 1rem;
}
.rates-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}
.rates-table th, .rates-table td {
    border: 1px solid #ddd;
    padding: 0.8rem;
    text-align: left;
}
.rates-table th {
    background-color: #f8f8f8;
}

/* --- NUEVOS ESTILOS PARA LOS MÉTODOS DE ENVÍO --- */
.shipping-methods-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    text-align: center;
}

.method-card {
    background: #f9f9f9;
    padding: 2rem 1.5rem;
    border-radius: 8px;
    border: 1px solid #eee;
}

.method-logo {
    height: 80px; /* Altura fija para alinear los logos */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.method-logo img {
    max-height: 100%;
    max-width: 200px; /* Ancho máximo para que no se escapen */
    width: auto;
}

.method-card h4 {
    font-family: var(--font-headings);
    margin-top: 0;
    margin-bottom: 0.5rem;
}