/* 
 * Hoja de estilos principal para Jornadas Higopico
 * Comentarios: Se definen variables para mantener la consistencia visual y se implementa 
 * un diseño moderno, responsive y con animaciones suaves (microinteracciones).
 */

:root {
    /* Paleta de colores */
    --color-primary: #748334; /* Verde oliva del cartel */
    --color-primary-light: #8e9e48;
    --color-primary-dark: #5c6928;
    --color-accent: #e48a5c; /* Terracota cálido para contrastar */
    --color-bg: #fcfbf8; /* Crema/Off-white cálido */
    --color-bg-alt: #f0eedc; /* Fondo alternativo más oscuro */
    --color-text: #2c331a; /* Texto oscuro con tinte verde */
    --color-text-light: #596144;
    --color-white: #ffffff;
    
    /* Sombras y bordes */
    --shadow-sm: 0 4px 6px rgba(116, 131, 52, 0.08);
    --shadow-md: 0 10px 25px rgba(116, 131, 52, 0.12);
    --shadow-lg: 0 20px 40px rgba(116, 131, 52, 0.18);
    --border-radius: 16px;
    --border-radius-sm: 8px;

    /* Tipografía */
    --font-main: 'Outfit', sans-serif;
    
    /* Transiciones */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Tipografía general */
h1, h2, h3, h4 {
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Contenedor principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-main);
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 0.8rem 1.5rem;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background-color: var(--color-bg-alt);
    color: var(--color-primary-dark);
    padding: 0.6rem 1rem;
}

.btn-secondary:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn-large {
    font-size: 1.1rem;
    padding: 1rem 2rem;
    border-radius: 50px;
}

.btn-sm {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
}

.btn-full {
    width: 100%;
}

/* Cabecera (Header) */
.main-header {
    background-color: rgba(252, 251, 248, 0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(116, 131, 52, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.header-logo {
    height: 60px;
}

.header-title {
    font-weight: 800;
    color: var(--color-primary-dark);
    font-size: 1.2rem;
}

.btn-cart {
    background-color: var(--color-white);
    border: 2px solid var(--color-primary-light);
    color: var(--color-primary-dark);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 1rem;
    position: relative;
}

.btn-cart:hover {
    background-color: var(--color-primary-light);
    color: var(--color-white);
}

.cart-badge {
    background-color: var(--color-accent);
    color: var(--color-white);
    font-size: 0.8rem;
    font-weight: 800;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: absolute;
    top: -8px;
    right: -8px;
    border: 2px solid var(--color-bg);
}

/* Sección Hero */
.hero {
    padding: 4rem 0;
    background: var(--color-primary);
    position: relative;
    overflow: hidden;
}

/* Efecto de fondo orgánico para darle un toque infantil/creativo */
.hero::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -5%;
    width: 400px;
    height: 400px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    animation: morph 8s ease-in-out infinite;
    z-index: 0;
}

@keyframes morph {
    0%, 100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
    34% { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; }
    67% { border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%; }
}

.hero-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-main-logo {
    max-width: 90%;
    width: 500px; /* Tamaño máximo razonable */
    margin: 0 auto 1.5rem auto;
    filter: drop-shadow(0 10px 15px rgba(116, 131, 52, 0.15));
    animation: fadeInDown 0.8s ease-out;
}

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

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 12px;
    background-color: rgba(228, 138, 92, 0.3);
    z-index: -1;
    border-radius: 4px;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 1rem 0 2rem;
}

.hero-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.detail-badge {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
    color: var(--color-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.add-invitation-btn {
    font-size: 1.25rem;
    padding: 1.1rem 2.5rem;
    margin-top: 1rem;
    background-color: var(--color-accent);
    color: var(--color-white);
    animation: pulse 2s infinite;
}

.add-invitation-btn:hover:not(:disabled) {
    background-color: #d67a4c;
    color: var(--color-white);
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(228, 138, 92, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(228, 138, 92, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(228, 138, 92, 0); }
}

/* Sección Ponentes */
.speakers-section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--color-primary-dark);
    margin-bottom: 3rem;
}

.speakers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.speaker-card {
    background-color: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

.speaker-image-wrapper {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.speaker-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.5s ease;
}

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

.speaker-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: var(--color-white);
    padding: 2rem 1rem 1rem;
    font-weight: 600;
    transform: translateY(10px);
    opacity: 0;
    transition: all var(--transition-normal);
}

.speaker-card:hover .speaker-overlay {
    transform: translateY(0);
    opacity: 1;
}

.speaker-info {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.speaker-info h3 {
    font-size: 1.5rem;
    color: var(--color-primary-dark);
}

.speaker-profession {
    color: var(--color-accent);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.speaker-talk {
    font-size: 0.95rem;
    color: var(--color-text-light);
}

.speaker-books {
    padding: 1.5rem;
    background-color: rgba(116, 131, 52, 0.02);
}

.speaker-books h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.book-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    position: relative;
    background: var(--color-white);
    padding: 0.8rem;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-sm);
}

.book-item:last-child {
    margin-bottom: 0;
}

.book-cover {
    width: 60px;
    height: 85px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.book-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.book-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.book-price {
    color: var(--color-primary);
    font-weight: 800;
    margin-bottom: 0.5rem;
}

/* Insignia de Novedad */
.highlighted-book {
    border: 2px solid var(--color-accent);
}

.badge-novedad {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--color-accent);
    color: var(--color-white);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
    animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.26, 1.55) forwards;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* Carrito Off-canvas */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.shopping-cart {
    position: fixed;
    top: 0;
    bottom: 0;
    right: -400px;
    width: 400px;
    max-width: 100vw;
    background-color: var(--color-white);
    z-index: 1000;
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}

.shopping-cart.open {
    right: 0;
}

.cart-header {
    flex-shrink: 0;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-bg);
}

.cart-header h2 {
    font-size: 1.5rem;
    color: var(--color-primary-dark);
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-light);
    transition: color var(--transition-fast);
}

.close-btn:hover {
    color: var(--color-accent);
}

.cart-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Gamificación descuentos */
.discount-progress-container {
    background-color: var(--color-bg-alt);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
}

.discount-message {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    text-align: center;
    color: var(--color-primary-dark);
}

.progress-bar-bg {
    height: 12px;
    background-color: rgba(116, 131, 52, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary));
    width: 0%;
    transition: width 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.discount-tiers {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--color-text-light);
}

.cart-items-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Elementos dentro del carrito */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.cart-item-price {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--color-bg);
    border-radius: 50px;
    padding: 0.2rem;
}

.qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background-color: var(--color-white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    font-weight: bold;
    color: var(--color-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background-color: var(--color-primary-light);
    color: var(--color-white);
}

.item-qty {
    font-weight: 800;
    font-size: 0.9rem;
    width: 20px;
    text-align: center;
}

/* Totales */
.cart-totals {
    margin-top: auto;
    background-color: var(--color-white);
    padding: 1.5rem;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--color-text-light);
}

.discount-row {
    color: var(--color-accent);
    font-weight: 600;
}

.grand-total {
    border-top: 2px dashed rgba(116, 131, 52, 0.2);
    padding-top: 1rem;
    margin-top: 0.5rem;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-primary-dark);
}

.cart-footer {
    flex-shrink: 0;
    padding: 1.5rem;
    background-color: var(--color-bg);
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .shopping-cart {
        width: 100%;
        right: -100%;
    }
}

.site-footer,
.legal-footer {
    background: var(--color-primary-dark);
    color: var(--color-white);
    padding: 1.4rem 1.5rem;
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.site-footer a,
.site-footer button,
.legal-footer a,
.legal-footer button {
    color: var(--color-white);
    background: transparent;
    border: 0;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.site-footer a:hover,
.site-footer button:hover,
.legal-footer a:hover,
.legal-footer button:hover {
    color: var(--color-accent);
}

.legal-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
}

.legal-footer-inner span {
    display: block;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
}

.legal-footer nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.85rem;
}

.legal-body {
    background: var(--color-bg);
    min-height: 100vh;
}

.legal-header {
    background: var(--color-white);
    border-bottom: 1px solid rgba(116, 131, 52, 0.16);
    padding: 1rem 1.5rem;
    text-align: center;
}

.legal-header img {
    width: min(220px, 70vw);
    height: auto;
}

.legal-page {
    width: min(920px, calc(100% - 2rem));
    margin: 2.5rem auto;
    background: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: clamp(1.5rem, 4vw, 3rem);
}

.legal-page h1 {
    color: var(--color-primary-dark);
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1.5rem;
}

.legal-page h2 {
    color: var(--color-primary-dark);
    font-size: 1.25rem;
    margin-top: 1.8rem;
    margin-bottom: 0.6rem;
}

.legal-page p {
    color: var(--color-text);
    line-height: 1.7;
    margin-bottom: 0.8rem;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.legal-table th,
.legal-table td {
    border-bottom: 1px solid rgba(116, 131, 52, 0.18);
    padding: 0.8rem;
    text-align: left;
    vertical-align: top;
}

.legal-table th {
    color: var(--color-primary-dark);
    background: var(--color-bg-alt);
}

@media (max-width: 768px) {
    .legal-footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .legal-footer nav {
        justify-content: flex-start;
    }
}
