/* Mobile First Base Styles */
:root {
    --primary-color: #0066CC;
    --text-color: #333;
    --bg-color: #f8f9fa;
    --border-radius: 12px;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-color);
    background: transparent;
    overflow-x: hidden; /* Prevent horizontal scroll */
    height: 100%; /* Ensure body takes full height */
   width:100vw;
    overflow-y: hidden; /* Prevent body scroll on mobile */
    overflow: hidden; /* Keep hidden on mobile */
}

.main-container {
    width: 100vw;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: transparent;
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -moz-user-select: none;
}

/* Hide configurator until model is loaded */
.configurator {
    display: none !important;
}

.main-container.model-loaded .configurator {
    display: block !important;
}

/* Desktop flex layout for configurator */
@media (min-width: 769px) {
    .main-container.desktop-layout.model-loaded .configurator {
        display: flex !important;
        flex-direction: column;
    }
}

.model-viewer-wrapper {
    position: relative; /* Changed from absolute */
    height: 100%;
    width: 100%; /* Ensure full width */
    overflow: hidden;
    /* top, left, height calc removed */
}

/* Header (Common for Mobile & Desktop, potentially adjust padding in media query) */
.header {
    display: flex;
    justify-content: center;
    align-items: center;
   
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 11; /* Ensure header is above configurator */
  
}

.logo-wrapper {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
  
    
   
    transition: all 0.3s ease;
}


.logo-wrapper img {
    height: 24px;
    width: auto;
    cursor: pointer;
}

/* Configurator (Mobile Base - Fixed inside viewer) */
.configurator {
    position: fixed;
    left: 0;
    right: 0;
    
    overflow-y: auto;
   
    backdrop-filter: blur(10px);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
    z-index: 10;
    padding: 12px;
    bottom: 0;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px)); /* Add padding at bottom for safe area */
}

.config-header {
    display: flex;
    align-items: center;
    gap: 16px; /* Adjust gap as needed */
  
}

.price-container {
    text-align: right;
}

/* AR Butonunu sağa hizala ve stilize et */
.ar-button-container {
    margin-left: auto; /* Flex item'ı sağa iter */
    display: flex; /* İçindeki icon ve text'i düzgün hizalamak için */
    align-items: center;
    gap: 6px; /* İcon ve yazı arası boşluk */
    cursor: pointer;
    background-color: var(--primary-color); /* Arka plan rengi */
    color: white; /* Yazı rengi */
    padding: 8px 10px; /* İç boşluk */
    border-radius: var(--border-radius); /* Köşe yuvarlaklığı */
    font-size: 12px; /* Yazı boyutu */
    font-weight: 500; /* Yazı kalınlığı */
    transition: background-color 0.2s ease; /* Hover efekti için geçiş */
}

.ar-button-container:hover {
    background-color: #3a5edb; /* Hover durumunda biraz daha koyu renk */
}

.ar-button {
    /* İkon silindiği için bu div'e gerek kalmamış olabilir, */
    /* ama HTML'de durduğu için boş bir kural bırakmak sorun olmaz */
    /* İstersen HTML'den de kaldırabiliriz. */
    display: none; /* Şimdilik gizleyelim */
}

.product-title-text {
    font-size: 16px; /* Mobile font size */
}

.model-name {
    font-size: 12px; /* Mobile font size */
    color: #666;
  
}

.product-price {
    font-size: 12px; /* Mobile font size */
    font-weight: 600;
    color: #212529;
}

.config-tabs {
    display: flex;
   justify-content: center;
    margin-bottom: 5px; /* Mobile margin */
    border-bottom: 1px solid #eee;
    overflow-x: auto;
    scrollbar-width: none;
}

.config-tabs::-webkit-scrollbar {
    display: none;
}

.config-tab {
    padding: 8px 12px; /* Mobile padding */
    font-size: 12px; /* Mobile font size */
    font-weight: 500;
    color: #666;
    border: none;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
}

.config-tab.active {
    color: var(--primary-color);
    font-weight: 600;
}

.config-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.config-panels {
    margin-bottom: 12px; /* Mobile margin */
    min-height: 80px; /* Mobile min-height */
}

.config-panel {
    display: none; /* Hide panels by default */
}

.config-panel.active {
    display: block; /* Show active panel */
}

.panel-title {
    display: none; /* Hide panel titles on mobile */
}

.options-slider {
    display: flex;
    overflow-x: auto;
  
  
    justify-content: center; /* Center items horizontally */
    scrollbar-width: none;
}

.options-slider::-webkit-scrollbar {
    display: none;
}

.model-option {
    min-width: 60px; /* Mobile width */
    padding: 6px; /* Mobile padding */
    text-align: center;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.model-option.selected {
    border-color: var(--primary-color);
    background: rgba(74,111,255,0.05);
}

.model-option img {
    width: 48px; /* Mobile image size */
    height: 48px; /* Mobile image size */
    object-fit: contain;
    margin-bottom: 4px; /* Mobile margin */
}

.option-name {
    font-size: 10px; /* Mobile font size */
    font-weight: 500;
}

.color-option {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.color-option.selected {
    border: 2px solid var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Remove the old selected style with pseudo-element */
.color-option.selected::after {
    display: none;
}

.color-option:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.color-name {
    font-size: 10px; /* Increased mobile font size slightly */
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 48px; /* Increased mobile max-width */
}

.color-with-name {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 4px; /* Mobile margin */
}

/* Actions */
.action-buttons {
    display: none; /* Hide the action buttons container since we're repositioning the AR button */
}

.buy-button {
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600; /* Slightly bolder */
}

.buy-button:hover {
    background: #3a5edb;
}

.ar-button img {
    width: 16px; /* Mobile icon size */
    height: 16px; /* Mobile icon size */
    object-fit: contain;
}

/* Model Viewer Specifics */
model-viewer {
    overflow-x: hidden;
    width: 100%;
    height: 100%;
    background: transparent;
    --poster-color: transparent;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    outline: none;
    /* top, left, height calc removed */
}

/* Hide the default AR button provided by model-viewer using the ::part selector */
/* #default-ar-button {
    display: none !important; /* Use !important to override potential inline styles */
/* } */
model-viewer::part(ar-button) {
    display: none;
}

.ar-instruction {
    position: absolute; /* Position inside viewer */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 14px;
    display: none; /* Initially hidden */
    max-width: 90%;
    text-align: center;
    z-index: 20;
}

/* QR Modal (Common for Mobile & Desktop, adjust sizes in media query) */
.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: none; /* Initially hidden */
    align-items: center;
    justify-content: center;
    z-index: 30;
}

.qr-modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 16px; /* Mobile padding */
    width: 90%;
    max-width: 300px; /* Mobile max-width */
    position: relative;
}

.close-button {
    position: absolute;
    top: 12px; /* Adjusted */
    right: 12px; /* Adjusted */
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 4px; /* Click target */
}

.modal-title {
    font-size: 16px; /* Mobile font size */
    margin-bottom: 16px; /* Mobile margin */
    text-align: center;
    font-weight: 600;
}

.qr-container {
    display: flex;
    justify-content: center;
    margin-bottom: 16px; /* Mobile margin */
}

.qr-container img {
    width: 150px; /* Mobile QR size */
    height: 150px; /* Mobile QR size */
}

.info-box {
    display: flex;
    background: #f5f8ff;
    padding: 10px; /* Mobile padding */
    border-radius: 8px;
    font-size: 12px; /* Mobile font size */
    gap: 8px;
    align-items: flex-start;
}

/* Desktop Overrides - Changed breakpoint to 769px */
@media (min-width: 769px) {
    body {
        overflow-y: hidden; /* Prevent body scroll on desktop */
        background-color: var(--bg-color); /* Apply background color */
    }

    /* Desktop layout adjustments using flex */
    .main-container.desktop-layout {
        display: flex !important;
        height: 100vh;
        width: 100vw;
    }

    .main-container.desktop-layout .model-viewer-wrapper {
        flex: 2; /* Takes 2/3 width */
        position: relative; /* Ensure it remains in flow */
        height: 100%;
        width: 66.67%; /* Explicit width to prevent overflow */
        overflow: hidden;
    }

    .main-container.desktop-layout model-viewer {
        position: absolute; /* Fill the wrapper */
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    /* Desktop Configurator Styles */
    .main-container.desktop-layout .configurator {
        flex: 1; /* Takes 1/3 width */
        position: relative; /* Keep in flex flow */
        width: 33.33%; /* Explicit width to prevent overflow */
        height: 100vh; /* Full height */
        overflow-y: auto; /* Allow scrolling */
        border-left: 1px solid #eee; /* Separator */
        border-radius: 0;
        padding: 20px; /* Desktop padding */
        z-index: 5; /* Lower z-index than mobile */
        box-shadow: -4px 0 20px rgba(0,0,0,0.05); /* Softer shadow */
        background: white; /* Solid background */
        backdrop-filter: none; /* Remove blur */
        bottom: auto; /* Reset mobile positioning */
        left: auto;
        right: auto;
        transform: none; /* Reset mobile transform */
    }

    /* Desktop Header - position inside wrapper */
    .main-container.desktop-layout .header {
        position: absolute; /* Position over the model viewer */
        top: 10px;
        left: 10px;
        right: auto;
        width: auto;
        background: rgba(255, 255, 255, 0.7); /* Semi-transparent background */
        backdrop-filter: blur(5px);
        padding: 8px 12px;
        border-radius: var(--border-radius);
        z-index: 11;
    }

    .main-container.desktop-layout .logo-wrapper img {
        height: 40px; /* Slightly larger desktop logo */
        align-items: center;
    }

    /* Desktop Configurator Header */
    .main-container.desktop-layout .config-header {
        /* Desktop specific header styles if needed, otherwise defaults work */
        padding-left: 0; /* Reset mobile padding */
        margin-bottom: 0; /* Remove bottom margin */
        
        padding-top: 15px; /* Add padding above header */
        border-top: 1px solid #eee; /* Add separator line */
        gap: 10px; /* Reduced gap */
        order: 2; /* Move header to the bottom in flex order */
    }

     .main-container.desktop-layout .model-name {
        font-size: 18px; /* Larger model name */
        font-weight: 600;
        color: var(--text-color);
    }

     .main-container.desktop-layout .product-price {
        font-size: 18px; /* Larger price */
        font-weight: 700;
        white-space: nowrap;
    }

    /* Hide AR button text on desktop, maybe just show icon? */
   
    .main-container.desktop-layout .ar-button-container {
        /* Adjust padding if text is hidden */
     
        font-size: 14px; /* Slightly smaller font */
        justify-content: center;
    }


    /* Hide tabs on desktop */
    .main-container.desktop-layout .config-tabs {
        display: none;
    }

    .main-container.desktop-layout .config-panels {
        margin-bottom: 0; /* Remove bottom margin */
        min-height: auto;
        order: 1; /* Set panels order */
        flex-grow: 1; /* Allow panels to take up available space */
    }

    /* Show all panels on desktop */
    .main-container.desktop-layout .config-panel {
        display: block !important; /* Override .active */
        margin-bottom: 5px;
        padding-bottom: 5px;
        border-bottom: 1px solid #eee;
    }

    .main-container.desktop-layout .config-panel:last-child {
        border-bottom: none;
       
    }

    /* Show panel titles with dropdown arrows */
    .main-container.desktop-layout .panel-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 15px;
        padding-bottom: 6px;
        border-bottom: none;
        cursor: pointer;
        width: 100%;
    }

    /* Add dropdown arrow pointing down for collapsed (default state) */
    .main-container.desktop-layout .panel-title::after {
        content: '';
        width: 10px;
        height: 10px;
        border-right: 2px solid var(--primary-color);
        border-bottom: 2px solid var(--primary-color);
        transform: rotate(45deg);
        transition: transform 0.3s ease;
        display: inline-block;
        margin-right: 10px;
        margin-left: auto;
    }

    /* Rotate arrow to point up when expanded */
    .main-container.desktop-layout .panel-title.expanded::after {
        transform: rotate(-135deg);
    }

    /* Initially hide panel content on desktop */
    .main-container.desktop-layout .config-panel .options-slider {
        display: none;
    }

    /* Show panel content when expanded */
    .main-container.desktop-layout .config-panel.expanded .options-slider {
        display: flex;
    }

    .main-container.desktop-layout .options-slider {
       /* Allow wrapping on desktop */
       flex-wrap: wrap;
       justify-content: flex-start; /* Align items to start */
       gap: 6px; /* Reduced gap */
       padding: 6px 0; /* Reduced padding */
       overflow-x: visible; /* Remove horizontal scroll */
    }

    .main-container.desktop-layout .model-option {
        min-width: 70px; /* Reduced min-width slightly */
        padding: 6px; /* Reduced padding */
    }

    .main-container.desktop-layout .model-option img {
        width: 60px;
        height: 60px;
        margin-bottom: 6px;
    }

     .main-container.desktop-layout .option-name {
        font-size: 11px;
    }

    /* Adjust color and metal options size for desktop */
    .main-container.desktop-layout .color-option {
        width: 32px;
        height: 32px;
        margin: 4px;
        border: 1px solid #e0e0e0;
    }

    .main-container.desktop-layout .color-option.selected {
        border: 2px solid var(--primary-color);
    }

    /* Remove the old selected style overrides */
    .main-container.desktop-layout .color-option.selected::after {
        display: none;
    }

    .main-container.desktop-layout .color-with-name {
        margin: 4px;
        min-width: 32px;
    }

    .main-container.desktop-layout .color-name {
        font-size: 11px;
        margin-top: 4px;
    }

    .main-container.desktop-layout #renk-panel .options-slider,
    .main-container.desktop-layout #metal-panel .options-slider {
        gap: 8px;
        padding: 8px;
    }

     /* Other QR styles can remain as mobile */
}

/* Remove the overly large min-width media query */
/* @media (min-width: 10000px) { ... } */

.fullscreen-button {
    position: absolute;
    top: 10px;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fullscreen-button:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.fullscreen-button svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: #333;
    transition: stroke 0.3s ease;
}

.fullscreen-button:hover svg {
    stroke: #000;
}

.fullscreen-button.active {
    background: #f0f0f0;
}

/* Fullscreen styles for body */
body:fullscreen {
    background: white;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

body:-webkit-full-screen {
    background: white;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

body:-moz-full-screen {
    background: white;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

body:-ms-fullscreen {
    background: white;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Adjust main container in fullscreen */
body:fullscreen .main-container,
body:-webkit-full-screen .main-container,
body:-moz-full-screen .main-container,
body:-ms-fullscreen .main-container {
    flex: 1;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    max-width: none;
}

/* Adjust model viewer wrapper in fullscreen */
body:fullscreen .model-viewer-wrapper,
body:-webkit-full-screen .model-viewer-wrapper,
body:-moz-full-screen .model-viewer-wrapper,
body:-ms-fullscreen .model-viewer-wrapper {
    width: 100%;
    height: 100%;
}

/* Adjust model viewer in fullscreen */
body:fullscreen model-viewer,
body:-webkit-full-screen model-viewer,
body:-moz-full-screen model-viewer,
body:-ms-fullscreen model-viewer {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

/* Keep configurator visible in fullscreen */
body:fullscreen .configurator,
body:-webkit-full-screen .configurator,
body:-moz-full-screen .configurator,
body:-ms-fullscreen .configurator {
    display: flex;
}

/* Remove old fullscreen styles that were specific to model-viewer-wrapper */
.model-viewer-wrapper:fullscreen .configurator,
.model-viewer-wrapper:-webkit-full-screen .configurator,
.model-viewer-wrapper:-moz-full-screen .configurator,
.model-viewer-wrapper:-ms-fullscreen .configurator {
    display: none;
}

.model-viewer-wrapper:fullscreen model-viewer,
.model-viewer-wrapper:-webkit-full-screen model-viewer,
.model-viewer-wrapper:-moz-full-screen model-viewer,
.model-viewer-wrapper:-ms-fullscreen model-viewer {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

/* Adjust logo position in fullscreen */
body:fullscreen .logo-wrapper,
body:-webkit-full-screen .logo-wrapper,
body:-moz-full-screen .logo-wrapper,
body:-ms-fullscreen .logo-wrapper {
    top: 1.5rem;
}

body:-ms-fullscreen .logo-wrapper {
    top: 1.5rem;
}

.hostinger-logo-wrapper {
    position: absolute;
    bottom: 16px;
    right: 16px;
    transform-origin: bottom right;
    z-index: 999;
}

.hostinger-logo-wrapper img {
    /* You might want to specify width/height for the logo */
    /* For example: */
    width: 50px;
    height: 50px;
}

@media (max-width: 768px) {
    .hostinger-logo-wrapper {
        display: none;
    }
}

/* Progress Bar Styles */
.progress-bar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    min-width: 280px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.progress-bar.hide {
    opacity: 0;
    pointer-events: none;
}

.progress-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    background: linear-gradient(45deg, #0066CC, #3a5edb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-bar-background {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.update-bar {
    height: 100%;
    background: linear-gradient(90deg, #0066CC, #3a5edb);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.progress-percentage {
    font-weight: 600;
    color: #0066CC;
}