/* AutoCityModel Webshop Styles */

:root {
    --primary: #7B3F3F;
    --primary-hover: #6B3535;
    --secondary: #2C3E50;
    --accent: #E8E4DB;
    --text: #333333;
    --text-light: #666666;
    --border: #D4D4D4;
    --bg-light: #F8F8F8;
    --success: #10b981;
    --white: #FFFFFF;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--white);
    line-height: 1.6;
}

/* Header */
.shop-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
}

.main-nav {
    display: flex;
    gap: 30px;
}

.main-nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.language-selector {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--white);
    cursor: pointer;
}

.cart-icon {
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--text);
}

/* Product Main Section */
.product-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 40px;
    height: calc(100vh - 100px);
    overflow: hidden;
}

.product-container {
    display: grid;
    grid-template-columns: 60fr 40fr;
    gap: 80px;
}

/* Product Gallery */
.product-gallery {
    position: sticky;
    top: 120px;
    height: fit-content;
}

.main-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--bg-light);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.main-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.nav-btn {
    pointer-events: all;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.nav-btn:hover {
    background: var(--white);
    transform: scale(1.1);
}

.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.thumbnail {
    aspect-ratio: 4/3;
    background: var(--bg-light);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.thumbnail:hover {
    border-color: var(--primary);
}

.thumbnail.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Product Details */
.product-details {
    padding-top: 20px;
    position: sticky;
    top: 120px;
    height: fit-content;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.product-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 10px;
}

.product-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

.product-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 10px;
}

.product-rating {
    color: #FFA500;
    margin-bottom: 30px;
    font-size: 1rem;
}

.placeholder-text {
    opacity: 0.6;
    font-style: italic;
}

.product-description {
    margin-bottom: 30px;
    line-height: 1.8;
    color: var(--text);
}

.product-features {
    margin-bottom: 40px;
}

.feature-item {
    padding: 8px 0;
    color: var(--text);
    font-size: 0.95rem;
}

/* Option Section */
.option-section {
    margin-bottom: 30px;
}

.option-label {
    display: block;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 15px;
    font-size: 1rem;
}

.size-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.size-btn {
    padding: 20px 15px;
    border: 2px solid var(--border);
    background: var(--white);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.size-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.size-btn.active {
    border-color: var(--primary);
    background: rgba(123, 63, 63, 0.05);
}

.size-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 5px;
}

.size-dimensions {
    font-size: 0.9rem;
    color: var(--text-light);
}

.size-info {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Product Info Card */
.product-info-card {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.info-title {
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 10px;
}

.info-list {
    list-style: none;
}

.info-list li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.info-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 18px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 18px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary:disabled {
    background: var(--white);
    color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-large {
    padding: 22px 40px;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.trust-badges {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 30px;
}

.badge {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Location Selector View */
.location-selector-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 200;
}

/* Location Header Bar */
.location-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 20px 40px;
    display: flex;
    align-items: center;
    gap: 30px;
    flex-shrink: 0;
}

.back-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.back-btn:hover {
    color: var(--primary-hover);
}

.location-header-content {
    flex: 1;
    text-align: center;
}

.header-spacer {
    width: 130px;
    flex-shrink: 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 5px;
}

.section-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Location Container */
.location-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
    display: grid;
    grid-template-columns: 65fr 35fr;
    gap: 40px;
    flex: 1;
    min-height: 0;
    align-items: start;
}

.map-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: calc(100vh - 160px);
    min-height: 500px;
}

.search-bar {
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Autocomplete Styles */
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    display: none;
}

.autocomplete-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: #f8f8f8;
}

.autocomplete-primary {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.autocomplete-secondary {
    font-size: 0.85rem;
    color: var(--text-light);
}

.location-map {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--white);
    flex: 1;
    min-height: 0;
}

/* Selection Summary */
.selection-summary {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    align-self: start;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.summary-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 20px;
}

.summary-card {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 500;
    color: var(--text-light);
}

.summary-value {
    font-weight: 600;
    color: var(--secondary);
}

.summary-note {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    padding-top: 15px;
    margin-top: 10px;
    border-top: 1px solid var(--border);
}

.location-info-card {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.info-header {
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 10px;
}

.location-name {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 15px;
}

.location-stats {
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.stat-label {
    color: var(--text-light);
}

.stat-value {
    font-weight: 600;
    color: var(--secondary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-change-options {
    width: 100%;
    padding: 12px;
    background: none;
    border: 2px solid var(--border);
    border-radius: 6px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.btn-change-options:hover {
    background: var(--bg-light);
    border-color: var(--primary);
}

.help-text {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 15px;
}

/* Progress Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
}

.modal-content h2 {
    font-size: 1.8rem;
    color: var(--secondary);
    margin-bottom: 30px;
    text-align: center;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 40px;
    background: var(--bg-light);
    border-radius: 20px;
    overflow: visible;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 20px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text);
    z-index: 10;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-message {
    font-size: 1rem;
    color: var(--text);
    font-weight: 500;
}

.time-estimate {
    font-size: 0.95rem;
    color: var(--text-light);
}

/* Custom Warning */
.custom-warning {
    background: #FFF3CD;
    border: 2px solid #FFC107;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

/* Custom Frame Warning in Summary */
.custom-frame-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 10px 12px;
    margin-top: 10px;
    font-size: 0.85rem;
    color: #856404;
    text-align: center;
}

/* Custom Configuration Card */
.custom-config-card {
    background: var(--accent);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.config-header {
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 15px;
    font-size: 1rem;
}

.slider-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 8px;
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

.slider-value {
    font-weight: 600;
    color: var(--secondary);
    min-width: 80px;
    text-align: right;
}

.dimensions-preview {
    background: var(--white);
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.preview-title {
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.dim-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.9rem;
}

.dim-row span:first-child {
    color: var(--text-light);
}

.dim-row span:last-child {
    font-weight: 600;
    color: var(--secondary);
}

/* Smooth Toggle Button */
.smooth-toggle-btn {
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.smooth-toggle-btn:hover {
    border-color: var(--primary);
    background: var(--white);
}

.smooth-toggle-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

.smooth-toggle-btn.active span {
    filter: brightness(0) invert(1);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .product-main {
        height: auto;
        overflow: visible;
    }

    .product-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .product-gallery {
        position: relative;
        top: 0;
    }

    .location-header {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .location-header-content {
        text-align: left;
    }
    
    .header-spacer {
        display: none;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
    
    .location-container {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .selection-summary {
        position: relative;
        top: 0;
    }
    
    .location-map {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 15px 20px;
    }

    .main-nav {
        display: none;
    }

    .product-main,
    .location-selector-view {
        padding: 30px 20px;
    }

    .size-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .thumbnail-gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .location-map {
        height: 500px;
    }

    .product-title {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

/* Leaflet Map Customization */
.leaflet-container {
    font-family: inherit;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

/* Circle overlay for location selection */
.selection-circle {
    fill: rgba(123, 63, 63, 0.2);
    stroke: var(--primary);
    stroke-width: 3;
}

/* Preview Modal Styles */
.preview-modal-content {
    max-width: 800px;
    width: 95%;
    max-height: 95vh;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: var(--bg-light);
    color: var(--text);
}

.preview-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 1rem;
}

.preview-gallery {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-main-image-container {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    background: var(--bg-light);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.preview-main-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.preview-image-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.preview-thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    flex-shrink: 0;
}

.preview-thumbnail-gallery .thumbnail {
    position: relative;
}

.thumbnail-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px;
    font-size: 0.85rem;
    text-align: center;
    font-weight: 500;
}

.preview-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.preview-actions .btn-secondary,
.preview-actions .btn-primary {
    width: auto;
    min-width: 180px;
    padding: 15px 30px;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .preview-modal-content {
        width: 95%;
        max-height: 90vh;
        padding: 20px 15px;
    }

    .modal-close-btn {
        top: 15px;
        right: 15px;
        font-size: 2rem;
    }

    .preview-thumbnail-gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .preview-actions {
        flex-direction: column;
    }

    .preview-actions .btn-secondary,
    .preview-actions .btn-primary {
        width: 100%;
    }
}
