/* ============================================
   Stone Room Simulator — Luxury Minimal
   Left: full viewport · Right: sidebar
   ============================================ */

/* Reset */
.srs-simulator *,
.srs-simulator *::before,
.srs-simulator *::after {
    box-sizing: border-box;
}
.srs-simulator button {
    font-family: inherit;
    font-size: inherit;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
}

/* Variables */
.srs-simulator {
    --srs-black:          #0a0a0a;
    --srs-white:          #ffffff;
    --srs-bg:             #f5f4f2;
    --srs-bg-dark:        #1a1a1a;
    --srs-surface:        #fafaf9;
    --srs-border:         rgba(0, 0, 0, 0.08);
    --srs-border-med:     rgba(0, 0, 0, 0.14);
    --srs-border-strong:  rgba(0, 0, 0, 0.22);
    --srs-text:           #0a0a0a;
    --srs-text-secondary: #666666;
    --srs-text-muted:     #aaaaaa;
    --srs-radius:         8px;
    --srs-radius-sm:      5px;
    --srs-radius-lg:      12px;
    --srs-shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.04);
    --srs-shadow:         0 2px 10px rgba(0, 0, 0, 0.06);
    --srs-transition:     0.2s cubic-bezier(0.4, 0, 0.2, 1);

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    color: var(--srs-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ===== Loading ===== */
.srs-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(245, 244, 242, 0.96);
    backdrop-filter: blur(10px);
    z-index: 100;
    gap: 14px;
    transition: opacity 0.4s ease;
}
.srs-loading.srs-hidden {
    opacity: 0;
    pointer-events: none;
}
.srs-loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--srs-border-med);
    border-top-color: var(--srs-black);
    border-radius: 50%;
    animation: srs-spin 0.7s linear infinite;
}
.srs-loading span {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--srs-text-muted);
}
@keyframes srs-spin {
    to { transform: rotate(360deg); }
}

/* ===== Layout ===== */
.srs-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 0;
    align-items: stretch;
    min-height: 70vh;
    border-radius: var(--srs-radius-lg);
    overflow: hidden;
    box-shadow: var(--srs-shadow);
    border: 1px solid var(--srs-border);
}

/* ===== Viewport (left) ===== */
.srs-viewport {
    position: relative;
    background: var(--srs-bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}
.srs-room-container {
    position: relative;
    width: 100%;
    height: 100%;
}
.srs-3d-canvas {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 500px;
    cursor: grab;
    outline: none;
}
.srs-3d-canvas:active {
    cursor: grabbing;
}

/* ===== Sidebar (right) ===== */
.srs-panel {
    background: var(--srs-surface);
    border-left: 1px solid var(--srs-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 80vh;
}

/* Room tabs inside sidebar */
.srs-room-tabs {
    display: flex;
    border-bottom: 1px solid var(--srs-border);
    flex-shrink: 0;
}
.srs-room-tab {
    flex: 1;
    padding: 12px 8px;
    background: transparent !important;
    color: var(--srs-text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    transition: all var(--srs-transition);
    position: relative;
    border-radius: 0 !important;
}
.srs-room-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    transition: background var(--srs-transition);
}
.srs-room-tab:hover {
    color: var(--srs-text-secondary);
    background: transparent !important;
}
.srs-room-tab.srs-room-tab--active {
    color: var(--srs-text);
    background: transparent !important;
    box-shadow: none;
}
.srs-room-tab.srs-room-tab--active::after {
    background: var(--srs-black);
}
/* Hide icon span if still rendered */
.srs-room-tab-icon {
    display: none;
}

/* ===== Panel sections ===== */
.srs-panel-section {
    padding: 14px 16px;
    border-bottom: 1px solid var(--srs-border);
    flex-shrink: 0;
}
.srs-panel-section--header {
    padding: 12px 16px 8px;
}
.srs-panel-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--srs-text-muted);
    margin-bottom: 10px;
}
.srs-panel-instruction {
    margin: 0;
    font-size: 11px;
    color: var(--srs-text-muted);
    font-weight: 400;
}

/* ===== Zone Bar (inside sidebar) ===== */
.srs-zone-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.srs-zone-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px 5px 5px;
    border: 1px solid var(--srs-border-med) !important;
    border-radius: 100px;
    background: var(--srs-white) !important;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--srs-text-secondary);
    transition: all var(--srs-transition);
    white-space: nowrap;
}
.srs-zone-btn:hover {
    border-color: var(--srs-border-strong) !important;
    color: var(--srs-text);
}
.srs-zone-btn.srs-zone-btn--active {
    background: var(--srs-black) !important;
    border-color: var(--srs-black) !important;
    color: var(--srs-white);
}
.srs-zone-btn-swatch {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.10);
    background-color: #d5d5d5;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}
.srs-zone-btn--active .srs-zone-btn-swatch {
    border-color: rgba(255, 255, 255, 0.2);
}
.srs-zone-btn-label {
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Stone Grid ===== */
/* Category tabs — hidden */
.srs-category-tabs {
    display: none;
}

.srs-stone-grid {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    align-content: start;
    scrollbar-width: thin;
    scrollbar-color: var(--srs-border-med) transparent;
}
.srs-stone-grid::-webkit-scrollbar {
    width: 3px;
}
.srs-stone-grid::-webkit-scrollbar-track {
    background: transparent;
}
.srs-stone-grid::-webkit-scrollbar-thumb {
    background: var(--srs-border-med);
    border-radius: 2px;
}

.srs-stone-card {
    display: flex;
    flex-direction: column;
    border: 1.5px solid transparent !important;
    border-radius: var(--srs-radius-sm);
    overflow: hidden;
    cursor: pointer;
    background: var(--srs-white) !important;
    transition: all var(--srs-transition);
    text-align: left;
    position: relative;
}
.srs-stone-card:hover {
    border-color: var(--srs-border-strong) !important;
}
.srs-stone-card.srs-stone-card--selected {
    border-color: var(--srs-black) !important;
    box-shadow: 0 0 0 1px var(--srs-black);
}
.srs-stone-card.srs-stone-card--selected::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: var(--srs-black);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: 9px;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 2;
}
.srs-stone-card.srs-stone-card--disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
.srs-stone-card.srs-stone-card--disabled:hover {
    border-color: transparent !important;
}
.srs-stone-thumb {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--srs-bg);
}
.srs-stone-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}
.srs-stone-card:hover .srs-stone-thumb img {
    transform: scale(1.04);
}
/* Name hidden */
.srs-stone-name {
    display: none;
}

/* ===== Panel footer ===== */
.srs-panel-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--srs-border);
    flex-shrink: 0;
}
.srs-reset-btn {
    width: 100%;
    padding: 9px;
    border: 1px solid var(--srs-border-med) !important;
    border-radius: var(--srs-radius-sm);
    background: var(--srs-white) !important;
    cursor: pointer;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--srs-text-muted);
    transition: all var(--srs-transition);
}
.srs-reset-btn:hover {
    background: var(--srs-black) !important;
    border-color: var(--srs-black) !important;
    color: var(--srs-white);
}

/* ===== Hide old panel-header (replaced by sections) ===== */
.srs-panel-header {
    display: none;
}
.srs-panel-title {
    display: none;
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
    .srs-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .srs-3d-canvas {
        min-height: 350px;
        aspect-ratio: 16 / 10;
    }
    .srs-panel {
        max-height: none;
        border-left: none;
        border-top: 1px solid var(--srs-border);
    }
    .srs-stone-grid {
        grid-template-columns: repeat(4, 1fr);
        max-height: 280px;
    }
}
@media (max-width: 600px) {
    .srs-room-tabs {
        flex-wrap: wrap;
    }
    .srs-stone-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .srs-zone-btn {
        padding: 4px 10px 4px 4px;
        font-size: 9px;
    }
    .srs-3d-canvas {
        min-height: 260px;
    }
}
