:root {
    --mapfre-red: #d81e05;
    --mapfre-red-dark: #8a1203;
    --christmas-green: #2e7d32;
    --christmas-gold: #fbc02d;
    --christmas-blue: #00bcd4;
    --white: #ffffff;
    --light-bg: #f5f5f5;
    --wood-texture: #3e2723;
    --text-color: #333;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: #ffffff;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Curved Christmas Lights */
.lights-container {
    position: absolute;
    bottom: -35px;
    /* Hang below the text */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    /* Match text width approx */
    height: 60px;
    z-index: 10;
    pointer-events: none;
}

.wire {
    position: absolute;
    top: -40px;
    left: 0;
    width: 100%;
    height: 80px;
    border-bottom: 3px solid #333;
    border-radius: 50%;
}

.bulbs {
    position: absolute;
    top: 38px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 0 40px;
    list-style: none;
}

.bulbs li {
    position: relative;
    width: 16px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    animation-fill-mode: both;
    animation-iteration-count: infinite;
    animation-duration: 1.5s;
}

/* Bulb Socket */
.bulbs li::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 6px;
    background: #333;
    border-radius: 2px;
}

/* Colors */
.bulbs li:nth-child(1) {
    background: #fff;
    animation-name: flash-white;
    animation-delay: 0s;
}

.bulbs li:nth-child(2) {
    background: var(--christmas-gold);
    animation-name: flash-gold;
    animation-delay: 0.5s;
}

.bulbs li:nth-child(3) {
    background: var(--christmas-blue);
    animation-name: flash-blue;
    animation-delay: 1s;
}

.bulbs li:nth-child(4) {
    background: var(--christmas-green);
    animation-name: flash-green;
    animation-delay: 0.2s;
}

.bulbs li:nth-child(5) {
    background: #fff;
    animation-name: flash-white;
    animation-delay: 0.7s;
}

.bulbs li:nth-child(6) {
    background: var(--christmas-gold);
    animation-name: flash-gold;
    animation-delay: 1.2s;
}

.bulbs li:nth-child(7) {
    background: var(--christmas-blue);
    animation-name: flash-blue;
    animation-delay: 0.3s;
}

.bulbs li:nth-child(8) {
    background: var(--christmas-green);
    animation-name: flash-green;
    animation-delay: 0.8s;
}

@keyframes flash-red {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 20px var(--mapfre-red);
    }

    50% {
        opacity: 0.4;
        box-shadow: none;
    }
}

@keyframes flash-white {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 15px #fff;
    }

    50% {
        opacity: 0.4;
        box-shadow: none;
    }
}

@keyframes flash-gold {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 15px var(--christmas-gold);
    }

    50% {
        opacity: 0.4;
        box-shadow: none;
    }
}

@keyframes flash-blue {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 15px var(--christmas-blue);
    }

    50% {
        opacity: 0.4;
        box-shadow: none;
    }
}

@keyframes flash-green {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 15px var(--christmas-green);
    }

    50% {
        opacity: 0.4;
        box-shadow: none;
    }
}

/* Header */
header {
    position: relative;
    background-color: var(--mapfre-red);
    /* Red Background */
    color: var(--white);
    text-align: center;
    padding: 3rem 1rem 4rem;
    /* Extra bottom padding for lights */
    box-shadow: 0 10px 25px rgba(216, 30, 5, 0.3);
    /* Red-tinted shadow for glow */
    border-bottom-left-radius: 50px;
    /* More rounded as per image */
    border-bottom-right-radius: 50px;
    margin-bottom: 4rem;
    text-shadow: none;
}

header h1 {
    position: relative;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3.5rem;
    /* Increased to make room for lights */
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--white);
    /* White text on red */
    display: inline-block;
    /* For lights positioning */
    max-width: 90%;
    /* Prevent overflow */
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
        /* Smaller on mobile */
        margin-bottom: 3rem;
    }

    .lights-container {
        width: 120%;
        /* Wider to drape nicely */
        left: -10%;
        /* Center it relative to the wider width */
        transform: none;
        bottom: -25px;
        height: 40px;
    }

    .wire {
        height: 50px;
        top: -25px;
    }

    .bulbs {
        top: 25px;
        padding: 0 10px;
    }

    .bulbs li {
        width: 12px;
        height: 18px;
    }
}

header h2 {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.contact-info {
    background: rgba(255, 255, 255, 0.2);
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: none;
}

.delegate {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--white);
}

.phone-btn {
    display: inline-block;
    background-color: var(--white);
    color: var(--mapfre-red);
    text-decoration: none;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.phone-btn:hover {
    transform: scale(1.05);
    background-color: #f0f0f0;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background-color: #f0f0f0;
    color: #666;
    font-size: 0.9rem;
    margin-top: 4rem;
    border-top: 1px solid #ddd;
}

footer p {
    margin: 0.3rem 0;
}

main {
    max-width: 1100px;
    margin: 0 auto 4rem;
    padding: 0 1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    grid-auto-flow: dense;
    /* Important for irregular sizes */
    gap: 1.5rem;
}

/* Irregular Sizes */
.day-card.wide {
    grid-column: span 2;
}

.day-card.tall {
    grid-row: span 2;
}

.day-card.big {
    grid-column: span 2;
    grid-row: span 2;
}

/* 3D Door Effect */
.day-card {
    perspective: 1000px;
    position: relative;
    aspect-ratio: 1 / 1;
    /* Default aspect ratio */
    cursor: pointer;
    z-index: 1;
}

.day-card.wide {
    aspect-ratio: 2 / 1;
}

.day-card.tall {
    aspect-ratio: 1 / 2;
}

.day-card.big {
    aspect-ratio: 1 / 1;
}

.door {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-origin: left;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.day-card:hover .door {
    /* Slight open on hover if not locked */
    /* transform: rotateY(-15deg); */
}

.day-card.opened .door {
    transform: rotateY(-50deg);
    /* Half open */
}

/* Content Behind Door */
.day-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
    text-align: center;
    z-index: 0;
    /* Behind door */
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.reward-preview {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--mapfre-red);
    margin-bottom: 5px;
    line-height: 1.2;
}

.click-hint {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
}

.day-card.locked {
    cursor: not-allowed;
    filter: grayscale(0.8);
}

/* Door Front & Back */
.door-front,
.door-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    /* Hide back when facing away */
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.door-front {
    background: linear-gradient(135deg, #d81e05 0%, #9e1b05 100%);
    color: #fff;
    border: 2px solid #fff;
    z-index: 2;
}

/* Pattern on door front */
.door-front::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px dashed rgba(255, 255, 255, 0.5);
    border-radius: 5px;
}

.door-back {
    background-color: #5d4037;
    /* Wood texture color */
    transform: rotateY(180deg);
    color: #fff;
    font-weight: bold;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* When door is half open (-50deg), we see the front at an angle. 
   Wait, if we rotateY(-50deg), we see the FRONT face angled. 
   We do NOT see the back face unless we rotate > 90deg.
   So 'backface-visibility: hidden' on front means we see it.
   The user said "salga la misma puerta sin abrir pero medio abierta".
   So seeing the front face angled is correct.
*/

.day-number {
    font-size: 2.5rem;
    font-weight: 800;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
}

.door-label {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.day-card.locked .door-front {
    background: #444;
    border-color: #666;
}

.day-card.locked .door-label {
    content: 'Cerrado';
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 15px;
    max-width: 500px;
    text-align: center;
    position: relative;
    border: 4px solid var(--mapfre-red);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    cursor: pointer;
    color: #888;
}

.cta-button {
    display: inline-block;
    background: var(--mapfre-red);
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 1rem;
    transition: 0.3s;
}

.cta-button:hover {
    background: var(--mapfre-red-dark);
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 600px) {
    .calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    header h1 {
        font-size: 2rem;
    }

    .christmas-lights li {
        margin: 0 5px;
    }
}