/* ----------------------------------------------------------------------------
 * All rights reserved © CBI 2025.
 *  
 * This software contains proprietary information exclusively of CBI 
 * considered confidential. 
 * It is totally forbidden its use or disclosure in partial or total form.
 * ---------------------------------------------------------------------------
 * @author CBI Development team 
 */

/* Age Gate Widget Styles */

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

@keyframes shake { 
    0%, 100% { transform: translateX(0); } 
    25% { transform: translateX(-5px); } 
    75% { transform: translateX(5px); } 
}

.age-gate-overlay {
    /* CSS Custom Properties for dynamic theming */
    --agegate-font-family: var(--external-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    --agegate-font-size: var(--external-font-size, 23px);
    --agegate-age-text-font-size: var(--external-age-text-font-size, 23px);
    --agegate-primary-color: var(--external-primary-color, #333);
    --agegate-secondary-color: var(--external-secondary-color, #333);
    --agegate-tertiary-color: var(--external-tertiary-color, rgba(212, 175, 55, 0.15));
    --agegate-background-color: var(--external-background-color, transparent);
    --agegate-background-image: var(--external-background-image, none);
    --agegate-overlay-color: var(--external-overlay-color, transparent);
    --agegate-background-type: var(--external-background-type, color);
    --agegate-button-style: var(--external-button-style, solid);
    --agegate-button-hover-color: var(--external-button-hover-color, #222);
    
    /* Dynamic spacing system - scales with viewport height */
    --modal-padding: clamp(20px, 5vh, 50px);
    --element-spacing: clamp(15px, 3vh, 30px);
    --form-spacing: clamp(10px, 1.5vh, 20px);
    --logo-margin: clamp(15px, 3vh, 30px);
    
    /* Dynamic button properties set by JavaScript based on button style */
    --button-background: transparent;
    --button-border: none;
    --button-text-color: white;
    
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--agegate-font-family);
    
    /* Apply the CSS variables with layered background approach */
    background: 
        linear-gradient(var(--agegate-overlay-color), var(--agegate-overlay-color)),
        var(--agegate-background-image),
        var(--agegate-background-color);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-blend-mode: overlay;
}

.age-gate-modal {
    font-family: var(--agegate-font-family);
    color: var(--agegate-primary-color);
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(10px, 2vh, 20px) 0;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Center content only on larger screens where there's enough space */
@media (min-height: 900px) {
    .age-gate-modal {
        align-items: center;
    }
}

.modal-content {
    padding: var(--modal-padding) clamp(20px, 4vw, 40px);
    border-radius: 20px;
    /*max-width: 800px;*/
    width: 90%;
    text-align: center;
    margin: 0 auto;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: var(--element-spacing);
}

.modal-content::-webkit-scrollbar { 
    width: 8px; 
}

.modal-content::-webkit-scrollbar-track { 
    background: rgba(241, 241, 241, 0.5); 
    border-radius: 4px; 
}

.modal-content::-webkit-scrollbar-thumb { 
    background: rgba(204, 204, 204, 0.7); 
    border-radius: 4px; 
}

.modal-content::-webkit-scrollbar-thumb:hover { 
    background: rgba(187, 187, 187, 0.8); 
}

.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s ease;
}

.language-selector:hover { 
    border-color: #b8860b; 
}

.language-selector:focus { 
    border-color: #b8860b; 
    box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.2); 
}

.logo-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#brand-logo {
    width: 200px;
    height: auto;
    max-width: min(200px, 40vw);
    object-fit: contain;
    display: block;
}

/* Responsive logo sizing for mobile devices */
@media (max-width: 768px) {
    #brand-logo {
        width: auto !important;
        max-width: clamp(140px, 30vw, 180px);
    }
}

.title-container {
    width: 100%;
    text-align: center;
}

.age-title {
    margin: 0;
    font-size: var(--agegate-age-text-font-size);
    font-weight: 600;
    line-height: 1.4;
}

#age-title {
    font-size: var(--agegate-age-text-font-size);
}

.footer-container {
    width: 100%;
    max-width: 800px;
    text-align: center;
    margin: var(--element-spacing) 0 0 0;
}

.imported-by-text {
    margin: 0;
    font-weight: 500;
    line-height: 1.5;
}

/* Mobile/Desktop visibility classes - Higher specificity for age forms */
.age-form.desktop-only {
    display: flex;
    justify-content: center;
    gap: clamp(15px, 4vw, 30px);
    margin: var(--form-spacing) 0;
    flex-wrap: wrap;
    width: 100%;
}

.age-form.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .age-form.desktop-only {
        display: none;
    }
    
    .age-form.mobile-only {
        display: flex;
        justify-content: center;
        gap: clamp(15px, 4vw, 30px);
        margin: var(--form-spacing) 0;
        flex-wrap: wrap;
        width: 100%;
    }
}

/* Generic desktop-only and mobile-only classes for other elements */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
    
    .mobile-only {
        display: block;
    }
}

/* YES/NO Button Styles */
.yes-no-buttons {
    display: flex;
    gap: clamp(20px, 5vw, 40px);
    justify-content: center;
    align-items: center;
    margin: var(--form-spacing) 0;
    width: 100%;
}

.yes-no-button {
    background: var(--button-background, transparent);
    border: var(--button-border, 2px solid var(--agegate-primary-color));
    color: var(--button-text-color, var(--agegate-primary-color));
    padding: clamp(15px, 3vh, 20px) clamp(40px, 8vw, 60px);
    border-radius: 50px;
    cursor: pointer;
    font-size: clamp(18px, 2.5vh, 22px);
    font-weight: bold;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.yes-no-button:hover {
    background: var(--agegate-button-hover-color, var(--agegate-primary-color)) !important;
    border-color: var(--agegate-button-hover-color, var(--agegate-primary-color));
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.yes-no-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.yes-no-button.selected {
    background: var(--agegate-secondary-color, var(--agegate-primary-color)) !important;
    border-color: var(--agegate-secondary-color, var(--agegate-primary-color));
    color: white !important;
}

/* Disabled YES/NO button styles - Context-aware based on button style */
.yes-no-button:disabled,
.yes-no-button.disabled {
    cursor: not-allowed;
    transform: none;
}

/* Outlined button disabled state - maintain outline style with reduced opacity */
[data-button-style="outline"] .yes-no-button:disabled,
[data-button-style="outline"] .yes-no-button.disabled {
    opacity: 0.6;
    background: transparent !important;
    border: 2px solid var(--agegate-primary-color) !important;
    color: var(--agegate-primary-color) !important;
}

[data-button-style="outline"] .yes-no-button:disabled:hover,
[data-button-style="outline"] .yes-no-button.disabled:hover {
    opacity: 0.6;
    background: transparent !important;
    border: 2px solid var(--agegate-primary-color) !important;
    color: var(--agegate-primary-color) !important;
    transform: none;
    box-shadow: none;
}

/* Solid button disabled state - use darker shadow effect */
[data-button-style="solid"] .yes-no-button:disabled,
[data-button-style="solid"] .yes-no-button.disabled {
    opacity: 0.8;
    background: var(--button-background) !important;
    border-color: var(--button-background) !important;
    color: var(--button-text-color) !important;
    box-shadow: 0 4px 8px var(--button-disabled-shadow, rgba(0, 0, 0, 0.3)) !important;
}

[data-button-style="solid"] .yes-no-button:disabled:hover,
[data-button-style="solid"] .yes-no-button.disabled:hover {
    opacity: 0.8;
    background: var(--button-background) !important;
    border-color: var(--button-background) !important;
    color: var(--button-text-color) !important;
    transform: none;
    box-shadow: 0 4px 8px var(--button-disabled-shadow, rgba(0, 0, 0, 0.3)) !important;
}


/* Date Inputs Container */
.date-inputs {
    display: flex;
    justify-content: center;
    gap: clamp(15px, 4vw, 30px);
    flex-wrap: wrap;
    width: 100%;
}

/* Dropdown/Select Styles */
.age-select {
    width: 90px;
    height: 60px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    border: none;
    border-bottom: 4px solid var(--agegate-primary-color);
    background: transparent !important;
    background-color: transparent !important;
    color: var(--agegate-primary-color);
    margin-bottom: 12px;
    font-family: var(--agegate-font-family);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 30px;
}

.age-select:focus {
    outline: none;
    background: transparent !important;
    background-color: transparent !important;
}

.age-select option {
    color: var(--agegate-primary-color);
    padding: 8px;
    background-color: white;
    text-shadow: 1px 2px 3px #000;
}

/* Browser-specific transparent select styling */
.age-select::-ms-expand {
    display: none; /* Remove default arrow in IE */
}

/* Webkit specific styling for better transparency */
.age-select::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.year-select {
    width: 120px;
}

/* Month and day dropdowns can be smaller on mobile */
@media (max-width: 768px) {
    .age-select {
        width: 70px;
        height: 50px;
        font-size: 16px;
        background-size: 14px;
        padding-right: 25px;
    }
    
    .year-select {
        width: 90px;
    }
    
    .yes-no-button {
        min-width: 100px;
        padding: clamp(12px, 2.5vh, 16px) clamp(30px, 6vw, 50px);
        font-size: clamp(16px, 2vh, 18px);
    }
    
    .yes-no-buttons {
        gap: clamp(15px, 4vw, 25px);
    }
}

@media (max-width: 480px) {
    .age-select {
        width: 60px;
        height: 45px;
        font-size: 14px;
        background-size: 12px;
        padding-right: 20px;
    }
    
    .year-select {
        width: 80px;
    }
    
    .yes-no-button {
        min-width: 80px;
        padding: 10px 25px;
        font-size: 14px;
        letter-spacing: 1px;
    }
    
    .yes-no-buttons {
        gap: 15px;
    }
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.age-input {
    width: 125px;
    height: 60px;
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    border: none;
    border-bottom: 4px solid var(--agegate-primary-color);
    background: transparent;
    color: var(--agegate-primary-color);
    margin-bottom: 12px;
    font-family: serif;
}

.age-input::placeholder {
    color: var(--agegate-primary-color);
}

.year-input { 
    width: 120px; 
}

.input-label {
    font-size: 1.25rem;
    color: var(--agegate-primary-color);
    font-weight: 600;
    letter-spacing: 1px;
}

.consent-section {
    margin: var(--element-spacing) 0 0 0;
    padding: clamp(15px, 3vh, 20px);
    background: var(--agegate-tertiary-color);
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    width: 100%;
    box-sizing: border-box;
}

.consent-label {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    line-height: 1.6;
    text-align: left;
}

.consent-checkbox {
    margin-right: 15px;
    margin-top: 3px;
    transform: scale(1.2);
    accent-color: #b8860b;
    display: block;
    appearance: checkbox !important;
}

.consent-text {
    font-size: 15px;
    color: var(--agegate-secondary-color);
    flex: 1;
    font-weight: 500;
}

.consent-text a,
#disclaimer-text a {
    color: #f00;
    text-decoration: underline;
}

.submit-button {
    color: white;
    border: none;
    padding: clamp(10px, 2.5vh, 12px) clamp(60px, 8vw, 80px);
    border-radius: 99px;
    cursor: not-allowed;
    font-size: clamp(16px, 2.2vh, 18px);
    font-weight: bold;
    letter-spacing: 2px;
    margin: var(--element-spacing) 0 0 0;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.submit-button:enabled {
    background: var(--button-background) !important;
    border: var(--button-border) !important;
    color: var(--button-text-color) !important;
    cursor: pointer;
    opacity: 1;
}

.submit-button:enabled:hover {
    background: var(--agegate-button-hover-color) !important;
    border-color: var(--agegate-button-hover-color);
    color: white !important;
}

/* Disabled submit button styles - Context-aware based on button style */
.submit-button:disabled {
    cursor: not-allowed;
    transform: none;
}

/* Outlined submit button disabled state - maintain outline style with reduced opacity */
[data-button-style="outline"] .submit-button:disabled {
    opacity: 0.6;
    background: transparent !important;
    border: 2px solid var(--agegate-primary-color) !important;
    color: var(--agegate-primary-color) !important;
}

[data-button-style="outline"] .submit-button:disabled:hover {
    opacity: 0.6;
    background: transparent !important;
    border: 2px solid var(--agegate-primary-color) !important;
    color: var(--agegate-primary-color) !important;
    transform: none;
    box-shadow: none;
}

/* Solid submit button disabled state - use darker shadow effect */
[data-button-style="solid"] .submit-button:disabled {
    opacity: 0.8;
    background: var(--button-background) !important;
    border-color: var(--button-background) !important;
    color: var(--button-text-color) !important;
    box-shadow: 0 4px 8px var(--button-disabled-shadow, rgba(0, 0, 0, 0.3)) !important;
}

[data-button-style="solid"] .submit-button:disabled:hover {
    opacity: 0.8;
    background: var(--button-background) !important;
    border-color: var(--button-background) !important;
    color: var(--button-text-color) !important;
    transform: none;
    box-shadow: 0 4px 8px var(--button-disabled-shadow, rgba(0, 0, 0, 0.3)) !important;
}

#disclaimer-text {
    color: var(--agegate-primary-color);
    font-size: clamp(10px, 2.8vh, 15px);
    margin: 0;
    width: 100%;
}

.error-message {
    color: #dc3545;
    margin: 0;
    padding: clamp(10px, 2vh, 15px);
    background: rgba(248, 215, 218, 0.9);
    border: 1px solid #f5c6cb;
    border-radius: 10px;
    display: none;
    font-weight: 600;
    font-size: clamp(14px, 2vh, 15px);
    width: 100%;
    box-sizing: border-box;
}

/* Enhanced height-based responsive design - targeting specific device heights */

/* For devices like Galaxy Z Fold 5 (882px) and iPhone 12 Pro (844px) */
@media (max-height: 900px) {
    .age-gate-modal {
        --modal-padding: clamp(15px, 3vh, 35px);
        --element-spacing: clamp(12px, 2.2vh, 22px);
        --form-spacing: clamp(15px, 2.8vh, 28px);
        --agegate-age-text-font-size: clamp(18px, 2.3vh, 20px);
    }
    
    .age-input {
        height: clamp(50px, 6vh, 55px);
        font-size: clamp(26px, 3.5vh, 30px);
    }
    
    .input-label {
        font-size: clamp(16px, 2vh, 18px);
    }
    
    #brand-logo {
        max-height: clamp(120px, 12vh, 140px);
        width: auto;
    }
}

/* For devices like iPhone 12 Pro (844px) */
@media (max-height: 850px) {
    .age-gate-modal {
        --modal-padding: clamp(12px, 2.5vh, 30px);
        --element-spacing: clamp(10px, 2vh, 20px);
        --form-spacing: clamp(12px, 2.5vh, 25px);
        --agegate-age-text-font-size: clamp(17px, 2.2vh, 19px);
    }
    
    .age-input {
        height: clamp(45px, 5.5vh, 52px);
        font-size: clamp(24px, 3.2vh, 28px);
    }
    
    .input-label {
        font-size: clamp(15px, 1.9vh, 17px);
    }
    
    #brand-logo {
        max-height: clamp(100px, 10vh, 120px);
        width: auto;
    }
}

/* For devices like Samsung Galaxy S8+ (740px) */
@media (max-height: 750px) {
    .age-gate-modal {
        --modal-padding: clamp(10px, 2vh, 25px);
        --element-spacing: clamp(8px, 1.8vh, 18px);
        --form-spacing: clamp(10px, 2.2vh, 22px);
        --agegate-age-text-font-size: clamp(16px, 2vh, 18px);
    }
    
    .age-input {
        height: clamp(42px, 5vh, 48px);
        font-size: clamp(22px, 3vh, 26px);
    }
    
    .input-label {
        font-size: clamp(14px, 1.8vh, 16px);
    }
    
    #brand-logo {
        max-height: clamp(80px, 8vh, 100px);
        width: auto;
    }
    
    .consent-section {
        padding: clamp(12px, 2vh, 15px);
    }
    
    .consent-text {
        font-size: clamp(13px, 1.6vh, 14px);
    }
}

/* For devices like iPhone SE (667px) */
@media (max-height: 680px) {
    .age-gate-modal {
        --modal-padding: clamp(8px, 1.8vh, 20px);
        --element-spacing: clamp(6px, 1.5vh, 15px);
        --form-spacing: clamp(8px, 2vh, 18px);
        --agegate-age-text-font-size: clamp(15px, 1.8vh, 17px);
    }
    
    .age-input {
        height: clamp(38px, 4.5vh, 45px);
        font-size: clamp(20px, 2.8vh, 24px);
        margin-bottom: clamp(6px, 1.2vh, 10px);
    }
    
    .input-label {
        font-size: clamp(13px, 1.6vh, 15px);
    }
    
    #brand-logo {
        max-height: clamp(70px, 7vh, 85px);
        width: auto;
    }
    
    .consent-section {
        padding: clamp(10px, 1.8vh, 12px);
    }
    
    .consent-text {
        font-size: clamp(12px, 1.5vh, 13px);
    }
    
    #disclaimer-text {
        font-size: clamp(11px, 1.4vh, 13px);
    }
    
    .language-selector {
        top: clamp(8px, 1.5vh, 12px);
        right: clamp(8px, 1.5vh, 12px);
        padding: clamp(5px, 1vh, 7px) clamp(7px, 1.2vh, 9px);
        font-size: clamp(11px, 1.3vh, 12px);
    }
}

/* Continue with smaller heights */
@media (max-height: 650px) {
    .age-gate-modal {
        --modal-padding: clamp(8px, 2vh, 22px);
        --element-spacing: clamp(6px, 1.5vh, 14px);
        --form-spacing: clamp(8px, 1.8vh, 18px);
        --agegate-age-text-font-size: clamp(14px, 1.8vh, 16px);
    }
    
    .age-input {
        height: clamp(36px, 4.2vh, 42px);
        font-size: clamp(18px, 2.5vh, 22px);
        margin-bottom: clamp(6px, 1.2vh, 10px);
    }
    
    .input-label {
        font-size: clamp(12px, 1.5vh, 14px);
    }
    
    #brand-logo {
        max-height: clamp(60px, 6vh, 75px);
        width: auto;
    }
    
    .consent-section {
        padding: clamp(8px, 1.5vh, 10px);
    }
    
    .consent-text {
        font-size: clamp(11px, 1.3vh, 12px);
    }
    
    #disclaimer-text {
        font-size: clamp(10px, 1.2vh, 12px);
    }
    
    .language-selector {
        top: clamp(6px, 1.2vh, 10px);
        right: clamp(6px, 1.2vh, 10px);
        padding: clamp(4px, 0.8vh, 6px) clamp(6px, 1vh, 8px);
        font-size: clamp(10px, 1.2vh, 11px);
    }
}

@media (max-height: 550px) {
    .age-gate-modal {
        --modal-padding: clamp(6px, 1.5vh, 18px);
        --element-spacing: clamp(4px, 1vh, 10px);
        --form-spacing: clamp(6px, 1.5vh, 15px);
        --agegate-age-text-font-size: clamp(13px, 1.6vh, 15px);
    }
    
    .age-input {
        height: clamp(32px, 3.8vh, 38px);
        font-size: clamp(16px, 2.2vh, 20px);
        margin-bottom: clamp(4px, 0.8vh, 8px);
    }
    
    .input-label {
        font-size: clamp(11px, 1.3vh, 13px);
    }
    
    /* Reduce logo size significantly on very small heights */
    #brand-logo {
        max-height: clamp(50px, 5vh, 65px);
        width: auto;
    }
}

@media (max-height: 450px) {
    .age-gate-modal {
        --modal-padding: clamp(4px, 1vh, 12px);
        --element-spacing: clamp(3px, 0.8vh, 8px);
        --form-spacing: clamp(4px, 1vh, 10px);
        --agegate-age-text-font-size: clamp(12px, 1.4vh, 14px);
    }
    
    .age-input {
        height: clamp(28px, 3.2vh, 35px);
        font-size: clamp(14px, 1.8vh, 18px);
        margin-bottom: clamp(3px, 0.6vh, 6px);
    }
    
    .input-label {
        font-size: clamp(10px, 1.1vh, 12px);
    }
    
    /* Further reduce logo size or hide completely */
    #brand-logo {
        max-height: clamp(35px, 4vh, 50px);
        width: auto;
    }
    
    .language-selector {
        top: clamp(4px, 1vh, 8px);
        right: clamp(4px, 1vh, 8px);
        padding: 3px 5px;
        font-size: 10px;
    }
    
    .consent-section {
        padding: clamp(6px, 1.2vh, 8px);
    }
    
    .consent-text {
        font-size: clamp(9px, 1.1vh, 11px);
    }
    
    #disclaimer-text {
        font-size: clamp(8px, 1vh, 10px);
    }
}

/* Desktop zoom overflow fixes - Combined width and height constraints */

/* Handle desktop zoom at ~250-300% (640px width with very low height) */
@media (max-width: 672px) and (max-height: 400px) {
    .age-gate-modal {
        --modal-padding: clamp(8px, 2vh, 20px);
        --element-spacing: clamp(6px, 1.5vh, 15px);
        --form-spacing: clamp(8px, 2vh, 18px);
        --agegate-age-text-font-size: clamp(14px, 2vh, 16px);
    }
    
    .age-input, .age-select {
        height: clamp(35px, 4vh, 42px);
        font-size: clamp(18px, 2.5vh, 22px);
        margin-bottom: clamp(6px, 1.2vh, 10px);
    }
    
    .input-label {
        font-size: clamp(12px, 1.5vh, 14px);
    }
    
    #brand-logo {
        max-height: clamp(60px, 8vh, 80px);
        width: auto;
    }
    
    .consent-section {
        padding: clamp(8px, 1.5vh, 12px);
    }
    
    .consent-text {
        font-size: clamp(11px, 1.4vh, 13px);
    }
    
    #disclaimer-text {
        font-size: clamp(10px, 1.3vh, 12px);
    }
    
    .yes-no-button {
        padding: clamp(10px, 2vh, 14px) clamp(25px, 5vw, 40px);
        font-size: clamp(14px, 1.8vh, 16px);
        min-width: 80px;
    }
    
    .submit-button {
        padding: clamp(8px, 1.8vh, 12px) clamp(40px, 6vw, 60px);
        font-size: clamp(14px, 1.8vh, 16px);
    }
}

/* Handle more extreme desktop zoom scenarios (608px width, ~300px height) */
@media (max-width: 640px) and (max-height: 350px) {
    .age-gate-modal {
        --modal-padding: clamp(6px, 1.5vh, 15px);
        --element-spacing: clamp(4px, 1vh, 12px);
        --form-spacing: clamp(6px, 1.5vh, 15px);
        --agegate-age-text-font-size: clamp(13px, 1.8vh, 15px);
    }
    
    .age-input, .age-select {
        height: clamp(32px, 3.5vh, 38px);
        font-size: clamp(16px, 2.2vh, 20px);
        margin-bottom: clamp(4px, 1vh, 8px);
    }
    
    .input-label {
        font-size: clamp(11px, 1.3vh, 13px);
    }
    
    #brand-logo {
        max-height: clamp(50px, 7vh, 70px);
        width: auto;
    }
    
    .consent-section {
        padding: clamp(6px, 1.2vh, 10px);
    }
    
    .consent-text {
        font-size: clamp(10px, 1.2vh, 12px);
    }
    
    #disclaimer-text {
        font-size: clamp(9px, 1.1vh, 11px);
    }
    
    .language-selector {
        top: clamp(6px, 1.2vh, 10px);
        right: clamp(6px, 1.2vh, 10px);
        padding: clamp(4px, 0.8vh, 6px) clamp(6px, 1vh, 8px);
        font-size: clamp(10px, 1.1vh, 11px);
    }
}

/* Handle extreme desktop zoom (600px width, ~320px height or less) */
@media (max-width: 620px) and (max-height: 320px) {
    .age-gate-modal {
        --modal-padding: clamp(4px, 1vh, 12px);
        --element-spacing: clamp(3px, 0.8vh, 8px);
        --form-spacing: clamp(4px, 1vh, 12px);
        --agegate-age-text-font-size: clamp(12px, 1.6vh, 14px);
    }
    
    .age-input, .age-select {
        height: clamp(28px, 3vh, 35px);
        font-size: clamp(14px, 1.8vh, 18px);
        margin-bottom: clamp(3px, 0.6vh, 6px);
    }
    
    .input-label {
        font-size: clamp(10px, 1.1vh, 12px);
    }
    
    #brand-logo {
        max-height: clamp(40px, 5vh, 60px);
        width: auto;
    }
    
    .consent-section {
        padding: clamp(5px, 1vh, 8px);
    }
    
    .consent-text {
        font-size: clamp(9px, 1vh, 11px);
    }
    
    #disclaimer-text {
        font-size: clamp(8px, 1vh, 10px);
    }
    
    .yes-no-button {
        padding: clamp(8px, 1.5vh, 12px) clamp(20px, 4vw, 30px);
        font-size: clamp(12px, 1.5vh, 14px);
        min-width: 70px;
        letter-spacing: 1px;
    }
    
    .submit-button {
        padding: clamp(6px, 1.2vh, 10px) clamp(30px, 5vw, 45px);
        font-size: clamp(12px, 1.5vh, 14px);
        letter-spacing: 1px;
    }
    
    .language-selector {
        top: clamp(4px, 0.8vh, 8px);
        right: clamp(4px, 0.8vh, 8px);
        padding: 3px 5px;
        font-size: 9px;
    }
}

/* Critical fix for logo overflow on narrow and short viewports */
@media (max-width: 480px) and (max-height: 300px) {
    .age-gate-modal {
        --modal-padding: clamp(15px, 5vh, 25px) !important;
        --element-spacing: clamp(8px, 2vh, 15px) !important;
    }
    
    #brand-logo {
        width: auto !important;
        max-width: clamp(100px, 25vw, 140px) !important;
        max-height: clamp(60px, 15vh, 90px) !important;
        height: auto !important;
    }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .age-gate-modal {
        --agegate-font-size: 18px;
        --agegate-age-text-font-size: 18px;
    }
    
    .age-form {
        gap: 8px;
        flex-wrap: nowrap;
        justify-content: center;
        margin: 40px auto;
    }
    
    .input-group {
        min-width: 0;
    }
    
    .age-input {
        height: 50px;
        font-size: clamp(16px, 2vh, 20px);
    }
    
    .year-input {
        width: 90px;
    }
    
    .input-label {
        font-size: 12px;
        letter-spacing: 0.5px;
    }
    
    .modal-content {
        padding: 30px 15px;
    }
}

@media (max-width: 480px) { 
    .language-selector { 
        font-size: 12px !important; 
        padding: 6px 8px !important; 
    }
    
    .age-form {
        gap: 5px;
    }
    
    .age-input {
        height: 45px;
        width: 60px;
        font-size: clamp(16px, 2vh, 20px);
    }
    
    .year-input {
        width: 80px;
    }
    
    .input-label {
        font-size: 11px;
    }
    
    .modal-content {
        padding: 20px 10px;
    }
    
    .submit-button {
        padding: 16px 60px;
        font-size: 16px;
    }
    
    /* Fix logo overflow on narrow viewports */
    #brand-logo {
        max-width: clamp(120px, 35vw, 160px) !important;
        width: auto !important;
    }
}
