/* ============================================
   ABDULLAHOME TILE VISUALIZER - UI SHELL
   Sidebar: Icons + Labels (OPEN) / Hamburger only (CLOSED)
   ============================================ */

:root {
    --sidebar-width-open: 170px;
    --sidebar-width-closed: 56px;
    --content-panel-width: 400px;
    --top-bar-height: 70px;
    --gallery-height: 130px;
    --bg-primary: #f0eeeb;
    --bg-sidebar: #f5f3f0;
    --bg-card: #ffffff;
    --bg-hover: #e8e6e3;
    --text-primary: #1a1a1a;
    --text-secondary: #6b6b6b;
    --text-muted: #999999;
    --border-color: #e0ddd8;
    --border-light: #f0eeeb;
    --accent-dark: #1a1a1a;
    --accent-light: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --font-family:
        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html,
body {
    height: 100%;
    font-family: var(--font-family);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow: hidden;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

input {
    font-family: inherit;
    outline: none;
    border: none;
}

a {
    text-decoration: none;
    color: inherit;
}

/* App Container */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* ============================================
   SIDEBAR (OPEN: icons + labels, CLOSED: icons only)
   ============================================ */
.sidebar {
    width: var(--sidebar-width-open);
    min-width: var(--sidebar-width-open);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 200;
    flex-shrink: 0;
    transition:
        width 0.3s ease,
        min-width 0.3s ease;
    overflow: hidden;
    position: relative;
}

/* CLOSED state - icons only, no labels */
.sidebar.closed {
    width: var(--sidebar-width-closed);
    min-width: var(--sidebar-width-closed);
}

.sidebar.closed .sidebar-header {
    opacity: 0;
    pointer-events: none;
}

.sidebar.closed .nav-label {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
}

.sidebar.closed .nav-item {
    justify-content: center;
    padding: 10px 0px 10px 10px;
    width: 100%;
}

.sidebar.closed .nav-item.active::before {
    left: 0;
}

/* Hamburger is always visible */
.hamburger-wrap {
    padding: 0 18px 12px;
    transition: opacity 0.3s ease;
}

/* Center hamburger and nav icons when sidebar is closed */
.sidebar.closed .hamburger-wrap {
    display: flex;
    justify-content: center;
    padding: 0 0 12px;
}

.sidebar.closed .sidebar-nav {
    padding: 0;
}

/* Sidebar Header - Logo */
.sidebar-header {
    padding: 16px 18px;
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.3px;
}

.logo-dot {
    width: 8px;
    height: 8px;
    background: var(--text-primary);
    border-radius: 50%;
    display: inline-block;
}

.logo-text {
    font-weight: 700;
}

/* Hamburger Wrap */
.hamburger-wrap {
    padding: 0 18px 12px;
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.hamburger-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: background 0.2s;
}

.hamburger-btn:hover {
    background: var(--bg-hover);
}

/* Sidebar Navigation - Icons + Labels */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0 10px;
    gap: 2px;
    flex: 1;
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    transition: all 0.2s;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-hover);
    color: var(--text-primary);
    font-weight: 500;
}

.nav-item.active::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--accent-dark);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
}

.nav-label {
    white-space: nowrap;
}

/* ============================================
   CONTENT PANEL
   ============================================ */
.content-panel {
    width: var(--content-panel-width);
    min-width: var(--content-panel-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    flex-shrink: 0;
    /* margin-left REMOVED — flex layout handles positioning automatically */
}

/* Breadcrumb Bar */
.breadcrumb-bar {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}

.back-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: background 0.2s;
}

.back-btn:hover {
    background: var(--bg-hover);
}

.breadcrumb-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

/* Search Section */
/* Search Wrapper */
.search-wrapper {
    padding: 16px 20px;
    position: relative;
}

/* Search Bar */
.search-bar {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #d5d2cc;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.search-icon {
    padding-left: 12px;
    color: #9b9894;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.search-input {
    flex: 1;
    padding: 10px 8px;
    border: none;
    outline: none;
    font-size: 14px;
    color: #2c2a28;
    background: transparent;
}

.search-input::placeholder {
    color: #9b9894;
}

/* Filter Button */
.filter-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    color: #6b6966;
    padding: 8px;
    margin: 4px 4px 4px 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #f0eeeb;
}

.filter-btn.active {
    background: #2c2a28;
    color: #fff;
}

.filter-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 16px;
    height: 16px;
    background: #c75b3f;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

.filter-badge.show {
    display: flex;
}

/* Filter Popup */
.filter-popup {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0ddd6;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 500;
}

.filter-container {
    max-height: 200px;
    overflow-y: auto;
}

.filter-popup.show {
    display: block;
}

/* Popup Header */
.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #f0eeeb;
}

.popup-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: #2c2a28;
}

.clear-all {
    background: none;
    border: none;
    font-size: 12px;
    color: #9b9894;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s;
}

.clear-all:hover {
    color: #c75b3f;
}

/* Filter Section */
.filter-section {
    padding: 16px 20px;
    border-bottom: 1px solid #f0eeeb;
}

.filter-section:last-of-type {
    border-bottom: none;
}

.filter-section h3 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #9b9894;
    margin-bottom: 12px;
}

.list {
    margin: 10px 0;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 1px 1px 3px black;
    padding: 10px;
    border-radius: 10px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.filter-options .option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.filter-options input {
    display: none;
}

.checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #d5d2cc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.checkbox::after {
    content: "";
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
    opacity: 0;
    transition: opacity 0.2s;
}

.option input:checked + .checkbox {
    background: #2c2a28;
    border-color: #2c2a28;
}

.option input:checked + .checkbox::after {
    opacity: 1;
}

.option-text {
    font-size: 14px;
    color: #4a4846;
    transition: color 0.2s;
}

.option:hover .option-text {
    color: #2c2a28;
}

/* Popup Footer */
.popup-footer {
    padding: 12px 20px;
    border-top: 1px solid #f0eeeb;
    background: #faf9f7;
}

.apply-btn {
    width: 100%;
    padding: 10px;
    background: #2c2a28;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.apply-btn:hover {
    background: #3d3b39;
}

/* Active Tags */
.active-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 12px;
    min-height: 0;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #fff;
    animation: tagIn 0.2s ease;
}

.tag.color-tag {
    background: #2c2a28;
}

.tag.finish-tag {
    background: #6b6966;
}

.tag button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.tag button:hover {
    opacity: 1;
}

@keyframes tagIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.filter-toggle-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.filter-toggle-btn:hover {
    background: var(--bg-hover);
}

/* Filters Row - Reference image style */
.filters-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown {
    flex: 1;
}

.dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    padding: 7px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-secondary);
    transition: border-color 0.2s;
}

.dropdown-btn:hover {
    border-color: var(--text-muted);
}

.dropdown-btn svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.filter-settings-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: background 0.2s;
    flex-shrink: 0;
}

.filter-settings-btn:hover {
    background: var(--bg-hover);
}

/* Dropdown Menu - Opens on click */
.dropdown {
    position: relative;
    flex: 1;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 100;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu.small {
    right: 0;
    left: auto;
    min-width: 140px;
}

.dropdown-item {
    padding: 8px 12px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    border-bottom: 1px solid var(--border-light);
}

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

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown-item.active {
    background: var(--bg-hover);
    color: var(--text-primary);
    font-weight: 500;
}

/* Dropdown field in detail card */
.dropdown-field {
    position: relative;
}

.dropdown-field .dropdown-menu {
    top: calc(100% + 2px);
}

/* Tiles Grid */
.tiles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
}

.tile-card {
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.tile-card:hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.tile-card.selected {
    border-color: var(--accent-dark);
    box-shadow: var(--shadow-md);
}

.tile-card.selected::after {
    content: "✓";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    background: var(--accent-light);
    color: var(--accent-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.tile-image {
    width: 100%;
    height: 80px;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tile-info {
    padding: 8px 10px;
}

.tile-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.tile-finish {
    font-size: 10px;
    color: var(--text-muted);
}

/* Color swatches shown under each item card (matches reference UI) */
.tile-colors {
    display: flex;
    gap: 5px;
    margin-top: 6px;
}

.product-container.scrollable {
    max-height: 600px; /* apne hisaab se adjust karo */
    overflow-y: auto;
    padding-right: 8px;
}

.product-container.scrollable::-webkit-scrollbar {
    width: 6px;
}
.product-container.scrollable::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.tile-color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}
.tile-color-dot.selected {
    outline: 1px solid black;
    outline-offset: 2px;
}

.tile-color-dot.disabled {
    pointer-events: none;
    opacity: 0.3;
}
/* Selected Tile Section */
.selected-tile-section {
    padding: 14px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Tile Detail Card - Reference image style */
.tile-detail-card {
    display: flex;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 12px;
}

.tile-detail-image {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-sm);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.tile-detail-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.tile-detail-info h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.tile-detail-info > p {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.detail-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.field-row label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    flex-shrink: 0;
    min-width: 55px;
}

.dropdown-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    width: 140px;
    transition: border-color 0.2s;
}

.dropdown-field:hover {
    border-color: var(--text-muted);
}

.dropdown-field svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

/* Detail Tabs - Reference image style */
.detail-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    padding: 4px;
    background: #ebe8e3;
    border-radius: var(--radius-md);
}

.tab-btn {
    flex: 1;
    padding: 8px 0;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    text-align: center;
    background: transparent;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.03);
}

.tab-btn.active {
    color: var(--text-primary);
    font-weight: 600;
    background: #d5d0c8;
}

/* Pricing Table */
.pricing-table {
    margin-bottom: 14px;
}

.table-header {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 8px;
    padding: 6px 8px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.table-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 8px;
    padding: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.table-row:hover {
    background: var(--bg-hover);
}

.table-row.selected {
    background: var(--bg-hover);
    color: var(--text-primary);
    font-weight: 500;
}

.table-row.selected::after {
    content: "✓";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-dark);
}

.table-row .price {
    font-weight: 600;
    color: var(--text-primary);
}

.data {
    padding: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    position: relative;
}

/* Size chip grid (alternative to the pricing table — matches reference UI
   where sizes like "60x120" are shown as a grid of tappable chips) */
.size-chip-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 14px;
}

.size-chip {
    padding: 10px 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.size-chip:hover {
    border-color: var(--text-muted);
}

.size-chip.selected {
    background: #d9d4cb;
    border-color: var(--accent-dark);
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* ============================================
   VIEWPORT
   ============================================ */
.viewport {
    flex: 1;
    position: relative;
    background: linear-gradient(135deg, #e8e4df 0%, #d5d0ca 50%, #c8c3bc 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewport-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    opacity: 0.6;
}

.placeholder-text {
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.placeholder-sub {
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 2px;
}

/* ============================================
   RIGHT FLOATING PANELS
   ============================================ */

/* View Modes */
.view-modes {
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

.mode-buttons {
    display: flex;
    gap: 6px;
}

.mode-btn {
    flex: 1;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-card);
    transition: all 0.2s;
}

.mode-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.mode-btn.active {
    background: var(--accent-dark);
    color: var(--accent-light);
    border-color: var(--accent-dark);
}
.link-btn {
    color: var(--text-secondary);
    text-decoration: underline;
}

/* Vertical Toolbar */

/* ============================================
   PANEL BASE
   ============================================ */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .camera-views-panel {
        right: 60px;
        width: 160px;
    }

    .vertical-toolbar {
        right: 10px;
    }

    .floor-plan-panel {
        width: 170px;
    }
}

@media (max-width: 900px) {
    .sidebar {
        position: absolute;
        left: 0;
        top: 0;
    }

    .sidebar.closed {
        transform: translateX(-100%);
    }

    .content-panel {
        position: absolute;
        left: var(--sidebar-width-open);
        top: 0;
        z-index: 150;
    }
}
