/**
 * Bedrock Quartz Countertops
 * Premium Styles
 * Version: 1.1.0
 * 
 * Author: Erick R.
 * Website: https://www.stagemarketing.com/
 */

/* ========================================
   CSS Variables & Font Import
   ======================================== */

@import url('https://fonts.cdnfonts.com/css/gotham');

:root {
    --bq-primary: #092A30;
    --bq-primary-light: #0d3840;
    --bq-primary-dark: #061c20;
    --bq-accent: #C4A77D;
    --bq-accent-light: #d4bc9a;
    --bq-white: #ffffff;
    --bq-light-bg: #F8F6F3;
	--bq-tt: transparent !important;
    --bq-border: #E5E2DD;
    --bq-text: #333333;
    --bq-text-light: #666666;
    --bq-text-muted: #999999;
    --bq-shadow: 0 4px 20px rgba(9, 42, 48, 0.08);
    --bq-shadow-lg: 0 8px 40px rgba(9, 42, 48, 0.12);
    --bq-radius: 0px;
    --bq-radius-lg: 8px;
    --bq-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --bq-font-gotham: 'Gotham', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Sidebar height calculations */
    /* Desktop: 8 items + half of 2 = 9 rows visible (2 columns = 4.5 rows) */
    /* Each item has aspect-ratio 0.85, so height = width / 0.85 */
    /* With 200px sidebar, each item is ~94px wide, height ~110px + 12px gap */
    --bq-item-height-desktop: 122px; /* item height + gap */
    --bq-sidebar-rows-desktop: 4.5; /* 8 items in 2 cols = 4 rows + 0.5 for peek */
    --bq-sidebar-height-desktop: calc(var(--bq-item-height-desktop) * var(--bq-sidebar-rows-desktop));
    
    /* Mobile: 4 items + half of 2 = 5 items visible (2 columns = 2.5 rows) */
    --bq-item-height-mobile: 140px;
    --bq-sidebar-rows-mobile: 2.5;
    --bq-sidebar-height-mobile: calc(var(--bq-item-height-mobile) * var(--bq-sidebar-rows-mobile));
}

/* ========================================
   Main Container
   ======================================== */

.bq-countertops-wrapper {
    font-family: var(--bq-font-gotham);
    background: var(--bq-tt);
    position: relative;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0;
}

.bq-countertops-wrapper *,
.bq-countertops-wrapper *::before,
.bq-countertops-wrapper *::after {
    box-sizing: border-box;
}

/* ========================================
   Filters Bar
   ======================================== */

.bq-filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    background: var(--bq-tt);
    border-bottom: 1px solid var(--bq-border);
    flex-wrap: wrap;
    gap: 16px;
}

.bq-filters-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bq-filter-label {
    font-family: var(--bq-font-gotham);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 1.2px;
    color: var(--bq-text-light);
    margin-right: 16px;
}

.bq-filter-dropdown {
    position: relative;
}

.bq-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--bq-font-gotham);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.8px;
    color: var(--bq-primary);
    transition: var(--bq-transition);
    position: relative;
}

.bq-filter-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 18px;
    right: 18px;
    height: 2px;
    background: var(--bq-primary);
    transform: scaleX(0);
    transition: var(--bq-transition);
}

.bq-filter-btn:hover::after,
.bq-filter-btn.active::after {
    transform: scaleX(1);
}

.bq-filter-btn .bq-chevron {
    transition: var(--bq-transition);
}

.bq-filter-btn.active .bq-chevron {
    transform: rotate(180deg);
}

.bq-filter-count {
    display: none;
    background: var(--bq-primary);
    color: var(--bq-white);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

.bq-filter-count.visible {
    display: inline-block;
}

.bq-filter-panel {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--bq-white);
    border: 1px solid var(--bq-border);
    border-radius: var(--bq-radius-lg);
    box-shadow: var(--bq-shadow-lg);
    padding: 16px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--bq-transition);
}

.bq-filter-dropdown.open .bq-filter-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.bq-filter-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: var(--bq-radius);
    transition: var(--bq-transition);
    font-size: 14px;
    color: var(--bq-text);
}

.bq-filter-option:hover {
    background: var(--bq-light-bg);
}

.bq-filter-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.bq-checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--bq-border);
    border-radius: 3px;
    position: relative;
    transition: var(--bq-transition);
    flex-shrink: 0;
}

.bq-checkmark.bq-radio {
    border-radius: 50%;
}

.bq-filter-option input:checked ~ .bq-checkmark {
    background: var(--bq-primary);
    border-color: var(--bq-primary);
}

.bq-filter-option input:checked ~ .bq-checkmark::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid var(--bq-white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.bq-filter-option input:checked ~ .bq-checkmark.bq-radio::after {
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border: none;
    background: var(--bq-white);
    border-radius: 50%;
    transform: none;
}

/* Search Box */
.bq-filters-right {
    flex-shrink: 0;
}

.bq-search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bq-white);
    border: 1px solid var(--bq-border);
    border-radius: var(--bq-radius);
    min-width: 280px;
    transition: var(--bq-transition);
}

.bq-search-box:focus-within {
    border-color: var(--bq-primary);
    box-shadow: 0 0 0 3px rgba(9, 42, 48, 0.1);
}

.bq-search-icon {
    color: var(--bq-text-muted);
    flex-shrink: 0;
}

.bq-search-input {
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--bq-font-gotham);
    font-size: 13px;
    letter-spacing: 1px;
    color: var(--bq-text);
    width: 100%;
}

.bq-search-input::placeholder {
    color: var(--bq-text-muted);
    letter-spacing: 1.5px;
}

/* Active Filters */
.bq-active-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 30px;
    background: var(--bq-white);
    border-bottom: 1px solid var(--bq-border);
    flex-wrap: wrap;
}

.bq-active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bq-active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bq-light-bg);
    border: 1px solid var(--bq-border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--bq-text);
}

.bq-remove-filter {
    cursor: pointer;
    opacity: 0.6;
    transition: var(--bq-transition);
}

.bq-remove-filter:hover {
    opacity: 1;
}

.bq-clear-all-filters {
    background: none;
    border: none;
    color: var(--bq-primary);
    font-family: var(--bq-font-gotham);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 8px;
    transition: var(--bq-transition);
}

.bq-clear-all-filters:hover {
    color: var(--bq-primary-dark);
}

/* ========================================
   Main Content Layout
   ======================================== */

.bq-main-content {
    display: flex;
    gap: 0;
}

/* Sidebar - Fixed height with scroll */
.bq-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: transparent;
    padding: 0;
    overflow-y: auto;
    /* Desktop: Show 8 items + half of next 2 (4.5 rows in 2 columns) */
    max-height: 550px; /* ~4.5 rows * 122px per row */
    scrollbar-width: thin;
    scrollbar-color: var(--bq-border) transparent;
}

.bq-sidebar::-webkit-scrollbar {
    width: 6px;
}

.bq-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.bq-sidebar::-webkit-scrollbar-thumb {
    background-color: var(--bq-border);
    border-radius: 3px;
}

.bq-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: var(--bq-text-muted);
}

.bq-items-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Item Card */
.bq-item-card {
    cursor: pointer;
    overflow: hidden;
    transition: var(--bq-transition);
    position: relative;
}

.bq-item-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--bq-shadow);
}

.bq-item-card.bq-item-active {
    box-shadow: var(--bq-shadow);
}

.bq-item-image {
    aspect-ratio: 0.75;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.bq-item-overlay {
    width: 100%;
    padding: 7px 7px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.7), rgba(255, 250, 243, 0.7));
    backdrop-filter: blur(2px);
}

.bq-item-title {
    font-family: var(--bq-font-gotham);
    font-weight: 500;
    font-size: 10.5px;
    line-height: 1.2;
    color: var(--bq-primary);
    margin: 0 0 4px 0;
    letter-spacing: 0.2px;
    padding-bottom: 0px !important; 
}

.bq-item-thickness {
    font-family: var(--bq-font-gotham);
    font-weight: 400;
    font-size: 10px;
    color: var(--bq-primary);
    opacity: 0.8;
    letter-spacing: 0.3px;
}

/* ========================================
   Detail Panel
   ======================================== */

.bq-detail-panel {
    flex: 1;
    background: var(--bq-tt);
    overflow: hidden;
}

.bq-detail-content {
    display: flex;
    height: 100%;
    min-height: 550px;
}

/* Gallery Section */
.bq-gallery-section {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: transparent;
}

.bq-gallery-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bq-tt);
    border-radius: var(--bq-radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.bq-gallery-main-img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    transition: var(--bq-transition);
}

.bq-gallery-thumbs {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
}

.bq-gallery-thumb {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    border-radius: var(--bq-radius);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--bq-transition);
    opacity: 0.7;
}

.bq-gallery-thumb:hover,
.bq-gallery-thumb.bq-thumb-active {
    border-color: var(--bq-primary);
    opacity: 1;
}

.bq-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Material Preview */
.bq-material-preview {
    width: 160px;
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
    background: var(--bq-light-bg);
}

.bq-material-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Info Panel */
.bq-info-panel {
    width: 300px;
    flex-shrink: 0;
    background: var(--bq-primary);
    padding: 35px 30px;
    display: flex;
    flex-direction: column;
    color: var(--bq-white);
}

.bq-info-title {
    font-family: var(--bq-font-gotham);
    font-weight: 500;
    font-size: 27px;
    line-height: 30.5px;
    letter-spacing: 0.76px;
    color: var(--bq-white);
    margin: 0 0 12px 0;
    text-transform: uppercase;
}

.bq-info-thickness {
    font-family: var(--bq-font-gotham);
    font-weight: 500;
    font-size: 14px;
    line-height: 27px;
    letter-spacing: 0.85px;
    color: var(--bq-white);
    text-transform: uppercase;
    display: block;
    margin-bottom: 24px;
}

.bq-info-description {
    font-family: var(--bq-font-gotham);
    font-weight: 400;
    font-size: 14px;
    line-height: 1.7;
    color: var(--bq-white);
    opacity: 0.9;
    margin: 0 0 auto 0;
}

/* See it in my room button (formerly Request Sample) */
.bq-see-room-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    background: transparent;
    border: 2px solid var(--bq-white);
    color: var(--bq-white);
    font-family: var(--bq-font-gotham);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 1px;
    text-decoration: none;
    text-transform: uppercase;
    transition: var(--bq-transition);
    margin-top: 30px;
    cursor: pointer;
    white-space: nowrap;
}

.bq-see-room-btn:hover {
    background: var(--bq-white);
    color: var(--bq-primary);
}

/* Legacy class support */
.bq-request-sample-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    background: transparent;
    border: 2px solid var(--bq-white);
    color: var(--bq-white);
    font-family: var(--bq-font-gotham);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 1px;
    text-decoration: none;
    text-transform: uppercase;
    transition: var(--bq-transition);
    margin-top: 30px;
    cursor: pointer;
    white-space: nowrap;
}

.bq-request-sample-btn:hover {
    background: var(--bq-white);
    color: var(--bq-primary);
}

/* ========================================
   No Results
   ======================================== */

.bq-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--bq-text-muted);
}

.bq-no-results svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.bq-no-results p {
    font-family: var(--bq-font-gotham);
    font-size: 14px;
    margin: 0;
}

/* ========================================
   Loading Overlay
   ======================================== */

.bq-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: var(--bq-transition);
}

.bq-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bq-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--bq-border);
    border-top-color: var(--bq-primary);
    border-radius: 50%;
    animation: bq-spin 0.8s linear infinite;
}

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

/* ========================================
   Animations
   ======================================== */

@keyframes bq-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bq-item-card {
    animation: bq-fadeIn 0.4s ease-out backwards;
}

.bq-items-grid .bq-item-card:nth-child(1) { animation-delay: 0.05s; }
.bq-items-grid .bq-item-card:nth-child(2) { animation-delay: 0.1s; }
.bq-items-grid .bq-item-card:nth-child(3) { animation-delay: 0.15s; }
.bq-items-grid .bq-item-card:nth-child(4) { animation-delay: 0.2s; }
.bq-items-grid .bq-item-card:nth-child(5) { animation-delay: 0.25s; }
.bq-items-grid .bq-item-card:nth-child(6) { animation-delay: 0.3s; }
.bq-items-grid .bq-item-card:nth-child(7) { animation-delay: 0.35s; }
.bq-items-grid .bq-item-card:nth-child(8) { animation-delay: 0.4s; }

.bq-detail-content {
    animation: bq-fadeIn 0.5s ease-out;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Large screens */
@media (max-width: 1400px) {
    .bq-info-panel {
        width: 260px;
        padding: 28px 22px;
    }
    
    .bq-info-title {
        font-size: 22px;
        line-height: 26px;
    }
    
    .bq-material-preview {
        width: 140px;
    }
    
    .bq-sidebar {
        width: 180px;
        max-height: 500px;
    }
}

/* Medium screens */
@media (max-width: 1200px) {
    .bq-main-content {
        flex-direction: column;
    }
    
    .bq-sidebar {
        width: 100%;
        padding: 16px;
        background: transparent;
        /* Mobile: Show 4 items + half of next 2 (2.5 rows in 2 columns) */
        max-height: 350px;
    }
    
    .bq-items-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
    
    .bq-detail-content {
        flex-wrap: wrap;
        min-height: auto;
    }
    
    .bq-gallery-section {
        flex: 1 1 100%;
        order: 1;
    }
    
    .bq-material-preview {
        display: none;
    }
    
    .bq-info-panel {
        width: 100%;
        order: 2;
        padding: 30px;
    }
}

/* Tablets */
@media (max-width: 992px) {
    .bq-filters-bar {
        padding: 16px 20px;
    }
    
    .bq-filter-label {
        display: none;
    }
    
    .bq-items-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .bq-sidebar {
        max-height: 320px;
    }
    
    .bq-search-box {
        min-width: 200px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .bq-filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bq-filters-left {
        justify-content: flex-start;
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 12px;
        padding-left: 16px;
        margin-left: -16px;
        padding-right: 16px;
        margin-right: -16px;
        -webkit-overflow-scrolling: touch;
        /* Visible scrollbar */
        scrollbar-width: thin;
        scrollbar-color: var(--bq-border) transparent;
    }
    
    .bq-filters-left::-webkit-scrollbar {
        height: 6px;
    }
    
    .bq-filters-left::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .bq-filters-left::-webkit-scrollbar-thumb {
        background-color: var(--bq-border);
        border-radius: 3px;
    }
    
    .bq-filters-left::-webkit-scrollbar-thumb:hover {
        background-color: var(--bq-text-muted);
    }
    
    .bq-filter-dropdown {
        flex-shrink: 0;
    }
    
    .bq-filters-right {
        width: 100%;
    }
    
    .bq-search-box {
        width: 100%;
        min-width: unset;
    }
    
    .bq-sidebar {
        padding: 12px;
        /* Mobile: 4 items + half of 2 in 2 columns = 2.5 rows */
        max-height: 350px;
    }
    
    .bq-items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .bq-detail-content {
        flex-direction: column;
        min-height: auto;
    }
    
    .bq-gallery-section {
        padding: 16px;
    }
    
    .bq-gallery-main-img {
        max-height: 280px;
    }
    
    .bq-gallery-thumb {
        width: 60px;
        height: 45px;
    }
    
    .bq-info-panel {
        padding: 24px 20px;
    }
    
    .bq-info-title {
        font-size: 22px;
        line-height: 26px;
    }
    
    .bq-see-room-btn,
    .bq-request-sample-btn {
        padding: 12px 18px;
        font-size: 10px;
        letter-spacing: 0.8px;
    }
    
    .bq-filter-btn {
        padding: 10px 14px;
        font-size: 11px;
    }
    
    .bq-filter-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: var(--bq-radius-lg) var(--bq-radius-lg) 0 0;
        max-height: 60vh;
        overflow-y: auto;
        transform: translateY(100%);
    }
    
    .bq-filter-dropdown.open .bq-filter-panel {
        transform: translateY(0);
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .bq-filters-left {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 12px;
        padding-left: 20px;
        margin-left: -20px;
        padding-right: 20px;
        margin-right: -20px;
        -webkit-overflow-scrolling: touch;
        /* Visible scrollbar */
        scrollbar-width: thin;
        scrollbar-color: var(--bq-border) transparent;
    }
    
    .bq-filters-left::-webkit-scrollbar {
        height: 6px;
    }
    
    .bq-filters-left::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .bq-filters-left::-webkit-scrollbar-thumb {
        background-color: var(--bq-border);
        border-radius: 3px;
    }
    
    .bq-filters-left::-webkit-scrollbar-thumb:hover {
        background-color: var(--bq-text-muted);
    }
    
    .bq-filter-dropdown {
        flex-shrink: 0;
    }
    
    .bq-sidebar {
        padding: 12px;
        max-height: 300px;
    }
    
    .bq-items-grid {
        gap: 8px;
    }
    
    .bq-item-title {
        font-size: 10px;
        color: var(--bq-primary);
    }
    
    .bq-item-thickness {
        font-size: 9px;
        color: var(--bq-primary);
    }
    
    .bq-item-overlay {
        padding: 8px;
    }
    
    .bq-info-title {
        font-size: 20px;
        line-height: 24px;
    }
    
    .bq-info-description {
        font-size: 13px;
    }
}

/* Extra small mobile */
@media (max-width: 380px) {
    .bq-filters-left {
        padding-left: 24px;
        margin-left: -24px;
        padding-right: 24px;
        margin-right: -24px;
    }
    
    .bq-filter-btn {
        padding: 8px 10px;
        font-size: 10px;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .bq-filters-bar,
    .bq-active-filters,
    .bq-loading-overlay {
        display: none !important;
    }
    
    .bq-countertops-wrapper {
        background: transparent;
    }
    
    .bq-main-content {
        display: block;
    }
    
    .bq-sidebar {
        width: 100%;
        max-height: none;
    }
    
    .bq-items-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   Accessibility
   ======================================== */

.bq-filter-btn:focus,
.bq-search-input:focus,
.bq-item-card:focus,
.bq-gallery-thumb:focus,
.bq-see-room-btn:focus,
.bq-request-sample-btn:focus {
    outline: 2px solid var(--bq-primary);
    outline-offset: 2px;
}

.bq-filter-option:focus-within {
    background: var(--bq-light-bg);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --bq-border: #333333;
    }
    
    .bq-item-overlay {
        background: rgba(0, 0, 0, 0.9);
    }
    
    .bq-filter-btn::after {
        height: 3px;
    }
}
