/* Navidad Modal Styles */
.navidad-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.navidad-modal.show {
    display: block;
    animation: fadeIn 0.4s ease-in-out forwards;
}

.navidad-modal.hide {
    animation: fadeOut 0.4s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.navidad-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.navidad-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    min-height: 500px;
}

.navidad-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #333;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
    line-height: 1;
    font-weight: 300;
}

.navidad-modal-close:hover {
    background: #f0f0f0;
    transform: rotate(90deg);
}

/* Steps */
.navidad-step {
    display: none;
    width: 100%;
    opacity: 0;
}

.navidad-step.active {
    display: flex;
    animation: slideIn 0.5s ease-in-out forwards;
}

.navidad-step.slide-out {
    animation: slideOut 0.5s ease-in-out forwards;
}

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

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

/* Step 1 & 2 Layout */
.navidad-modal-left,
.navidad-modal-right {
    width: 50%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.navidad-modal-left {
    background: #f8f8f8;
    border-radius: 12px 0 0 12px;
}

.navidad-modal-left.navidad-image-bg {
    padding: 0;
    position: relative;
    overflow: hidden;
}

.navidad-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    position: absolute;
    top: 0;
    left: 0;
}

/* Step 2 specific image positioning */
.navidad-step-2 .navidad-bg-image {
    object-position: center -72px;
}

.navidad-logo {
    max-width: 100%;
    height: auto;
    padding: 20px;
}

.navidad-modal-right {
    text-align: center;
}

/* Typography */
.navidad-title {
    font-size: 42px;
    font-weight: 300;
    color: #436754;
    margin-bottom: 20px;
    letter-spacing: 2px;
    font-family: 'Georgia', serif;
}

.navidad-subtitle {
    font-size: 18px;
    color: #5a8268;
    margin-bottom: 40px;
    line-height: 1.6;
    font-weight: 300;
}

.navidad-step-title {
    font-size: 32px;
    font-weight: 300;
    color: #436754;
    margin-bottom: 40px;
    letter-spacing: 1px;
    font-family: 'Georgia', serif;
}

/* Buttons */
.navidad-btn {
    padding: 14px 40px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.navidad-btn-primary {
    background: #436754;
    color: white;
}

.navidad-btn-primary:hover {
    background: #5a8268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 103, 84, 0.3);
}

.navidad-btn-secondary {
    background: white;
    color: #436754;
    border: 1px solid white;
    text-decoration: none;
    display: inline-block;
}

.navidad-btn-secondary:hover {
    background: #5a8268;
    color: white;
    border-color: #5a8268;
}

.navidad-btn-selection {
    background: transparent;
    color: #436754;
    padding: 18px 50px;
    font-size: 18px;
    border: none;
    border-top: 1px solid #436754;
    border-bottom: 1px solid #436754;
    border-radius: 0;
}

.navidad-btn-selection:hover {
    background: rgba(67, 103, 84, 0.05);
    border-top: 2px solid #436754;
    border-bottom: 2px solid #436754;
    transform: translateY(0);
    box-shadow: none;
}

/* Step 3: Form */
.navidad-modal-full {
    width: 100%;
    padding: 50px;
}

.navidad-menu-invite {
    background: linear-gradient(135deg, #436754 0%, #5a8268 100%);
    padding: 35px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(67, 103, 84, 0.2);
    position: relative;
    overflow: hidden;
}

.navidad-menu-invite::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}

.navidad-invite-title {
    color: white;
    font-size: 24px;
    font-weight: 300;
    margin-bottom: 12px;
    letter-spacing: 1px;
    font-family: 'Georgia', serif;
    position: relative;
    z-index: 1;
}

.navidad-menu-invite p {
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

.navidad-menu-invite .navidad-btn-secondary {
    position: relative;
    z-index: 1;
}

.navidad-form-container {
    background: #2a2a2a;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.navidad-form {
    max-width: 600px;
    margin: 0 auto;
}

.navidad-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.navidad-form-row .navidad-form-group {
    flex: 1;
    margin-bottom: 0;
}

.navidad-form-group {
    margin-bottom: 25px;
}

.navidad-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #e0e0e0;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.navidad-form-group input,
.navidad-custom-select select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    font-family: inherit;
    background: white;
    box-sizing: border-box;
}

.navidad-form-group input:focus,
.navidad-custom-select select:focus {
    outline: none;
    border-color: #436754;
    box-shadow: 0 0 0 3px rgba(67, 103, 84, 0.1);
}

.navidad-custom-select {
    position: relative;
}

.navidad-custom-select::after {
    content: '▼';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #555;
    font-size: 12px;
}

.navidad-custom-select select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: 40px;
}

/* Phone Input Styles */
.navidad-phone-wrapper {
    display: flex;
    gap: 34px;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    flex-direction: row;
}

.navidad-country-selector {
    position: relative;
    width: 35px;
    flex-shrink: 0;
}

.navidad-country-selected {
    width: 100%;
    padding: 8px;
    font-size: 28px;
    border: 2px solid #436754;
    border-radius: 8px;
    background-color: white;
    cursor: pointer;
    text-align: center;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    transition: all 0.3s ease;
}

.navidad-country-selected:hover {
    border-color: #5a8268;
    box-shadow: 0 0 0 3px rgba(67, 103, 84, 0.1);
}

.navidad-country-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: -75px;
    width: 250px;
    margin-top: 5px;
    background: white;
    border: 2px solid #436754;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.navidad-country-dropdown::-webkit-scrollbar {
    width: 8px;
}

.navidad-country-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.navidad-country-dropdown::-webkit-scrollbar-thumb {
    background: #436754;
    border-radius: 4px;
}

.navidad-country-dropdown::-webkit-scrollbar-thumb:hover {
    background: #5a8268;
}

.navidad-country-option {
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.navidad-country-option:hover {
    background-color: rgba(67, 103, 84, 0.1);
}

.navidad-country-flag {
    font-size: 20px;
}

.navidad-country-code {
    font-weight: 600;
    color: #436754;
    min-width: 45px;
}

.navidad-country-name {
    color: #5a8268;
}

.navidad-phone-inputs {
    display: flex;
    gap: 2px;
    align-items: center;
}

.navidad-phone-digit {
    width: 30px !important;
    height: 40px !important;
    padding: 0 !important;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    border: 2px solid #436754 !important;
    border-radius: 6px !important;
    background-color: white !important;
    color: #2c3e50 !important;
    outline: none;
    transition: all 0.3s ease;
}

.navidad-phone-digit:focus {
    border-color: #5a8268 !important;
    box-shadow: 0 0 0 3px rgba(67, 103, 84, 0.1) !important;
}

@media (max-width: 768px) {
    .navidad-phone-wrapper {
        flex-direction: row;
    }

    .navidad-country-dropdown {
        left: 0;
    }

    .navidad-phone-digit {
        width: 28px !important;
        height: 38px !important;
        font-size: 18px;
    }
}

.navidad-btn-submit {
    width: 100%;
    margin-top: 20px;
    padding: 16px;
    font-size: 18px;
}

/* Steps 1-3 Layout - Ensure they remain in two-column layout */
.navidad-step-1,
.navidad-step-2,
.navidad-step-3 {
    flex-direction: row;
}

/* Step 4: Success - Only apply when active */
.navidad-step-4.active {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    flex-direction: row;
}

.navidad-success-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.navidad-success-message {
    font-size: 20px;
    line-height: 1.8;
    color: #2c3e50;
    margin-bottom: 40px;
    font-weight: 300;
}

.navidad-success-message strong {
    color: #436754;
    font-size: 24px;
    display: block;
    margin-top: 20px;
}

.navidad-success-logo {
    max-width: 300px;
    height: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .navidad-modal-content {
        width: 95%;
        max-height: 95vh;
        flex-direction: column;
    }

    .navidad-step-1,
    .navidad-step-2 {
        flex-direction: column;
    }

    .navidad-modal-left,
    .navidad-modal-right {
        width: 100%;
        padding: 30px 20px;
    }

    .navidad-modal-left {
        border-radius: 12px 12px 0 0;
    }

    .navidad-modal-left.navidad-image-bg {
        min-height: 250px;
    }

    .navidad-form-container {
        padding: 30px 20px;
    }

    .navidad-form-row {
        flex-direction: column;
        gap: 0;
    }

    .navidad-form-row .navidad-form-group {
        margin-bottom: 25px;
    }

    .navidad-title {
        font-size: 32px;
    }

    .navidad-subtitle {
        font-size: 16px;
    }

    .navidad-step-title {
        font-size: 24px;
    }

    .navidad-modal-full {
        padding: 30px 20px;
    }

    .navidad-logo {
        max-width: 200px;
    }
}

/* Small screens optimization (200px to 640px) */
@media (max-width: 640px) {
    .navidad-modal-content {
        height: 90%;
        max-height: 90%;
        overflow-y: auto;
        overflow-x: hidden;
        flex-direction: column;
        box-sizing: border-box;
    }

    /* Prevent any child from causing horizontal overflow */
    .navidad-step {
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .navidad-modal-left,
    .navidad-modal-right,
    .navidad-modal-full {
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    /* Step 1 & 2 - Change to column layout with 50% height each */
    .navidad-step-1,
    .navidad-step-2 {
        flex-direction: column;
        height: 100%;
        box-sizing: border-box;
    }

    .navidad-step-1 .navidad-modal-left,
    .navidad-step-1 .navidad-modal-right,
    .navidad-step-2 .navidad-modal-left,
    .navidad-step-2 .navidad-modal-right {
        width: 100%;
        height: 50%;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Step 1 specific adjustments */
    .navidad-step-1 .navidad-modal-left.navidad-image-bg {
        min-height: 50%;
        max-height: 50%;
        padding: 0;
    }

    .navidad-step-1 .navidad-modal-right {
        padding: 20px 15px;
        flex-direction: column;
        text-align: center;
    }

    .navidad-step-1 .navidad-title {
        font-size: 28px;
        margin-bottom: 15px;
    }

    .navidad-step-1 .navidad-subtitle {
        font-size: 14px;
        margin-bottom: 25px;
    }

    .navidad-step-1 .navidad-btn-primary {
        padding: 12px 30px;
        font-size: 15px;
    }

    /* Step 2 adjustments */
    .navidad-step-2 .navidad-modal-left.navidad-image-bg {
        min-height: 50%;
        max-height: 50%;
        padding: 0;
    }

    .navidad-step-2 .navidad-modal-right {
        padding: 20px 15px;
        flex-direction: column;
        text-align: center;
    }

    .navidad-step-2 .navidad-step-title {
        font-size: 22px;
        margin-bottom: 25px;
    }

    .navidad-step-2 .navidad-btn-selection {
        padding: 14px 35px;
        font-size: 16px;
    }

    /* Step 3 form adjustments */
    .navidad-modal-full {
        padding: 20px 15px;
    }

    .navidad-menu-invite {
        padding: 25px 20px;
        margin-bottom: 25px;
    }

    .navidad-invite-title {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .navidad-menu-invite p {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .navidad-form-container {
        padding: 25px 15px;
    }

    .navidad-form-row {
        margin-bottom: 0px;
    }

    .navidad-form-group {
        margin-bottom: 20px;
        box-sizing: border-box;
        width: 100%;
    }

    .navidad-form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .navidad-form-group input,
    .navidad-custom-select select {
        padding: 10px 14px;
        font-size: 16px;
        box-sizing: border-box;
    }

    .navidad-phone-wrapper {
        gap: 8px;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
        padding: 0 5px;
    }

    .navidad-country-selector {
        width: 28px;
        flex-shrink: 0;
    }

    .navidad-country-selected {
        font-size: 18px;
        height: 20px;
        padding: 2px;
    }

    .navidad-phone-digit {
        width: 24px !important;
        height: 34px !important;
        font-size: 16px;
    }

    .navidad-phone-inputs {
        gap: 1px;
    }

    .navidad-btn-submit {
        padding: 14px;
        font-size: 16px;
        margin-top: 0;
    }

    /* Close button adjustment */
    .navidad-modal-close {
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 24px;
        background: white;
        border-radius: 6px;
    }

    /* Step 4 - Center on Y axis for small screens */
    .navidad-step-4 {
        justify-content: center;
        align-items: center;
    }

    .navidad-success-container {
        padding: 20px;
    }

    .navidad-success-message {
        font-size: 16px;
        margin-bottom: 30px;
    }

    .navidad-success-logo {
        max-width: 200px;
    }
}

/* Extra small screens (200px to 400px) */
@media (max-width: 400px) {
    .navidad-modal-content {
        width: 98%;
    }

    .navidad-step-1 .navidad-title {
        font-size: 24px;
    }

    .navidad-phone-digit {
        width: 24px !important;
        height: 34px !important;
        font-size: 14px;
    }

    .navidad-phone-wrapper {
        gap: 10px;
    }
}

/* Scrollbar styling */
.navidad-modal-content::-webkit-scrollbar {
    width: 8px;
}

.navidad-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 12px 12px 0;
}

.navidad-modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.navidad-modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}
