/* Reset and Base - Scoped to configurator */
.configurator-embed,
.configurator-embed * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* For standalone use */
html, body {
    width: 100%;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
}

/* Embed container */
.configurator-embed {
    width: 100%;
    height: 100%;
    min-height: 300px;
    position: relative;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
}

/* When in windowed mode, allow smaller heights */
.configurator-embed.windowed-mode {
    min-height: 200px;
}

.configurator-embed.windowed-mode #app-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.configurator-embed.windowed-mode #three-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Loading Screen */
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #333;
    border-top-color: #CC0000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 18px;
    margin-bottom: 10px;
}

.loading-progress {
    font-size: 24px;
    font-weight: bold;
    color: #CC0000;
}

/* Mini Loader - for configuration changes */
#mini-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 500;
    pointer-events: none;
}

#mini-loader.hidden {
    display: none;
}

.mini-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #CC0000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.3);
}

/* Rotate Overlay */
#rotate-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.rotate-content {
    text-align: center;
    color: white;
    padding: 20px;
}

.rotate-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    animation: rotate-phone 1.5s ease-in-out infinite;
}

@keyframes rotate-phone {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

.rotate-message {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

.rotate-submessage {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 20px;
}

.skip-btn {
    background: transparent;
    color: #888;
    border: 1px solid #888;
    padding: 12px 40px;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.skip-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #fff;
}

/* Show rotate overlay on mobile portrait */
@media only screen and (max-width: 1024px) and (orientation: portrait) {
    body.is-mobile:not(.rotate-skipped) #rotate-overlay {
        display: flex;
    }
}

/* Main Container */
#app-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 0;
}

#three-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    margin: 0;
    padding: 0;
    z-index: 1;
}

/* Top Bar */
#top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 30px;
    z-index: 100;
}

.product-selector,
.size-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

#top-bar label {
    color: #fff;
    font-size: 14px;
    margin-right: 0;
    font-weight: 700;
}

#top-bar select {
    background: #333;
    color: white;
    border: 1px solid #555;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    min-width: 150px;
}

#top-bar select:hover {
    border-color: #CC0000;
}

.price-display {
    display: none; /* Hidden for now */
    margin-left: auto;
    color: white;
    font-size: 18px;
}

.price-label {
    color: #aaa;
    margin-right: 8px;
}

#price-value {
    font-weight: bold;
    color: #CC0000;
    font-size: 24px;
}

/* Side Panel */
#side-panel {
    position: absolute;
    top: 70px;
    right: 10px;
    width: 280px;
    max-height: calc(100% - 90px);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    overflow-y: auto;
    z-index: 100;
}

#side-panel h3 {
    color: white;
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.config-section {
    margin-bottom: 20px;
}

.config-section h4 {
    color: #aaa;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

/* Light Toggle */
.light-toggle {
    display: flex;
    gap: 10px;
}

.light-btn {
    flex: 1;
    background: #333;
    color: white;
    border: 1px solid #555;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
}

.light-btn:hover {
    border-color: #CC0000;
}

.light-btn.active {
    background: #CC0000;
    border-color: #CC0000;
}

/* Color Options */
.color-grid {
    display: flex;
    gap: 10px;
}

.color-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: #CC0000;
    box-shadow: 0 0 10px rgba(74, 144, 217, 0.5);
}

.color-btn[data-color="FFFFFF"] {
    border: 2px solid #555;
}

.color-btn[data-color="FFFFFF"].active {
    border-color: #CC0000;
}

/* Side Selects */
.side-select {
    width: 100%;
    background: #333;
    color: white;
    border: 1px solid #555;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.side-select:hover {
    border-color: #CC0000;
}

/* Roof Options */
#roof-options {
    display: flex;
    gap: 10px;
}

.roof-btn {
    flex: 1;
    background: #333;
    color: white;
    border: 1px solid #555;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
}

.roof-btn:hover {
    border-color: #CC0000;
}

.roof-btn.active {
    background: #CC0000;
    border-color: #CC0000;
}

/* Primary Button */
.primary-btn {
    width: 100%;
    background: linear-gradient(135deg, #c41e3a, #8b0000);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(196, 30, 58, 0.4);
}

/* Controls Hint */
#controls-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    font-size: 12px;
    z-index: 100;
}

#controls-hint span {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #333;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 25px;
    text-align: center;
}

/* Form Styles */
#quote-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row input,
.form-row select,
.form-row textarea {
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #CC0000;
}

.form-row input.error,
.form-row select.error {
    border-color: #c41e3a;
}

.form-row input.error::placeholder,
.form-row select.error::placeholder {
    color: #c41e3a;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #c41e3a, #8b0000);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(196, 30, 58, 0.4);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Success Modal */
.success-content {
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #28a745, #20c997);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 40px;
    color: white;
    margin: 0 auto 20px;
}

.success-content p {
    color: #666;
    margin-bottom: 20px;
}

/* Responsive - Tablet/Small Desktop */
@media (max-width: 768px) {
    #top-bar {
        flex-wrap: wrap;
        height: auto;
        padding: 10px;
        gap: 10px;
    }

    #top-bar .product-selector,
    #top-bar .size-selector {
        flex: 1;
        min-width: 120px;
    }

    #top-bar select {
        min-width: auto;
        width: 100%;
    }

    .price-display {
        width: 100%;
        text-align: center;
        margin-left: 0;
    }

    #side-panel {
        position: absolute;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 50%;
        border-radius: 20px 20px 0 0;
    }

    .form-row {
        flex-direction: column;
    }

    #controls-hint {
        display: none;
    }
}

/* Mobile Portrait - Collapsible Panel */
@media (max-width: 500px) and (orientation: portrait) {
    #top-bar {
        padding: 8px 10px;
        gap: 8px;
    }

    #top-bar label {
        font-size: 12px;
    }

    #top-bar select {
        padding: 6px 10px;
        font-size: 13px;
    }

    #price-value {
        font-size: 20px;
    }

    /* Collapsible side panel */
    #side-panel {
        position: absolute;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 45vh;
        border-radius: 20px 20px 0 0;
        padding: 0;
        transition: max-height 0.3s ease, transform 0.3s ease;
        overflow-y: auto;
    }

    #side-panel.collapsed {
        max-height: 60px;
        overflow: hidden;
    }

    #side-panel h3 {
        font-size: 16px;
        margin: 0;
        padding: 15px 15px 12px 15px;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: sticky;
        top: 0;
        background: rgba(0, 0, 0, 0.95);
        border-radius: 20px 20px 0 0;
        border-bottom: 1px solid #333;
        z-index: 10;
    }

    /* Scrollable content area */
    #side-panel .config-section,
    #side-panel .primary-btn {
        margin-left: 15px;
        margin-right: 15px;
    }

    #side-panel .primary-btn {
        margin-bottom: 15px;
    }

    #side-panel h3::after {
        content: '▲';
        font-size: 12px;
        transition: transform 0.3s;
    }

    #side-panel.collapsed h3::after {
        transform: rotate(180deg);
    }

    .config-section {
        margin-bottom: 12px;
    }

    .config-section h4 {
        font-size: 11px;
        margin-bottom: 6px;
    }

    /* Horizontal layout for options */
    .light-toggle,
    #roof-options {
        gap: 8px;
    }

    .light-btn,
    .roof-btn {
        padding: 8px;
        font-size: 12px;
    }

    .color-btn {
        width: 32px;
        height: 32px;
    }

    .side-select {
        padding: 8px 10px;
        font-size: 13px;
    }

    .primary-btn {
        padding: 12px 15px;
        font-size: 14px;
        margin-top: 12px;
    }

    /* Two columns for sides on mobile */
    .config-sections-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

/* Mobile Landscape */
@media (max-width: 850px) and (orientation: landscape) {
    #top-bar {
        height: 50px;
        padding: 5px 15px;
        gap: 15px;
    }

    #top-bar label {
        font-size: 12px;
    }

    #top-bar select {
        padding: 5px 10px;
        font-size: 12px;
        min-width: 100px;
    }

    #price-value {
        font-size: 18px;
    }

    #side-panel {
        position: absolute;
        top: 55px;
        bottom: 10px;
        right: 10px;
        left: auto;
        width: 220px;
        max-height: none;
        height: auto;
        border-radius: 12px;
        padding: 12px;
        overflow-y: auto;
    }

    #side-panel h3 {
        font-size: 14px;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    .config-section {
        margin-bottom: 10px;
    }

    .config-section h4 {
        font-size: 10px;
        margin-bottom: 5px;
    }

    .light-btn,
    .roof-btn {
        padding: 6px;
        font-size: 11px;
    }

    .color-btn {
        width: 28px;
        height: 28px;
    }

    .side-select {
        padding: 6px 8px;
        font-size: 12px;
    }

    .primary-btn {
        padding: 10px;
        font-size: 13px;
        margin-top: 10px;
    }

    #controls-hint {
        display: none;
    }
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Custom Scrollbar - Dark theme */
#side-panel::-webkit-scrollbar {
    width: 6px;
}

#side-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

#side-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

#side-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Firefox scrollbar */
#side-panel {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

/* Desktop Fullscreen Button */
#desktop-fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #444;
    border-radius: 8px;
    cursor: pointer;
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, border-color 0.3s;
}

#desktop-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: #CC0000;
}

#desktop-fullscreen-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Hide on mobile/tablet - they use iframe fullscreen */
@media (max-width: 1024px) {
    #desktop-fullscreen-btn {
        display: none;
    }
}

/* ============================================
   Iframe Embed Modes (Mobile)
   ============================================ */

/* Windowed Mode - Compact UI for small embedded window (like PC but smaller) */
.configurator-embed.windowed-mode #top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    padding: 6px 55px 6px 10px; /* Right padding for fullscreen button */
    gap: 6px;
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid #333;
    z-index: 20;
    flex-wrap: nowrap;
    align-items: center;
}

.configurator-embed.windowed-mode .product-selector,
.configurator-embed.windowed-mode .size-selector {
    flex-direction: row;
    align-items: center;
    gap: 4px;
}

.configurator-embed.windowed-mode #top-bar label {
    font-size: 9px;
    white-space: nowrap;
}

.configurator-embed.windowed-mode #top-bar select {
    padding: 4px 6px;
    font-size: 11px;
    min-width: 80px;
    background: rgba(40, 40, 40, 0.95);
}

.configurator-embed.windowed-mode .price-display {
    font-size: 10px;
    margin-left: auto;
}

.configurator-embed.windowed-mode .price-display .price-label {
    display: none;
}

.configurator-embed.windowed-mode #price-value {
    font-size: 13px;
}

.configurator-embed.windowed-mode #side-panel {
    position: absolute;
    bottom: 8px;
    right: 8px;
    left: auto;
    top: auto;
    width: 180px;
    max-height: 60%;
    border-radius: 10px;
    padding: 0;
    background: rgba(0, 0, 0, 0.92);
    transform: translateY(0);
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
    overflow-y: auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.configurator-embed.windowed-mode #side-panel.collapsed {
    width: auto;
    max-height: none;
    overflow: hidden;
    border-radius: 8px;
}

.configurator-embed.windowed-mode #side-panel h3 {
    font-size: 11px;
    padding: 8px 12px;
    margin: 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid #333;
    z-index: 10;
    white-space: nowrap;
}

.configurator-embed.windowed-mode #side-panel.collapsed h3 {
    border-radius: 8px;
    border-bottom: none;
}

.configurator-embed.windowed-mode #side-panel h3::after {
    content: '▼';
    font-size: 8px;
    transition: transform 0.3s;
}

.configurator-embed.windowed-mode #side-panel.collapsed h3::after {
    content: '▲';
}

/* Hide content when collapsed */
.configurator-embed.windowed-mode #side-panel.collapsed .config-section,
.configurator-embed.windowed-mode #side-panel.collapsed .primary-btn {
    display: none;
}

.configurator-embed.windowed-mode .config-section {
    margin: 6px 8px;
}

.configurator-embed.windowed-mode .side-select {
    width: 100%;
}

.configurator-embed.windowed-mode .config-section h4 {
    font-size: 9px;
    margin-bottom: 3px;
}

.configurator-embed.windowed-mode .light-btn,
.configurator-embed.windowed-mode .roof-btn {
    padding: 4px 6px;
    font-size: 9px;
}

.configurator-embed.windowed-mode .color-btn {
    width: 22px;
    height: 22px;
}

.configurator-embed.windowed-mode .side-select {
    padding: 4px 6px;
    font-size: 10px;
}

.configurator-embed.windowed-mode .primary-btn {
    padding: 8px;
    font-size: 11px;
    margin: 6px 8px 8px 8px;
    width: calc(100% - 16px);
    box-sizing: border-box;
}

.configurator-embed.windowed-mode #controls-hint {
    display: none;
}

.configurator-embed.windowed-mode .light-toggle,
.configurator-embed.windowed-mode #roof-options {
    gap: 4px;
}

.configurator-embed.windowed-mode .color-grid {
    gap: 4px;
}

/* Windowed Mode - Compact Modal/Form */
.configurator-embed.windowed-mode .modal {
    padding: 5px;
    justify-content: center;
    align-items: center;
}

.configurator-embed.windowed-mode .modal-content {
    padding: 10px;
    padding-top: 10px;
    border-radius: 10px;
    max-width: calc(100% - 10px);
    width: calc(100% - 10px);
    max-height: 95%;
    margin: 0;
    position: relative;
}

.configurator-embed.windowed-mode .modal-content h2 {
    font-size: 13px;
    margin-bottom: 8px;
    padding-right: 20px;
}

.configurator-embed.windowed-mode .close-btn {
    top: 8px;
    right: 8px;
    left: auto;
    font-size: 16px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
    border-radius: 50%;
}

.configurator-embed.windowed-mode #quote-form {
    gap: 6px;
}

.configurator-embed.windowed-mode .form-row {
    gap: 6px;
    flex-direction: row !important; /* Keep fields inline */
}

.configurator-embed.windowed-mode .form-row input,
.configurator-embed.windowed-mode .form-row select,
.configurator-embed.windowed-mode .form-row textarea {
    padding: 6px 8px;
    font-size: 11px;
    border-radius: 5px;
    border-width: 1px;
    min-width: 0; /* Allow shrinking */
}

.configurator-embed.windowed-mode .form-row textarea {
    display: block;
    rows: 1;
    min-height: 30px;
    resize: none;
}

.configurator-embed.windowed-mode .submit-btn {
    padding: 8px;
    font-size: 11px;
    border-radius: 5px;
    margin-top: 2px;
}

/* Fullscreen Portrait Mode - Bottom drawer UI */
.configurator-embed.fullscreen-portrait #top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    padding: 8px 60px 8px 15px; /* Right padding for fullscreen button */
    gap: 10px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 80%, transparent 100%);
    border-bottom: none;
}

.configurator-embed.fullscreen-portrait #top-bar select {
    padding: 6px 10px;
    font-size: 12px;
    min-width: 100px;
}

.configurator-embed.fullscreen-portrait .price-display {
    font-size: 13px;
}

.configurator-embed.fullscreen-portrait #price-value {
    font-size: 18px;
}

/* Fullscreen Portrait - Same compact panel as windowed mode */
.configurator-embed.fullscreen-portrait #side-panel {
    position: fixed !important;
    bottom: 10px !important;
    right: 10px !important;
    left: auto !important;
    top: auto !important;
    width: 200px !important;
    max-height: 65%;
    border-radius: 10px;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(0, 0, 0, 0.92);
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0,0,0,0.5);
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}

.configurator-embed.fullscreen-portrait #side-panel.collapsed {
    width: auto !important;
    max-height: none;
    overflow: hidden;
    border-radius: 8px;
}

.configurator-embed.fullscreen-portrait #side-panel h3 {
    font-size: 13px;
    padding: 10px 14px;
    margin: 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid #333;
    z-index: 10;
    white-space: nowrap;
}

.configurator-embed.fullscreen-portrait #side-panel.collapsed h3 {
    border-radius: 8px;
    border-bottom: none;
}

.configurator-embed.fullscreen-portrait #side-panel h3::after {
    content: '▼';
    font-size: 10px;
    transition: transform 0.3s;
}

.configurator-embed.fullscreen-portrait #side-panel.collapsed h3::after {
    content: '▲';
}

/* Hide content when collapsed */
.configurator-embed.fullscreen-portrait #side-panel.collapsed .config-section,
.configurator-embed.fullscreen-portrait #side-panel.collapsed .primary-btn {
    display: none;
}

.configurator-embed.fullscreen-portrait .config-section {
    margin: 8px 10px;
}

.configurator-embed.fullscreen-portrait .config-section h4 {
    font-size: 10px;
    margin-bottom: 4px;
}

.configurator-embed.fullscreen-portrait .light-btn,
.configurator-embed.fullscreen-portrait .roof-btn {
    padding: 6px 8px;
    font-size: 11px;
}

.configurator-embed.fullscreen-portrait .light-toggle,
.configurator-embed.fullscreen-portrait #roof-options {
    gap: 6px;
}

.configurator-embed.fullscreen-portrait .color-grid {
    gap: 6px;
}

.configurator-embed.fullscreen-portrait .color-btn {
    width: 26px;
    height: 26px;
}

.configurator-embed.fullscreen-portrait .side-select {
    padding: 6px 8px;
    font-size: 11px;
}

.configurator-embed.fullscreen-portrait .primary-btn {
    padding: 10px;
    font-size: 12px;
    margin: 8px 10px 10px 10px;
    width: calc(100% - 20px);
    box-sizing: border-box;
}

.configurator-embed.fullscreen-portrait #controls-hint {
    display: none;
}

/* Fullscreen Landscape Mode - Side panel UI */
.configurator-embed.fullscreen-landscape #top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    padding: 5px 15px;
    gap: 15px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 80%, transparent 100%);
    border-bottom: none;
}

.configurator-embed.fullscreen-landscape #top-bar select {
    padding: 5px 10px;
    font-size: 12px;
    min-width: 100px;
}

.configurator-embed.fullscreen-landscape #price-value {
    font-size: 18px;
}

.configurator-embed.fullscreen-landscape #side-panel {
    position: absolute;
    top: 55px;
    bottom: 10px;
    right: 10px;
    left: auto;
    width: 220px;
    max-height: none;
    height: auto;
    border-radius: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.9);
    overflow-y: auto;
}

.configurator-embed.fullscreen-landscape #side-panel h3 {
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #444;
}

.configurator-embed.fullscreen-landscape #side-panel h3::after {
    display: none;
}

.configurator-embed.fullscreen-landscape .config-section {
    margin-bottom: 10px;
}

.configurator-embed.fullscreen-landscape .config-section h4 {
    font-size: 10px;
    margin-bottom: 5px;
}

.configurator-embed.fullscreen-landscape .light-btn,
.configurator-embed.fullscreen-landscape .roof-btn {
    padding: 6px;
    font-size: 11px;
}

.configurator-embed.fullscreen-landscape .color-btn {
    width: 28px;
    height: 28px;
}

.configurator-embed.fullscreen-landscape .side-select {
    padding: 6px 8px;
    font-size: 12px;
}

.configurator-embed.fullscreen-landscape .primary-btn {
    padding: 10px;
    font-size: 13px;
    margin-top: 10px;
}

.configurator-embed.fullscreen-landscape #controls-hint {
    display: none;
}
