/* --- MODAL SYSTEM --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(44, 36, 27, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-medium);
    padding: 20px;
}

.mobile-br {
    display: none;
}

@media (max-width: 600px) {
    .mobile-br {
        display: block;
    }
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    max-width: 400px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform var(--transition-medium);
    border: 1px solid var(--border);
}

.modal-overlay:not(.hidden) .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* --- UPSELL STYLES --- */
.upsell-tag {
    background: #5B1414;
    color: white;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 1px;
}

.upsell-header h2 {
    margin: 10px 0 20px;
    font-size: 1.4rem;
}

.upsell-image {
    margin-bottom: 15px;
    width: 100%;
    /* Matched to button width */
    height: auto;
    border-radius: 20px;
    /* More rounded */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    /* Centered */
    overflow: visible;
    /* Changed from hidden to visible */
    position: relative;
    /* Needed for absolute positioning of the badge */
}

/* Option 4: Craft Style (Natural/Organic Tag) */
.upsell-price-badge {
    position: absolute;
    bottom: 20px;
    left: 12px;
    background: #F3EFE9;
    color: #5B1414;
    padding: 7px 16px;
    border-radius: 4px;
    transform: rotate(-3deg);
    box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.1),
        inset 0 0 10px rgba(140, 94, 46, 0.05);
    z-index: 10;
    pointer-events: none;
    border: 1px solid #D9D2C7;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Add a small 'eyelet' effect for the tag */
.upsell-price-badge::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: white;
    border: 1px solid #D9D2C7;
    border-radius: 50%;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.upsell-price-text {
    font-size: 1.15rem;
    font-weight: 800;
    color: #5B1414;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    /* Stamped look */
    opacity: 0.9;
    padding-left: 6px;
}

@keyframes floating {
    /* Removed for Craft Option 4 to keep it stable */
}

.upsell-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 25px;
}

.btn-primary {
    background: #5B1414;
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--radius);
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .upsell-desc {
        font-size: 0.95rem;
        line-height: 1.3;
        margin-bottom: 15px;
    }
}

.upsell-image img,
.upsell-image video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 20px;
}

/* Tag de Regalo Exclusivo */
@media (max-width: 480px) {
    .upsell-price-badge {
        padding: 5px 12px;
        bottom: 15px;
        font-size: 0.9rem;
    }
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-tertiary {
    background: transparent;
    color: #8C735B;
    /* Less prominent color */
    border: none;
    padding: 0;
    font-weight: 500;
    /* Regular weight, not bold */
    text-decoration: none;
    cursor: pointer;
    font-size: 0.85rem;
    /* Smaller size */
    transition: opacity var(--transition-fast);
}

.btn-tertiary:hover {
    opacity: 0.8;
}

.hidden {
    display: none;
    /* Fallback */
    opacity: 0;
    pointer-events: none;
}

/* --- LEGAL MODAL STYLES --- */
/* --- LEGAL MODAL STYLES --- */
.modal-legal {
    max-width: 600px;
    text-align: left;
    display: flex;
    flex-direction: column;
    padding: 20px 25px 30px 25px;
    /* Reduced top padding */
}

.legal-body {
    max-height: 75vh;
    overflow-y: auto;
    padding-right: 10px;
    margin-top: 10px;
    /* Custom Scrollbar for better aesthetics */
    scrollbar-width: thin;
    scrollbar-color: #5B1414 transparent;
}

/* Webkit scrollbar styling */
.legal-body::-webkit-scrollbar {
    width: 6px;
}

.legal-body::-webkit-scrollbar-track {
    background: transparent;
}

.legal-body::-webkit-scrollbar-thumb {
    background-color: #5B1414;
    border-radius: 20px;
}

.modal-legal h2 {
    font-size: 1.1rem;
    /* Slightly smaller as requested */
    line-height: 1.2;
    margin-top: 5px;
    /* Reduced margin from top */
    margin-bottom: 15px;
    padding-right: 30px;
    /* Extra padding so text doesn't hit the Close X */
    flex-shrink: 0;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .modal-legal h2 {
        white-space: normal;
    }
}

.modal-legal h3 {
    font-size: 1rem;
    margin-top: 15px;
    margin-bottom: 8px;
}

.modal-legal p,
.modal-legal ul {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.modal-legal ul {
    padding-left: 20px;
}

/* --- CAMPAIGN MODAL STYLES --- */
.campaign-content {
    max-width: 450px;
    padding: 35px 25px;
    border-radius: 24px;
    background: #FFFCF7;
    border: 1px solid #E8E2D9;
    box-shadow: 0 20px 60px rgba(44, 36, 27, 0.25);
    background-image: radial-gradient(circle at top right, rgba(140, 94, 46, 0.05), transparent);
}

.campaign-gift-icon-container {
    font-size: 3rem;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    animation: floatingGift 3s ease-in-out infinite;
}

@keyframes floatingGift {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.campaign-step {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.campaign-header {
    margin-bottom: 25px;
}

.campaign-badge {
    background: #E8E2D9;
    color: #8C5E2E;
    font-size: 0.7rem;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: inline-block;
}

.campaign-badge.success {
    background: #E8F5E9;
    color: #2E7D32;
}

.campaign-header h2 {
    font-size: 1.6rem;
    color: #2C241B;
    margin-bottom: 10px;
    line-height: 1.2;
}

@media (max-width: 480px) {
    .campaign-header h2 {
        font-size: 1.35rem !important;
        white-space: nowrap;
        letter-spacing: -0.5px;
        overflow: visible;
    }

    .large-step-title {
        white-space: normal !important; /* Permite que el título largo del paso 3 envuelva */
        font-size: 1.15rem !important; /* Un poco más pequeño para móviles */
        line-height: 1.3;
    }

    .code-box {
        padding: 10px;
        gap: 5px;
    }

    .code-box input {
        font-size: 0.8rem !important; /* Más pequeño para que el código largo quepa entero sin puntos suspensivos */
        letter-spacing: 0.5px !important; /* Espaciado ajustado para máxima legibilidad en poco espacio */
    }

    #btn-copy-code {
        width: 100%; 
        padding: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
}

.large-step-title {
    font-size: 1.8rem !important;
    margin-top: 15px;
}

.campaign-header p {
    color: #6D5D4B;
    font-size: 0.95rem;
}

.campaign-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px;
    border: 1px solid #E8E2D9;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.option-card:hover {
    border-color: #5B1414;
    box-shadow: 0 4px 12px rgba(91, 20, 20, 0.08);
    transform: translateY(-2px);
}

.option-card:active {
    transform: translateY(0);
}

.option-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.option-text strong {
    display: block;
    color: #2C241B;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.option-text span {
    color: #8C735B;
    font-size: 0.8rem;
}

.campaign-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.input-group {
    position: relative;
    text-align: left;
}

.campaign-form input[type="email"] {
    width: 100%;
    padding: 16px;
    border: 1px solid #E8E2D9;
    border-radius: 12px;
    font-size: 1rem;
    background: #F9F7F4;
    transition: border-color 0.2s;
}

.campaign-form input[type="email"]:focus {
    outline: none;
    border-color: #5B1414;
}

.error-text {
    color: #e74c3c;
    font-size: 0.75rem;
    margin-top: 5px;
    display: block;
}

.privacy-note {
    font-size: 0.7rem;
    color: #A69B8F;
    margin-top: 15px;
}

/* --- DISCOUNT STEP --- */
.discount-container {
    background: #F3EFE9;
    padding: 20px;
    border-radius: 16px;
    border: 2px dashed #D9D2C7;
    margin-bottom: 20px;
}

.code-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 12px 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid #E8E2D9;
}

.code-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: #5B1414;
    letter-spacing: 2px;
    padding: 0;
    text-align: center;
    pointer-events: none;
    max-width: calc(100% - 30px); /* Evita que choque con los bordes/iconos */
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.btn-icon:hover {
    opacity: 1;
}

.eye-icon {
    font-size: 1.2rem;
}

#btn-copy-code {
    width: 250px;
    /* Slightly longer as requested */
    margin: 15px auto;
    /* Centered with margin */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    position: relative;
    overflow: hidden;
    background: #EEE8DE;
    color: #8C5E2E;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    text-align: center; /* Asegura el centrado del texto */
    padding: 0 15px; /* Evita que el texto toque los bordes */
}

#btn-copy-code.success-state {
    background: #2E7D32;
    color: white;
}

#btn-go-to-checkout {
    width: 100%;
    background: #5B1414;
    /* Brand primary - protagonist */
    color: white;
    border: none;
    padding: 16px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: 0 8px 20px rgba(91, 20, 20, 0.2);
    margin-top: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#btn-go-to-checkout:hover {
    background: #4A1010;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(91, 20, 20, 0.3);
}

#btn-go-to-checkout:active {
    transform: translateY(0);
}

.success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}