/* ========================================
   SUYS KONFIGURÁTOR - 3D Viewer Edition
   ======================================== */

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

body {
    font-family: 'Roboto', sans-serif;
    background: #f5f5f5;
    color: #333;
    overflow: hidden;
    height: 100vh;
}

/* ---- HEADER ---- */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 20px 0 60px;
    z-index: 100;
    position: relative;
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: #d32f2f;
    letter-spacing: 2px;
}

.logo-sub {
    font-size: 16px;
    font-weight: 400;
    color: #333;
    letter-spacing: 3px;
}

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

.search-box {
    position: relative;
}

.search-box input {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 32px 6px 10px;
    font-size: 13px;
    width: 200px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: #d32f2f;
}

.search-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
}

.cart-icon {
    cursor: pointer;
}

/* ---- SIDEBAR ICONS ---- */
.sidebar-icons {
    position: fixed;
    left: 0;
    top: 56px;
    width: 48px;
    height: calc(100vh - 56px);
    background: #2c2c2c;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 8px;
    gap: 4px;
    z-index: 90;
}

.sidebar-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sidebar-icon:hover {
    background: #444;
    color: #fff;
}

.sidebar-icon.active {
    background: #d32f2f;
    color: #fff;
}

/* ---- MAIN CONTENT ---- */
.main-content {
    display: flex;
    margin-left: 48px;
    height: calc(100vh - 56px);
}

/* ---- CONFIG PANEL (LEFT) ---- */
.config-panel {
    width: 460px;
    min-width: 460px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    padding: 24px 28px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 16px;
    font-weight: 500;
    color: #222;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* ---- TABS ---- */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid #eee;
    padding-bottom: 0;
}

.tab {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    border: 1px solid #ddd;
    border-bottom: none;
    background: #fff;
    color: #666;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    transition: all 0.2s;
    position: relative;
    bottom: -2px;
}

.tab:hover {
    background: #fafafa;
    color: #333;
}

.tab.active {
    background: #d32f2f;
    color: #fff;
    border-color: #d32f2f;
}

/* ---- TAB CONTENT ---- */
.tab-content {
    display: none;
    flex: 1;
}

.tab-content.active {
    display: block;
}

.section-title {
    font-size: 13px;
    font-weight: 700;
    color: #222;
    margin: 20px 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- CONFIG FIELDS ---- */
.config-field {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.config-field label {
    display: block;
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.config-field input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.config-field input:focus {
    border-color: #d32f2f;
}

.config-field.clickable {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    transition: background 0.15s;
    padding: 12px 8px;
    margin: 0 -8px;
    border-radius: 4px;
}

.config-field.clickable:hover {
    background: #fafafa;
}

.config-field.clickable label {
    margin-bottom: 0;
    pointer-events: none;
    flex: 1;
}

.field-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-value strong {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.color-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 3px;
}

/* ---- SUMMARY ---- */
.summary-block {
    text-align: center;
    padding: 30px 0;
}

.summary-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 24px;
    line-height: 1.4;
}

.summary-code {
    margin-bottom: 8px;
}

.summary-code span {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 2px;
}

.summary-code strong {
    font-size: 16px;
}

.summary-price {
    margin-bottom: 28px;
}

.summary-price span {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.price {
    font-size: 28px;
    color: #d32f2f;
    font-weight: 700;
}

.price small {
    font-size: 14px;
    font-weight: 400;
    color: #888;
}

.summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

/* ---- BUTTONS ---- */
.btn {
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 2px solid transparent;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.btn-red {
    background: #d32f2f;
    color: #fff;
    border-color: #d32f2f;
}

.btn-red:hover {
    background: #b71c1c;
    border-color: #b71c1c;
}

.btn-red-outline {
    background: transparent;
    color: #d32f2f;
    border-color: #d32f2f;
}

.btn-red-outline:hover {
    background: #d32f2f;
    color: #fff;
}

/* ---- NAV BUTTONS ---- */
.nav-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 20px 0;
    margin-top: auto;
    border-top: 1px solid #eee;
}

.btn-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---- 3D VIEWER PANEL (RIGHT) ---- */
.viewer-panel {
    flex: 1;
    position: relative;
    background: #fafafa;
    display: flex;
    flex-direction: column;
}

#viewer-container {
    flex: 1;
    width: 100%;
    cursor: grab;
}

#viewer-container:active {
    cursor: grabbing;
}

.viewer-toolbar {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.viewer-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.viewer-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.viewer-btn.active {
    background: #d32f2f;
    color: #fff;
    border-color: #d32f2f;
}

.viewer-label {
    text-align: center;
    padding: 8px;
    font-size: 12px;
    color: #888;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.viewer-hint {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 6px 0 12px;
    font-size: 11px;
    color: #aaa;
}

/* ---- LOADING OVERLAY ---- */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(250,250,250,0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #eee;
    border-top-color: #d32f2f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    margin-top: 16px;
    font-size: 14px;
    color: #888;
}

/* ---- SCROLLBAR ---- */
.config-panel::-webkit-scrollbar {
    width: 6px;
}

.config-panel::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.config-panel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.config-panel::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ---- CAMERA PRESET BAR ---- */
.cam-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    border-top: 1px solid #eee;
}

.cam-bar-label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

#cam-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.cam-btn {
    height: 32px;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.2px;
    border: 1px solid #ddd;
    border-radius: 16px;
    background: #f7f7f7;
    color: #444;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s;
    line-height: 30px;
}

.cam-btn:hover {
    border-color: #d32f2f;
    color: #d32f2f;
    background: #fff;
}

.cam-btn.active {
    background: #d32f2f;
    border-color: #d32f2f;
    color: #fff;
    box-shadow: 0 2px 8px rgba(211,47,47,0.3);
}

/* ---- AR EXPORT BUTTON ---- */
.viewer-btn--ar {
    width: auto;
    padding: 0 10px;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: #fff;
    background: #1a1a2e;
    border-color: #1a1a2e;
}
.viewer-btn--ar:hover {
    background: #16213e;
    border-color: #16213e;
    color: #fff;
}
.viewer-btn--ar:disabled {
    opacity: 0.6;
    cursor: wait;
}
.ar-btn-label {
    white-space: nowrap;
}


/* ---- AR PROGRESS OVERLAY ---- */
#ar-progress-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.ar-progress-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px 36px 32px;
    width: min(340px, 88vw);
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.ar-progress-icon {
    position: relative;
    width: 52px;
    height: 52px;
}
.ar-spin-arc {
    transform-origin: 22px 22px;
    animation: ar-spin 0.9s linear infinite;
}
@keyframes ar-spin {
    to { transform: rotate(360deg); }
}
.ar-progress-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}
.ar-progress-sub {
    font-size: 13px;
    color: #888;
    line-height: 1.5;
    min-height: 36px;
}
.ar-progress-close {
    margin-top: 8px;
    background: #f0f0f0;
    border: none;
    border-radius: 10px;
    padding: 11px 32px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
}
.ar-progress-close:active {
    background: #e0e0e0;
}

/* ---- FABRIC PICKER FIELD (inside BARVY tab) ---- */
.fabric-picker-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-top: 6px;
}
.fabric-picker-field:hover {
    border-color: #d32f2f;
    background: #fafafa;
}

/* ---- FABRIC PICKER MODAL ---- */
.fabric-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.fabric-modal {
    background: #fff;
    border-radius: 8px;
    width: 560px;
    max-width: 95vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.fabric-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.fabric-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    letter-spacing: 0.2px;
}

.fabric-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #888;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}
.fabric-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.fabric-modal-search {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    position: relative;
    flex-shrink: 0;
}

.fabric-modal-search input {
    width: 100%;
    padding: 8px 10px 8px 36px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.fabric-modal-search input:focus {
    border-color: #d32f2f;
}

.fabric-modal-groups {
    display: flex;
    padding: 0 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.fabric-group-tab {
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: #888;
    transition: all 0.2s;
    margin-bottom: -1px;
}
.fabric-group-tab.active {
    color: #d32f2f;
    border-bottom-color: #d32f2f;
}
.fabric-group-tab:hover {
    color: #333;
}

.fabric-modal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.fabric-swatch {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #f7f7f7;
}
.fabric-swatch:hover {
    border-color: #bbb;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.fabric-swatch.selected {
    border-color: #d32f2f;
    box-shadow: 0 2px 10px rgba(211, 47, 47, 0.3);
}

.fabric-swatch img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.fabric-swatch span {
    display: block;
    padding: 5px 6px 2px;
    font-size: 11px;
    color: #444;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fabric-swatch small {
    display: block;
    padding: 0 6px 6px;
    font-size: 10px;
    color: #999;
    text-align: center;
}

/* ---- BACK LINK ---- */
.back-link {
    display: flex;
    align-items: center;
    color: #333;
    text-decoration: none;
    margin-right: 4px;
    padding: 4px;
    border-radius: 4px;
    transition: background .15s;
}
.back-link:hover {
    background: #f0f0f0;
}

/* ---- LANDING PAGE (carousel) ---- */
.landing-body {
    overflow: auto;
    background: #fff;
}

.landing-header {
    padding-left: 20px;
}

.landing-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 24px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Carousel --- */
.carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    margin-bottom: 40px;
    min-height: 340px;
}

.carousel-arrow {
    background: none;
    border: none;
    cursor: pointer;
    color: #bbb;
    padding: 8px;
    flex-shrink: 0;
    transition: color .25s;
    z-index: 2;
}
.carousel-arrow:hover {
    color: #e5524d;
}

.carousel-track {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
    height: 340px;
    overflow: visible;
}

.carousel-item {
    position: absolute;
    transition: all .5s ease;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
}
.carousel-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Center (active) item */
.carousel-item.active {
    width: 340px;
    height: 340px;
    z-index: 3;
    transform: translateX(0) scale(1);
    opacity: 1;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
}

/* Left neighbor */
.carousel-item.left {
    width: 260px;
    height: 260px;
    z-index: 2;
    transform: translateX(-220px) scale(0.85);
    opacity: 0.7;
}

/* Right neighbor */
.carousel-item.right {
    width: 260px;
    height: 260px;
    z-index: 2;
    transform: translateX(220px) scale(0.85);
    opacity: 0.7;
}

.carousel-item:not(.active):not(.left):not(.right) {
    opacity: 0;
    pointer-events: none;
}

/* --- Category labels --- */
.carousel-labels {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 32px;
}

.carousel-label {
    background: none;
    border: none;
    font-family: 'Roboto', sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: #c4c6c8;
    padding: 0 25px;
    cursor: pointer;
    transition: color .25s;
    line-height: 1;
}
.carousel-label:hover {
    color: #e5524d;
}
.carousel-label.active {
    color: #000;
    cursor: default;
    font-weight: 600;
}

/* --- Configure button --- */
.carousel-actions {
    display: flex;
    justify-content: center;
}

.btn-configure {
    display: inline-block;
    background: #e5524d;
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .5px;
    padding: 12px 36px;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    transition: background .2s;
}
.btn-configure:hover {
    background: #c62828;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }
    .config-panel {
        width: 100%;
        min-width: unset;
        max-height: 50vh;
    }
    .viewer-panel {
        min-height: 50vh;
    }
    .sidebar-icons {
        display: none;
    }
    .main-content {
        margin-left: 0;
    }
    .header {
        padding-left: 20px;
    }
    .carousel {
        min-height: 240px;
    }
    .carousel-track {
        height: 240px;
    }
    .carousel-item.active {
        width: 220px;
        height: 220px;
    }
    .carousel-item.left {
        width: 160px;
        height: 160px;
        transform: translateX(-140px) scale(0.8);
    }
    .carousel-item.right {
        width: 160px;
        height: 160px;
        transform: translateX(140px) scale(0.8);
    }
    .carousel-label {
        font-size: 14px;
        padding: 0 12px;
    }
}
