/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom font fallbacks - using system fonts similar to the design */

@font-face {
    font-family: 'Neue Haas Grotesk';
    src: url('assets/fonts/NeueHaasGrotesk-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Tiempos Text';
    src: url('assets/fonts/TiemposText-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'Neue Haas Grotesk', sans-serif;
    background: linear-gradient(180deg, #fffbf7 0%, #edeaff 99.99%);
    min-height: 100svh; 
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Desktop-specific body styles */
@media (min-width: 769px) {
    body {
        height: 100vh;
        overflow-y: hidden; /* Prevent vertical scrolling on desktop */
    }
}

/* View Control - Default: show desktop, hide mobile */
.desktop-view {
    display: flex;
}

.mobile-view {
    display: none;
}

.container {
    width: 100%;
    max-width: 1280px;
    height: 100vh;
    height: 100svh;
    padding: 32px 24px;
    display: flex;
    flex-direction: column; 
    align-items: center;  
    justify-content: flex-start; 
}

.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(16px, 3vh, 32px);
    width: 100%;
    max-width: 1000px;
    height: 100%;
    justify-content: flex-start;
}

.text-section {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 2vh, 32px);
    align-items: flex-start;
    width: 100%;
    max-width: 541px;
    flex-shrink: 0;
}

.main-title {
    font-family: 'Neue Haas Grotesk', sans-serif;
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 400;
    line-height: 1.2;
    color: #633624;
    margin: 0;
}

.subtitle {
    font-family: 'Tiempos Text', serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.4;
    color: #633624;
    letter-spacing: -0.4px;
    max-width: 388px;
    margin: 0;
}

.button-container {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.copy-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 48px;
    font-family: 'Neue Haas Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #1e1d1d;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

.copy-button:active {
    transform: translateY(0);
}

.copy-icon {
    width: 18px;
    height: 20px;
    flex-shrink: 0;
    object-fit: contain;
}

.product-image {
    width: 100%;
    max-width: 508px;
    height: auto;
    max-height: calc(100vh - 200px); /* Reserve space for text content */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 1;
    min-height: 0;
}

.product-img {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

/* Responsive design */
@media (max-width: 1200px) {
    .main-title {
        font-size: clamp(32px, 4vw, 42px);
    }
    
    .product-image {
        max-height: calc(100vh - 180px);
    }
}

@media (max-width: 768px) {
    .content {
        gap: 24px;
        align-items: center;
        text-align: center;
    }
    
    .text-section {
        align-items: center;
        text-align: center;
        max-width: 100%;
    }
    
    .main-title {
        font-size: 36px;
        text-align: center;
    }
    
    .subtitle {
        font-size: 18px;
        text-align: center;
        max-width: 100%;
    }
    
    .button-container {
        justify-content: center;
    }
    
    .product-image {
        max-width: 400px;
    }
}

@media (max-width: 600px) {
    .content {
        gap: 20px;
    }
    
    .text-section {
        gap: 24px;
    }
    
    .main-title {
        font-size: 32px;
        line-height: 1.1;
    }
    
    .subtitle {
        font-size: 16px;
        line-height: 1.3;
    }
    
    .product-image {
        max-width: 350px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 28px;
    }
    
    .subtitle {
        font-size: 15px;
    }
    
    .copy-button {
        font-size: 14px;
        padding: 10px 14px;
        height: 40px;
        gap: 6px;
    }
    
    .copy-icon {
        width: 16px;
        height: 18px;
    }
    
    .product-image {
        max-width: 300px;
    }
}

@media (max-width: 360px) {
    .main-title {
        font-size: 24px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .copy-button {
        font-size: 14px;
        padding: 8px 12px;
        height: 36px;
    }
    
    .product-image {
        max-width: 280px;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 600px) and (orientation: landscape) {
    .content {
        flex-direction: row;
        align-items: center;
        gap: 32px;
        max-width: 100%;
    }
    
    .text-section {
        flex: 1;
        max-width: 50%;
    }
    
    .product-image {
        flex: 1;
        max-width: 50%;
        max-height: 400px;
    }
    
    .main-title {
        font-size: 32px;
    }
    
    .subtitle {
        font-size: 16px;
    }
}

/* Extra large screens */
@media (min-width: 1400px) {
    .content {
        gap: clamp(32px, 4vh, 48px);
    }
    
    .main-title {
        font-size: clamp(48px, 4vw, 56px);
    }
    
    .subtitle {
        font-size: clamp(18px, 1.5vw, 22px);
    }
    
    .product-image {
        max-height: calc(100vh - 250px);
    }
}

/* ========================================
   MOBILE VIEW STYLES
   ======================================== */

/* Mobile view specific styles */
.mobile-view.content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
}

.mobile-view .main-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 32px;
    width: 100%;
    text-align: center;
    flex: 1;
    min-height: 0;
}

.mobile-view .product-image {
    width: auto;
    height: auto;
    max-height: 300px;
    object-fit: contain;
}


.mobile-view .text-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    width: 100%;
    text-align: center;
}

.mobile-view .main-title {
    font-family: 'Neue Haas Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.2;
    color: #633624;
    margin: 0;
    text-align: center;
}

.mobile-view .subtitle-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.mobile-view .subtitle {
    font-family: 'Tiempos Text', serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: #633624;
    letter-spacing: -0.28px;
    margin: 0;
    text-align: center;
}

.mobile-view .button-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    align-items: center;
}

.open-app-button,
.download-app-button {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Neue Haas Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.64px;
    text-decoration: none;
    user-select: none;
}

.open-app-button {
    background: #cec8f4;
    color: #1e1d1d;
}

.open-app-button:hover {
    background: #beb4f0;
    transform: translateY(-1px);
}

.open-app-button:active {
    transform: translateY(0);
    background: #aea0ec;
}

.download-app-button {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    color: #1e1d1d;
}

.download-app-button:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

.download-app-button:active {
    transform: translateY(0);
}

/* Button states for feedback */
.button-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.button-success {
    background: rgba(34, 197, 94, 0.8) !important;
    color: white !important;
}

.button-error {
    background: rgba(239, 68, 68, 0.8) !important;
    color: white !important;
}

/* ========================================
   USER AGENT-BASED RESPONSIVE DESIGN
   ======================================== */

/* Device Category Based Styles - Primary responsive approach */

/* Mobile Phone Specific Styles (triggered by user agent) */
body.device-mobile .desktop-view {
    display: none !important;
}

body.device-mobile .mobile-view {
    display: flex !important;
}

/* Tablet Specific Styles (always show desktop view but with adjustments) */
body.device-tablet .desktop-view {
    display: flex !important;
}

body.device-tablet .mobile-view {
    display: none !important;
}

/* Desktop Specific Styles */
body.device-desktop {
    height: 100vh;
    overflow-y: hidden; /* Prevent scrolling on desktop */
}

body.device-desktop .desktop-view {
    display: flex !important;
}

body.device-desktop .mobile-view {
    display: none !important;
}

/* Override the no-scroll behavior for mobile and tablet devices */
body.device-mobile,
body.device-tablet {
    height: auto;
    overflow-y: auto;
}

/* ========================================
   DEVICE-SPECIFIC RESPONSIVE ADJUSTMENTS
   ======================================== */

/* Mobile Phone Fine-tuning based on screen size */

body.device-mobile.screen-small .mobile-view .main-title {
    font-size: 22px;
}

body.device-mobile.screen-small .mobile-view .subtitle {
    font-size: 14px;
}

body.device-mobile.screen-small .open-app-button,
body.device-mobile.screen-small .download-app-button {
    font-size: 15px;
    height: 44px;
}

/* Medium mobile screens (larger phones) */
body.device-mobile.screen-medium .mobile-view .container {
    max-width: 400px;
}

body.device-mobile.screen-medium .mobile-view .main-title {
    font-size: 26px;
}

body.device-mobile.screen-medium .mobile-view .subtitle {
    font-size: 15px;
}

body.device-mobile.screen-medium .mobile-view .product-image {
    max-width: 260px;
}

/* Mobile landscape orientation adjustments */
body.device-mobile.orientation-landscape .mobile-view .text-section {
    gap: 16px;
}

body.device-mobile.orientation-landscape .mobile-view .main-title {
    font-size: 20px;
}

body.device-mobile.orientation-landscape .mobile-view .subtitle {
    font-size: 14px;
}

body.device-mobile.orientation-landscape .mobile-view .product-image {
    max-width: 180px;
}

body.device-mobile.orientation-landscape .open-app-button,
body.device-mobile.orientation-landscape .download-app-button {
    height: 40px;
    font-size: 14px;
}

/* ========================================
   TABLET RESPONSIVE ADJUSTMENTS
   ======================================== */

/* Tablet specific adjustments for desktop view */
body.device-tablet .container {
    max-width: 900px;
}

body.device-tablet .main-title {
    font-size: 42px;
}

body.device-tablet .subtitle {
    font-size: 18px;
}

body.device-tablet .product-image {
    max-width: 400px;
}

/* Tablet portrait orientation */
body.device-tablet.orientation-portrait .content {
    gap: 32px;
    align-items: center;
    text-align: center;
}

body.device-tablet.orientation-portrait .text-section {
    align-items: center;
    text-align: center;
    max-width: 100%;
}

body.device-tablet.orientation-portrait .button-container {
    justify-content: center;
}

/* ========================================
   FALLBACK RESPONSIVE DESIGN (Screen Size Based)
   ======================================== */

/* Fallback for devices not properly detected by user agent */
@media (max-width: 480px) {
    body:not(.device-mobile):not(.device-tablet):not(.device-desktop) .desktop-view {
        display: none;
    }
    
    body:not(.device-mobile):not(.device-tablet):not(.device-desktop) .mobile-view {
        display: flex;
    }
}

/* Enhanced responsive design as fallback for traditional media queries */
@media (max-width: 480px) {

    body:not(.device-desktop):not(.device-tablet) .mobile-view .main-title {
        font-size: 22px;
    }
    
    body:not(.device-desktop):not(.device-tablet) .mobile-view .subtitle {
        font-size: 14px;
    }
    
    body:not(.device-desktop):not(.device-tablet) .open-app-button,
    body:not(.device-desktop):not(.device-tablet) .download-app-button {
        font-size: 15px;
        height: 44px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    /* Tablet fallback styles */
    body:not(.device-mobile) .desktop-view {
        display: flex;
    }
    
    body:not(.device-mobile) .mobile-view {
        display: none;
    }
}

/* ========================================
   OS-SPECIFIC ADJUSTMENTS
   ======================================== */


/* Android specific adjustments */
body.os-android .mobile-view .open-app-button {
    /* Slightly different styling for Android */
    letter-spacing: 0.5px;
}

/* macOS specific adjustments */
body.os-macos .copy-button {
    /* Enhanced styling for macOS */
    backdrop-filter: blur(25px);
}

/* ========================================
   IN-APP BROWSER ADJUSTMENTS
   ======================================== */

/* Special handling for in-app browsers */
body.browser-in-app .mobile-view .main-title {
    font-size: calc(1em + 2px); /* Slightly larger for better readability in app browsers */
}

body.browser-in-app .open-app-button {
    /* More prominent styling in app browsers */
    background: #b8a7f4;
    font-weight: 500;
}


