:root {
    /* --- Color Palette --- */
    --primary: #6487AF;
    --primary-dark: #3A5778;
    --primary-light: #E6EFF9;
    --accent: #AABEDC;
    --text-main: #333333;
    --text-sub: #666666;
    --bg-body: #FFFFFF;
    --bg-neutral: #F5F5F5;
    --border-color: #E6E6E6;
    /* --- Styles --- */
    --shadow-hover: 0 12px 24px rgba(58, 87, 120, 0.15);
    --radius-pill: 999px;
    --radius-card: 12px;
    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'IBM Plex Sans', sans-serif;
}

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

.content-div {
    font-family: var(--font-sans);
    color: var(--text-main);
    background-color: var(--bg-neutral);
    line-height: 1.5;
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    font-weight: 600;
}

/* --- Utilities --- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: var(--font-sans);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--bg-body);
}

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

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: transparent;
    /* Minimal: no bg by default */
    color: var(--text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

    .btn-icon:hover {
        background-color: var(--primary-light);
        color: var(--primary);
    }

/* --- Header --- */
header {
    background-color: var(--bg-body);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 700;
}

/* --- Top Banner --- */
.top-banner {
    background-color: var(--primary-light);
    color: var(--text-main);
    font-family: var(--font-serif) !important;
    font-size: 3.5rem;
    text-align: center;
    padding: 1rem 0;
    width: 100%;
    max-width: 100vw;
    font-weight: 500;
    overflow-x: hidden;
}

.banner-subtext {
    font-size: 1rem;
    color: #333333;
    font-family: var(--font-sans);
    margin-top: 10px;
    margin-bottom: 0;
    font-weight: 400;
}

/* --- Beta Notice Banner --- */
.beta-notice {
    background-color: #f2d1cf;
    color: #8c2f2c;
    padding: 12px 24px;
    margin: 1.5rem auto;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 500;
    max-width: 1360px;
}

.helper-notice {
    font-size: 0.95rem;
    color: #3A5778;
    font-weight: 500;
    font-family: var(--font-sans);
    text-align: center;
    margin: 1rem auto;
    padding: 0 15px;
}

.beta-notice i {
    font-size: 1.5rem;
    color: #b02a27;
}

/* --- Filter Section & Sidebar --- */
.filter-section {
    padding: 1.5rem 2rem;
    position: relative;
}

.pricing-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pricing-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: #4A5568;
    margin: 0;
}

.pricing-options {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 100px;
    padding: 2px 4px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    min-width: 140px;
    position: relative;
    overflow: visible !important;
}

#pricing-toggle {
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    padding: 6px 16px;
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 100px;
}

    #pricing-toggle::after {
        margin-left: 12px;
        border-top: 0.35em solid;
        border-right: 0.35em solid transparent;
        border-left: 0.35em solid transparent;
        color: var(--accent);
    }

.pricing-options:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#pricing-dropdown .dropdown-menu {
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 8px;
    min-width: 160px;
    z-index: 2000 !important;
    display: none;
    /* Hidden by default */
}

    #pricing-dropdown .dropdown-menu.show {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

#pricing-dropdown .dropdown-item {
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    color: var(--text-sub);
    transition: all 0.2s;
}

    #pricing-dropdown .dropdown-item:hover {
        background-color: var(--primary-light);
        color: var(--primary);
    }

    #pricing-dropdown .dropdown-item.active {
        background-color: var(--primary);
        color: white;
    }

/* Category Visual Option Improvements */
.visual-option .option-image {
    width: 48px;
    height: 48px;
    border: 2px solid #E2E8F0;
    border-radius: 50%;
    /* Circle for categories */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    color: #94A3B8;
    font-size: 1.5rem;
}

.visual-option input:checked + .option-image {
    background: #3A5778;
    /* Solid Fill for clarity */
    border-color: #3A5778;
    color: white;
    box-shadow: 0 4px 12px rgba(58, 87, 120, 0.3);
}

.visual-option:hover .option-image {
    border-color: #3A5778;
    transform: translateY(-2px);
}

.visual-option .option-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Visual Stone selection grid */
.visual-stone-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 10px 0;
}

.stone-option {
    cursor: pointer;
    text-align: center;
}

    .stone-option input {
        display: none;
    }

.stone-image {
    width: 60px;
    height: 60px;
    background: #F8FAFC;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #94A3B8;
    margin-bottom: 6px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stone-label {
    font-size: 0.7rem;
    color: #64748B;
    font-weight: 500;
    display: block;
    line-height: 1.2;
}

.stone-option input:checked + .stone-image {
    background: #3A5778;
    border-color: #3A5778;
    color: white;
    box-shadow: 0 4px 10px rgba(58, 87, 120, 0.2);
    transform: scale(1.05);
}

.stone-option:hover .stone-image {
    border-color: #CBD5E1;
    background: white;
}

.pricing-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--text-main);
}

.pricing-label {
    font-weight: 400;
    color: var(--text-sub);
}

.pricing-options {
    display: flex;
    background-color: #F8F9FA;
    border: 1px solid #E9ECEF;
    border-radius: 999px;
    padding: 4px;
}

    /* Hide actual radio buttons */
    .pricing-options input[type="radio"] {
        display: none;
    }

.pricing-option {
    padding: 6px 16px;
    /* Larger click area */
    cursor: pointer;
    border-radius: 999px;
    color: #4A6F9B;
    /* Muted blue for inactive */
    font-weight: 500;
    transition: all 0.2s ease;
    user-select: none;
    font-size: 0.95rem;
}

    .pricing-option:hover {
        color: var(--primary-dark);
    }

    .pricing-option:has(input:checked) {
        background-color: var(--bg-body);
        color: #111827;
        /* Darker black for better contrast */
        font-weight: 700;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
        /* Softer, slightly larger shadow */
    }

.sidebar-checkbox {
    display: none;
}

.btn-filter {
    background-color: #3A5778;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

    .btn-filter:hover {
        background-color: #6487AF;
    }

/* --- Search Bar Logic --- */
.search-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}

.btn-toolbar-icon {
    font-size: 1.5rem;
    color: var(--primary-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    padding: 0;
}

    .btn-toolbar-icon:hover {
        background-color: var(--primary-light);
        color: var(--primary);
    }

/* --- Filter Button (Adaptive) --- */
.btn-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 40px;
    background-color: #3A5778;
    /* Muted dark blue */
    color: white;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

    .btn-filter:hover {
        background-color: #4a6a8a;
        color: white;
    }

    .btn-filter i {
        font-size: 1.2rem;
    }

/* --- Advanced Search Bar (Directly below flag info) --- */
/* --- Advanced Search Bar (Optimized for all screens) --- */
/* --- Advanced Search Bar (Redesigned) --- */
/* --- Advanced Search Bar (Redesigned - Compact) --- */
.advanced-search-container {
    max-width: 700px;
    margin: 24px auto 30px auto;
    padding: 0 15px;
    font-family: var(--font-sans);
    position: relative;
    /* Anchor for absolute elements if needed */
}

/* Image Preview Floating Bubble */
.image-preview-floating {
    display: none;
    /* Hidden by default */
    position: absolute;
    top: -75px;
    left: 20px;
    width: 64px;
    height: 64px;
    background: #fff;
    padding: 3px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid #e2e8f0;
    z-index: 20;
    animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: zoom-in;
    /* Indicate clickable */
}

    .image-preview-floating.show {
        display: block;
    }

    .image-preview-floating img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 8px;
        transition: transform 0.2s;
    }

    .image-preview-floating:hover img {
        transform: scale(1.05);
    }

.preview-close-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 10px;
    transition: transform 0.2s;
    z-index: 2;
    /* Ensure above image */
}

/* Fullscreen Image Modal */
.image-upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: none;
    /* Flex when active */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .image-upload-modal.active {
        display: flex;
        opacity: 1;
    }

    .image-upload-modal img {
        max-width: 90%;
        max-height: 90vh;
        border-radius: 8px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
        transform: scale(0.95);
        transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .image-upload-modal.active img {
        transform: scale(1);
    }

.modal-close-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: background 0.2s;
}

    .modal-close-overlay:hover {
        background: rgba(255, 255, 255, 0.25);
    }

.preview-close-btn:hover {
    transform: scale(1.1);
    background: #dc2626;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.search-bar-modern {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* The Pill Container */
.search-input-wrapper {
    position: relative;
    width: 100%;
    height: 50px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    display: flex;
    align-items: center;
    padding: 5px;
    box-shadow: 0 8px 30px -8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

    .search-input-wrapper:focus-within {
        border-color: #cbd5e1;
        box-shadow: 0 15px 50px -10px rgba(58, 87, 120, 0.15);
        transform: translateY(-2px);
    }

/* Icons & Input */
.search-icon-start {
    margin-left: 16px;
    font-size: 1.25rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.search-input-field {
    flex: 1;
    border: none;
    outline: none;
    height: 100%;
    background: transparent;
    padding: 0 12px;
    font-size: 0.95rem;
    color: #1e293b;
    min-width: 0;
    /* Prevent flex overflow */
}

    .search-input-field::placeholder {
        color: #94a3b8;
        font-weight: 400;
    }

/* Right Side Actions */
.search-actions-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 6px;
}

.action-icon-btn {
    background: transparent;
    border: none;
    color: #64748b;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .action-icon-btn i {
        font-size: 1.25rem;
    }

    .action-icon-btn:hover {
        background-color: #f1f5f9;
        color: #3A5778;
    }

.vertical-divider {
    width: 1px;
    height: 24px;
    background-color: #e2e8f0;
}

.btn-search-pill {
    background-color: #3A5778;
    color: white;
    border: none;
    height: 40px;
    padding: 0 24px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(58, 87, 120, 0.25);
}

    .btn-search-pill:hover {
        background-color: #2c425c;
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(58, 87, 120, 0.35);
    }

/* Footer Options (Checkbox & Clear) */
.search-footer-options {
    display: flex;
    align-items: center;
    gap: 32px;
    font-size: 0.95rem;
}

/* Modern Checkbox */
.custom-toggle-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: #4b5563;
    font-weight: 500;
}

    .custom-toggle-checkbox input {
        display: none;
    }

.toggle-box {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: all 0.2s;
    color: white;
}

    .toggle-box i {
        font-size: 12px;
        opacity: 0;
        transform: scale(0.5);
        transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

/* Checked State */
.custom-toggle-checkbox input:checked + .toggle-box {
    background-color: #3A5778;
    border-color: #3A5778;
}

    .custom-toggle-checkbox input:checked + .toggle-box i {
        opacity: 1;
        transform: scale(1);
    }

.btn-clear-link {
    background: none;
    border: none;
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px 8px;
    text-decoration: underline;
    text-underline-offset: 4px;
}

    .btn-clear-link:hover {
        color: #ef4444;
        /* Red for clear action */
    }

/* Mobile Adjustments */
@media (max-width: 768px) {
    .search-input-wrapper {
        height: 56px;
        padding: 4px;
    }

    .btn-search-pill {
        height: 48px;
        padding: 0 24px;
        font-size: 1rem;
    }

    .search-icon-start {
        margin-left: 16px;
        font-size: 1.3rem;
    }

    .search-input-field {
        font-size: 1rem;
        padding: 0 10px;
    }

    .action-icon-btn,
    .vertical-divider {
        display: none;
        /* Hide advanced controls on very small screens to save space if needed, or keep them? */
    }

    /* Let's keep icon but hide divider if tight */
    .vertical-divider {
        display: none;
    }

    .action-icon-btn {
        display: flex;
    }
}


/* Sidebar */
.filter-sidebar {
    background: var(--bg-body);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

/* Width overrides based on screen size are handled in media queries */

/* Sidebar Header consolidated below */

.sidebar-header h3 {
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0;
}

.sidebar-content {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

/* --- Product Grid --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 2rem 0;
}

/* --- Product Card --- */
.product-card {
    background: var(--bg-body);
    border-radius: 8px;
    overflow: visible;
    /* Changed to visible to allow dropdowns to show */
    position: relative;
    border: 1px solid #f0f0f0;
    box-shadow: none;
    transition: all 0.3s ease;
    padding: 0;
    margin: 0;
    z-index: 1;
    /* Low z-index for cards */
}

    /* Elevate card when dropdown is open */
    .product-card:has(.action-dropdown-menu.show) {
        z-index: 100;
    }

    .product-card:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
        transform: translateY(-2px);
    }

/* Card Badge/Tag */
.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    background: #3A5778;
    color: var(--bg-body);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 3px;
}

/* Heart button top right */
.card-favorite {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    transition: all 0.2s ease;
}

    .card-favorite:hover {
        color: #ef4444;
    }

    .card-favorite.active {
        color: var(--text-sub);
    }

/* Image Switcher - Radio Hack */
.card-media {
    position: relative;
    aspect-ratio: 1;
    /* Square images */
    /*background-color: #f9f9f9;*/
    overflow: hidden;
    /* Move overflow: hidden here to clip images */
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.img-real {
    opacity: 1;
    /* Visible by default */
    z-index: 1;
}

.img-cad {
    opacity: 0;
    z-index: 2;
}

/* Hover Image Swap */
.product-card:hover .img-real {
    opacity: 0;
}

.product-card:hover .img-cad {
    opacity: 1;
}

/* The magic: depending on which radio is checked, show the image */
/* 
#img-real-1:checked~.card-media .img-real,
#img-cad-1:checked~.card-media .img-cad,
#img-real-2:checked~.card-media .img-real,
#img-cad-2:checked~.card-media .img-cad,
#img-real-3:checked~.card-media .img-real,
#img-cad-3:checked~.card-media .img-cad,
#img-real-4:checked~.card-media .img-real,
#img-cad-4:checked~.card-media .img-cad {
    opacity: 1;
}
*/

/* Default state if needed, but we structure logic to rely on checked default */

.media-toggles {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px;
    border-radius: var(--radius-pill);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.toggle-label {
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    cursor: pointer;
    color: var(--text-sub);
    transition: all 0.2s;
}

/* Toggle Active State Styling */
/* We need to target sibling labels based on the input checked state. 
   Since inputs are likely outside, we might need a specific structure or use :has if supported.
   Ideally, we place inputs before the card or at the top of card logic. 
   BUT standard reliable CSS: Place inputs immediately before the container or labels.
*/

/* Implementation specific: Inputs are invisible inside the card, 
   we use general sibling selector ~ to style the labels inside .media-toggles
*/

/* Card Info */
.card-details {
    padding: 0.5rem 0 0 0;
    /* padding handled by card container now mostly */
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.product-name {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
    /* Ensures consistency for 1 or 2 lines */
    line-height: 1.2;
}

.card-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.card-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #E2E8F0;
    border-radius: 10px;
    background: white;
    color: var(--primary-dark);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

    .card-action-btn:hover {
        background-color: var(--primary-light);
        border-color: var(--primary);
        color: var(--primary);
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(58, 87, 120, 0.1);
    }

    .card-action-btn i {
        font-size: 1.25rem;
    }

/* Dropdown Menu for Card Actions */
.card-action-dropdown {
    position: relative;
    /* Removed after bridge for mobile to simplify */
}

    /* Hover bridge to prevent closure when moving mouse to menu */
    .card-action-dropdown::after {
        content: '';
        position: absolute;
        bottom: 100%;
        /* Changed to top side */
        right: 0;
        width: 100%;
        height: 10px;
        z-index: 10;
    }

.action-dropdown-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 4px);
    /* Changed to open upwards */
    top: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.12);
    /* Shadow shifted up */
    min-width: 180px;
    z-index: 1050;
    display: none;
    padding: 6px;
    border: 1px solid #E2E8F0;
}

.card-action-dropdown:hover .action-dropdown-menu {
    display: block !important;
    opacity: 1;
    visibility: visible;
    animation: fadeInDropdown 0.2s ease-out;
    z-index: 10000;
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(5px);
        /* Slide up from button */
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.action-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Reduced gap */
    padding: 6px 12px;
    /* Reduced item padding */
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    /* Slightly smaller font */
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

    .action-dropdown-item:hover {
        background-color: var(--primary-light);
        color: var(--primary);
    }

    .action-dropdown-item i {
        font-size: 1.15rem;
        color: var(--text-sub);
    }

.tech-specs {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* ID tag positioned top right */
.tech-id {
    position: absolute;
    top: 18px;
    /* 10px padding + 8px original offset */
    right: 18px;
    z-index: 10;
    font-family: var(--font-sans);
    /* Cleaner sans-serif for minimal look */
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-sub);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    padding: 2px 8px;
    border-radius: 4px;
    box-shadow: none;
    /* Flat minimal look */
}

.retail-spec {
    display: none;
    /* Hidden as requested */
}

/* Admin Menu / Action Tools */
.card-actions {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.primary-actions {
    display: flex;
    gap: 0.5rem;
}

.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-trigger {
    color: var(--text-sub);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

    .dropdown-trigger:hover {
        background-color: var(--bg-neutral);
        color: var(--primary);
    }

#contentdiv .dropdown-menu {
    position: absolute;
    bottom: 100%;
    /* Opens upwards or downwards depending on space, let's go up for footer safety or down usually */
    right: 0;
    width: 160px;
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-hover);
    border-radius: 8px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 20;
}

/* Hover State for Dropdown */
.dropdown-container:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

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

/* Helper to highlight verify active toggle styling */
.card-input {
    display: none;
}

/* Better Toggle Styling Logic using General Sibling */
/* When REAL input is checked... */
.input-real:checked ~ .card-media .media-toggles label[for*="real"] {
    background-color: var(--primary);
    color: var(--bg-body);
}

.input-cad:checked ~ .card-media .media-toggles label[for*="cad"] {
    background-color: var(--primary);
    color: var(--bg-body);
}

/* --- Filter Group & Options --- */
.filter-group {
    border-bottom: 1px solid var(--border-color);
}

    .filter-group details {
        padding: 1rem 2.5rem 2rem 1rem;
    }

    .filter-group summary {
        list-style: none;
        /* Hide default triangle */
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-weight: 600;
        cursor: pointer;
        font-size: 1rem;
        cursor: pointer;
        font-size: 1rem;
        color: var(--text-main);
        padding-bottom: 0.5rem;
    }

        .filter-group summary::-webkit-details-marker {
            display: none;
        }

/* --- Visual Grid Filter (Categories) --- */
.visual-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 0.5rem 0 1.5rem 0;
    /* Changed padding */
}

.visual-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-align: center;
    gap: 0.5rem;
    transition: transform 0.2s;
}

    .visual-option:hover {
        transform: translateY(-2px);
    }

    .visual-option input {
        display: none;
    }

.option-image {
    width: 64px;
    /* Slightly larger */
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    padding: 3px;
    /* Space for border inside */
    border: 2px solid transparent;
    /* Default border transparent */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-body);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    /* Subtle shadow */
}

    .option-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
        opacity: 0.9;
        transition: opacity 0.2s;
        background-color: var(--bg-neutral);
        /* Fallback bg */
    }

.option-label {
    font-size: 0.8rem;
    color: var(--text-sub);
    font-weight: 500;
    line-height: 1.2;
    transition: color 0.2s;
}

.visual-option:hover .option-image {
    border-color: var(--border-color);
}

    .visual-option:hover .option-image img {
        opacity: 1;
    }

/* Checked State - Premium Teal */
.visual-option input:checked + .option-image {
    border-color: var(--primary-dark);
    /* The requested Teal */
    box-shadow: 0 4px 12px var(--shadow-card);
    transform: scale(1.05);
}

    .visual-option input:checked + .option-image img {
        opacity: 1;
    }

.visual-option input:checked ~ .option-label {
    color: var(--primary-dark);
    font-weight: 700;
}

/* --- Dynamic Conditional Filters --- */
.dynamic-filters {
    display: none;
    padding: 0;
    /* Remove padding managed by sidebar */
    flex-direction: column;
    gap: 12px;
    /* Consistent gap between cards */
}

/* Show Band filters when Band checkbox is checked */
/* Using :has() selector for CSS-only parent-based logic */
.filter-sidebar:has(input[value="band"]:checked) .group-band {
    display: flex;
}


/* Show Bangle/Bracelet filters when Bangle/Bracelet checkbox is checked */
.filter-sidebar:has(input[value="bangle-bracelet"]:checked) .group-bangle-bracelet {
    display: flex;
}

/* Show Earring filters when Earring checkbox is checked */
.filter-sidebar:has(input[value="earring"]:checked) .group-earring {
    display: flex;
}

/* Show Necklace filters when Necklace checkbox is checked */
.filter-sidebar:has(input[value="necklace"]:checked) .group-necklace {
    display: flex;
}

/* Show Other filters when Other checkbox is checked */
.filter-sidebar:has(input[value="other"]:checked) .group-other {
    display: flex;
}

/* Show Pendant filters when Pendant checkbox is checked */
.filter-sidebar:has(input[value="pendant"]:checked) .group-pendant {
    display: flex;
}

/* Show Ring filters when Ring checkbox is checked */
.filter-sidebar:has(input[value="ring"]:checked) .group-ring {
    display: flex;
}

/* Styled Filter Groups (Grey Boxes) */
/* Styled Filter Groups (The Boxed Look) */
.filter-group-styled {
    margin-bottom: 0;
    /* Controlled by flex gap */
}

    .filter-group-styled details {
        background-color: transparent;
        border: none;
        border-radius: 0;
        overflow: visible;
        /* overflow hidden cuts off shadows if used, but visually ok */
        transition: all 0.2s ease;
    }

        .filter-group-styled details[open] {
            box-shadow: none;
            /* No lift */
            border-color: transparent;
        }

    .filter-group-styled summary {
        padding: 16px 0;
        /* Vertical padding, no horizontal depending on alignment */
        cursor: pointer;
        list-style: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-weight: 500;
        font-size: 0.95rem;
        color: var(--primary-dark);
        background: transparent;
        transition: color 0.2s;
        user-select: none;
    }

        .filter-group-styled summary:hover {
            background-color: transparent;
            color: var(--text-main);
        }

        .filter-group-styled summary::-webkit-details-marker {
            display: none;
        }

        .filter-group-styled summary i {
            color: var(--accent);
            transition: transform 0.3s ease;
        }

    .filter-group-styled details[open] summary i {
        transform: rotate(180deg);
        color: var(--primary);
    }

    .filter-group-styled .filter-options {
        padding: 16px 0;
        /* Remove horizontal padding so grid fits cleanly */
        border-top: none;
        /* Removed double border */
        background: transparent;
        display: flex;
        flex-direction: column;
        gap: 12px;
        animation: slideDown 0.2s ease-out;
    }

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.placeholder-msg {
    color: var(--accent);
    font-size: 0.85rem;
    font-style: normal;
    background: var(--bg-neutral);
    padding: 8px 12px;
    border-radius: 4px;
    text-align: center;
}

/* --- New Product Card Design --- */

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-body);
    border-radius: 8px;
    /* Clean rounded corners */
    /* overflow: hidden; Removed to allow dropdown to pop out */
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    border: 1px solid transparent;
    /* Prepare for hover border */
    position: relative;
    /* Context */
}

    /* Hover Effect: Clean lift */
    .product-card:hover {
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
        /* Soft diffuse shadow */
        transform: translateY(-4px);
        z-index: 5;
        /* Bring to front */
    }

/* Card Media & Toggles */
.card-media {
    position: relative;
    aspect-ratio: 1;
    /*background: #f8f9fa;*/
    /* Light grey placeholder bg */
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    /* Manual radius since parent overflow is visible */
}

.product-id-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-sub);
    background: rgba(255, 255, 255, 0.95);
    padding: 3px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(2px);
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensure whole jewelry item is seen */
    padding: 10px;
    /* var(--bg-body)space inside image area */
}

.media-toggles {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 3px;
    border-radius: 999px;
    display: flex;
    gap: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.toggle-pill {
    padding: 4px 10px;
    /* Reduced size */
    font-size: 0.65rem;
    /* Reduced font size */
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-sub);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

    .toggle-pill:hover {
        color: #1e293b;
        background: var(--bg-neutral);
    }

/* Toggle Active States */
.input-real:checked ~ .card-media .media-toggles label[for*="real"],
.input-cad:checked ~ .card-media .media-toggles label[for*="cad"] {
    background: var(--primary-dark);
    color: var(--bg-body);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Card Content Area - Cleaned */
.card-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex-grow: 1;
}

/* Action Bar Inside Card */
.product-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    /* Push to bottom if height varies */
    padding-top: 12px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* Reusing refined action-btn styles */
.action-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    /* Cleaner default */
    color: var(--text-sub);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

    .action-btn:hover {
        background-color: var(--primary-dark);
        color: var(--bg-body);
        border-color: var(--primary-dark);
        transform: translateY(-2px);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

/* Primary CTA: Add to Bag */
.btn-bag {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--text-main);
    /* Strong black/dark for CTA */
    color: var(--bg-body);
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

    .btn-bag:hover {
        background-color: var(--primary-dark);
        transform: translateY(-2px);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    }

/* Dropdown (Refined for new context) */
.action-dropdown {
    position: relative;
}

.dropdown-menu-actions {
    position: absolute;
    bottom: 100%;
    /* left: 50%; Center caused overflow on left side */
    left: -10px;
    /* Slight nudge left for alignment */
    transform: translateY(10px) scale(0.9);
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    padding: 8px;
    display: none;
    grid-template-columns: repeat(4, 1fr);
    /* 4 cols for 7 items = 2 rows */
    gap: 6px;
    z-index: 100;
    width: max-content;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom left;
    /* Animate from bottom left */
}

.action-dropdown:hover .dropdown-menu-actions {
    display: grid;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-10px) scale(1);
}

.action-btn-sm {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-neutral);
    color: #475569;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

    .action-btn-sm:hover {
        background: var(--primary-dark);
        color: var(--bg-body);
    }

/* Specific button colors if needed, but keeping unified blue for now */


/* ============================================
   RESPONSIVE STYLES - Bootstrap 5 Breakpoints
   - Mobile: < 576px
   - SM (Small tablets): >= 576px
   - MD (Tablets/iPads): >= 768px
   - LG (Desktops): >= 992px
   - XL (Large Desktops): >= 1200px
   - XXL (Extra Large): >= 1400px
   - Custom (1600px+): >= 1600px
   ============================================ */

/* ============ MOBILE (max-width: 575.98px) ============ */
@media (max-width: 575.98px) {
    .top-banner {
        font-size: 1.5rem;
        padding: 0.75rem 0;
    }

    .filter-section {
        padding: 0.75rem 0.5rem;
    }

    .pricing-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        width: 100%;
    }

    .pricing-options {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .pricing-option {
        padding: 4px 10px;
        font-size: 0.85rem;
    }

    .btn-filter {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }

    .filter-sidebar {
        width: 100%;
    }

    .visual-filter-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .option-image {
        width: 50px;
        height: 50px;
    }

    .option-label {
        font-size: 0.7rem;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .product-card {
        padding: 8px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .card-actions {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .primary-actions {
        justify-content: center;
    }

    .dropdown-container {
        display: flex;
        justify-content: center;
    }

    .dropdown-trigger {
        width: 100%;
        justify-content: center;
    }

    .tech-id {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}

/* ============ SMALL TABLETS (min-width: 576px) ============ */
@media (min-width: 576px) {

    /* Grid defaults to 2 columns globally now */
    .top-banner {
        font-size: 1.75rem;
    }

    .filter-sidebar {
        width: 320px;
        left: -320px;
    }

    .visual-filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============ TABLETS/IPADS (min-width: 768px) ============ */
@media (min-width: 768px) {

    /* Explicitly force 2 columns for iPad / Tablets to prevent overflow */
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }

    .product-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        min-height: 52px !important;
        /* Forces consistent button vertical position */
        gap: 12px !important;
    }

    .product-name {
        font-size: 1.05rem !important;
        margin: 0 !important;
        line-height: 1.3 !important;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
    }

    .card-header-actions {
        margin-top: 0 !important;
        flex-shrink: 0 !important;
    }

    .top-banner {
        font-size: 2rem;
    }

    .filter-section {
        padding: 1rem 1.5rem;
    }

    .pricing-selector {
        flex-direction: row;
        align-items: center;
    }

    .btn-filter {
        width: auto;
    }

    .filter-sidebar {
        width: 360px;
    }

    .visual-filter-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .card-actions {
        flex-direction: row;
    }
}

/* ============ DESKTOPS (min-width: 992px) ============ */
@media (min-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .top-banner {
        font-size: 2.25rem;
    }

    .filter-sidebar {
        width: 380px;
    }

    .product-card:hover {
        transform: translateY(-6px);
    }
}

/* ============ LARGE DESKTOPS (min-width: 1200px) ============ */
@media (min-width: 1200px) {
    .top-banner {
        font-size: 2.5rem;
    }

    .filter-sidebar {
        width: 400px;
    }

    .container-xxl {
        max-width: 1320px;
    }

    .product-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* ============ EXTRA LARGE (min-width: 1400px) ============ */
@media (min-width: 1400px) {
    .container-xxl {
        max-width: 1400px;
    }

    .product-grid.row {
        --bs-gutter-x: 1.5rem;
        --bs-gutter-y: 1.5rem;
    }
}

/* ============ CUSTOM LARGE DESKTOP (min-width: 1600px) ============ */
@media (min-width: 1600px) {
    .container-xxl {
        max-width: 1540px;
    }

    .top-banner {
        font-size: 2.75rem;
        padding: 1.25rem 0;
    }

    .filter-section {
        padding: 1.25rem 2rem;
    }

    .pricing-option {
        padding: 8px 20px;
        font-size: 1rem;
    }

    .product-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .btn-filter {
        padding: 0.875rem 1.75rem;
        font-size: 1.05rem;
    }

    .filter-sidebar {
        width: 450px;
    }

    .sidebar-header h3 {
        font-size: 1.75rem;
    }

    .product-grid.row {
        --bs-gutter-x: 2rem;
        --bs-gutter-y: 2rem;
    }

    .product-card {
        padding: 12px;
    }

    .card-media {
        border-radius: 8px;
    }

    .toggle-label {
        padding: 5px 14px;
        font-size: 0.8rem;
    }

    .tech-id {
        font-size: 0.8rem;
        padding: 3px 10px;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
    }

    .dropdown-trigger {
        font-size: 0.95rem;
    }

    .dropdown-menu {
        width: 180px;
    }

    .dropdown-item {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }

    .visual-filter-grid {
        gap: 1.25rem;
    }

    .option-image {
        width: 70px;
        height: 70px;
    }

    .option-label {
        font-size: 0.85rem;
    }

    .filter-group-styled summary {
        padding: 16px 0;
        /* Vertical padding, no horizontal depending on alignment */
        cursor: pointer;
        list-style: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-weight: 500;
        font-size: 0.95rem;
        color: var(--primary-dark);
        background: transparent;
        /* No grey bg */
        border-bottom: 1px solid var(--border-color);
        /* The separator line */
        transition: color 0.2s;
        user-select: none;
    }
}

/* ============ ULTRA WIDE (min-width: 1920px) ============ */
@media (min-width: 1920px) {
    .container-xxl {
        max-width: 1800px;
    }

    .top-banner {
        font-size: 3rem;
    }

    .product-grid.row {
        --bs-gutter-x: 2.5rem;
        --bs-gutter-y: 2.5rem;
    }
}

/* --- Visual Grid Filter Refinements --- */

/* --- Visual Grid Filter Refinements (Cleaned & Fixed) --- */

/* Sidebar Header Refinements - Consolidated */
.sidebar-header {
    padding: 1.5rem !important;
    padding-bottom: 20px !important;
    position: relative;
    /* Just in case */
}

    /* Let the utility classes handle layout */
    .sidebar-header .offcanvas-title {
        font-size: 1.5rem;
        font-weight: 400;
    }

.results-count {
    color: #3A5778;
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 4px;
}

.close-btn,
.sidebar-header .btn-close {
    position: static !important;
    /* Reset absolute positioning */
    opacity: 0.5;
    transition: opacity 0.2s;
    margin: 0 !important;
    padding: 0.5rem !important;
    /* Ensure touch target size */
}

    .sidebar-header .btn-close:hover {
        opacity: 1;
    }

/* Sidebar Content - Add padding bottom for footer */
/* Also reduce padding to prevent overflow on small screens */
.sidebar-content {
    padding: 1rem;
    /* 16px */
    padding-bottom: 100px;
    /* Space for sticky footer */
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

/* --- The Visual Grid Transformation --- */
.filter-group-styled .filter-options {
    display: grid;
    /* Use minmax to prevent blowout */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    /* Reduced gap and padding to fit 3 columns in 320px sidebar */
    gap: 12px 6px;
    padding: 16px 8px;
}

/* Flex Item */
.filter-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 0;
    width: 100%;
    font-size: 0.75rem;
    /* Slightly smaller text for better fit */
    color: var(--text-sub);
    font-weight: 500;
    transition: all 0.2s;
    word-break: break-word;
    /* Wrap long words */
    line-height: 1.2;
}

    /* Visual Circle Input */
    .filter-option input[type="checkbox"] {
        appearance: none;
        -webkit-appearance: none;
        width: 100%;
        aspect-ratio: 1;
        max-width: 54px;
        /* Slightly Reduced size from 60px safe sizing */
        border-radius: 50%;
        background-color: var(--bg-neutral);
        border: 1px solid var(--border-color);
        cursor: pointer;
        position: relative;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .filter-option:hover input[type="checkbox"] {
        background-color: var(--bg-neutral);
        border-color: var(--accent);
        transform: translateY(-2px);
    }

    .filter-option:hover {
        color: var(--primary-dark);
    }

    .filter-option input[type="checkbox"]:checked {
        border: 2px solid var(--primary-dark);
        background-color: var(--bg-body);
        box-shadow: 0 4px 12px var(--shadow-card);
    }

    .filter-option:has(input:checked) {
        color: var(--primary-dark);
        font-weight: 700;
    }

    .filter-option input[type="checkbox"]:checked {
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 256 256"><path fill="%233A5778" d="M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.15a16,16,0,0,0-8.32,14v95.7a16,16,0,0,0,8.32,14l88,48.15a15.88,15.88,0,0,0,15.36,0l88-48.15a16,16,0,0,0,8.32-14V80.15A16,16,0,0,0,223.68,66.15Z"></path></svg>');
    }

/* Sticky Footer */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-body);
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    z-index: 100;
}

.btn-view-results {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-dark);
    color: var(--bg-body);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .btn-view-results:hover {
        background-color: var(--primary);
    }

/* --- List View Override for Specific Categories --- */
.filter-group-styled.list-view .filter-options {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    padding: 8px 0 !important;
    grid-template-columns: none !important;
}

.filter-group-styled.list-view .filter-option {
    flex-direction: row !important;
    width: 100% !important;
    align-items: center !important;
    text-align: left !important;
    justify-content: flex-start !important;
    padding: 10px 12px !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
}

    .filter-group-styled.list-view .filter-option:last-child {
        border-bottom: none;
    }

    .filter-group-styled.list-view .filter-option input[type='checkbox'] {
        appearance: none !important;
        -webkit-appearance: none !important;
        width: 18px !important;
        height: 18px !important;
        background-color: var(--bg-body) !important;
        /* Fixed variable usage */
        background-image: none !important;
        border: 1px solid var(--accent) !important;
        border-radius: 4px !important;
        margin-right: 12px !important;
        position: static !important;
        flex-shrink: 0 !important;
        max-width: none !important;
        aspect-ratio: auto !important;
        box-shadow: none !important;
    }

        .filter-group-styled.list-view .filter-option input[type='checkbox']:checked {
            background-color: var(--primary-dark) !important;
            border-color: var(--primary-dark) !important;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>') !important;
            background-size: 14px !important;
            background-repeat: no-repeat !important;
            background-position: center !important;
        }

/* --- Action Menu List View Redesign --- */
.dropdown-menu-actions {
    display: none;
    flex-direction: column;
    min-width: 170px;
    /* Reduced from 200px */
    padding: 6px 0;
    /* Reduced from 8px */
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
    border-radius: 10px !important;
    position: absolute;
    bottom: calc(100% + 8px);
    /* Gap from trigger */
    right: 0;
    z-index: 50;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

/* Show dropdown on hover of container */
.action-dropdown:hover .dropdown-menu-actions {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Reduced from 12px */
    width: 100%;
    padding: 6px 14px;
    /* Reduced from 10px 16px */
    border: none;
    background: transparent;
    color: var(--text-sub);
    font-size: 0.825rem;
    /* Reduced from 0.9rem */
    font-weight: 500;
    text-align: left;
    transition: all 0.2s ease;
    cursor: pointer;
}

    .action-item i {
        font-size: 1.1rem;
        /* Reduced from 1.25rem */
        color: var(--accent);
        flex-shrink: 0;
    }

    .action-item:hover {
        background-color: var(--bg-neutral);
        color: var(--primary-dark);
    }

        .action-item:hover i {
            color: var(--primary);
        }

.dropdown-divider {
    margin: 4px 0;
    /* Reduced from 8px */
    border-top: 1px solid var(--border-color);
    opacity: 1;
}

.btn-bag-list {
    color: var(--primary-dark);
    font-weight: 600;
}

    .btn-bag-list i {
        color: var(--primary-dark);
    }

    .btn-bag-list:hover {
        background-color: var(--primary-light) !important;
    }

/* Ensure the action buttons container doesn't layout weirdly */
.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-dropdown {
    position: relative;
}

/* --- Dashboard Action Bar --- */
.dashboard-toolbar {
    padding: 1.5rem 0;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.btn-dash {
    background-color: #3A5778;
    color: var(--bg-body);
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .btn-dash i {
        font-size: 1.25rem;
    }

    .btn-dash:hover {
        background-color: #2a3f57;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .btn-dash:active {
        transform: translateY(0);
    }

/* --- De-cluttering & Utility Bar --- */
.top-banner {
    padding: 0.75rem 0 !important;
    font-size: 3.5rem !important;
}

.top-banner-sub {
    display: block;
    font-size: 0.85rem;
    color: #333;
    font-family: var(--font-sans);
    margin-top: 4px;
    font-weight: 500;
}

.utility-bar {
    background: #fff5f5;
    /* Very light red hint */
    border-bottom: 1px solid var(--border-color);
    padding: 6px 0;
}

.utility-item {
    font-size: 0.75rem;
    font-weight: 500;
    color: #3A5778;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .utility-item i {
        font-size: 1rem;
    }

/* --- Slimmer Dashboard --- */
.dashboard-toolbar {
    padding: 0.75rem 0 !important;
    margin-bottom: 0.5rem !important;
}

.btn-dash {
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
    gap: 0.5rem !important;
}

    .btn-dash i {
        font-size: 1rem !important;
    }

/* --- Beta Notice --- */
.beta-notice {
    background: #fee2e2;
    /* Soft red/pink */
    color: #991b1b;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 1rem 1rem 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.4;
    border: 1px solid #fecaca;
    max-width: 100%;
}

    .beta-notice i {
        font-size: 1.25rem;
        color: #ef4444;
    }

@media (max-width: 767px) {
    .beta-notice {
        gap: 6px;
        margin: 1rem 0.5rem 0.5rem 0.5rem;
        font-size: 12px;
    }
}

/* --- Fluid Product Grid --- */
.product-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 1.5rem !important;
    padding: 1rem 0 !important;
}

@media (min-width: 768px) and (max-width: 1100px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.75rem !important;
        padding: 1rem 0.5rem !important;
    }

    .card-content {
        padding: 10px !important;
    }

    .product-name {
        font-size: 0.9rem !important;
        min-height: 2.8em !important;
    }

    .card-action-btn {
        width: 32px !important;
        height: 32px !important;
    }

        .card-action-btn i {
            font-size: 1.1rem !important;
        }

    .product-id-badge {
        font-size: 0.6rem !important;
        padding: 2px 6px !important;
    }
}

@media (max-width: 767px) {
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.5rem !important;
        padding: 1rem 0.5rem 0.5rem 0.5rem !important;
        width: 100% !important;
    }

    .product-card {
        border-radius: 6px;
    }

    /* Top Banner Refinements */
    .top-banner {
        font-size: 1.8rem !important;
        padding: 0.75rem 0.5rem !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

        .top-banner p {
            font-size: 0.9rem !important;
            margin-bottom: 0;
        }

    /* Dashboard Toolbar 2x2 Grid */
    .dashboard-toolbar .d-flex {
        gap: 8px !important;
        padding: 0 8px;
    }

    .btn-dash {
        flex: 1 1 calc(50% - 6px);
        padding: 4px 6px !important;
        font-size: 0.55rem !important;
        /* Extremely compact */
        justify-content: center;
        letter-spacing: 0.2px;
        white-space: nowrap;
        border-radius: 4px !important;
        height: 28px;
        /* Further reduced */
    }

        .btn-dash i {
            font-size: 0.65rem !important;
        }

    /* Pricing Mode & Icons One-Line Layout Alignment Fix */
    .filter-section {
        padding: 0.5rem 0.5rem !important;
        /* Slightly tighter padding */
        min-height: 48px;
        display: flex;
        align-items: center;
    }

        .filter-section .row {
            flex-wrap: nowrap !important;
            justify-content: space-between !important;
            align-items: center !important;
            margin-left: -4px !important;
            margin-right: -4px !important;
            width: 100% !important;
            /* Critical: allow row to span full width */
        }

        .filter-section .col-12 {
            display: flex !important;
            align-items: center !important;
            width: auto !important;
            flex: 0 1 auto !important;
            margin-bottom: 0 !important;
            padding: 0 4px !important;
            /* Increased for breathing room */
        }

        .filter-section .ms-auto {
            display: flex !important;
            align-items: center !important;
            justify-content: flex-end !important;
            /* Force icons to the right */
            flex: 1 1 auto !important;
            /* Allow it to grow and push */
            margin-left: auto !important;
            /* Explicit push */
            width: auto !important;
            flex-wrap: nowrap !important;
            gap: 8px !important;
            /* Slightly more breathable gap */
            padding-top: 0 !important;
        }

    .pricing-selector {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: auto !important;
        margin-bottom: 0 !important;
    }

    .pricing-label {
        display: none !important;
    }

    .pricing-options {
        min-width: 90px !important;
        padding: 0 !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
    }

    #pricing-toggle {
        padding: 0 12px !important;
        font-size: 0.85rem !important;
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        border-radius: 999px !important;
    }

    /* Pricing Dropdown Off-screen Fix */
    #pricing-dropdown .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        bottom: auto !important;
        left: 0 !important;
        right: auto !important;
        transform: none !important;
        margin-top: 4px !important;
        min-width: 140px !important;
        z-index: 1060 !important;
    }

    /* Standardize all toolbar icons for mobile */
    .btn-toolbar-icon,
    .btn-search,
    .btn-filter {
        width: 32px !important;
        height: 32px !important;
        font-size: 1.2rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        color: var(--primary-dark) !important;
    }

        .btn-filter .filter-text {
            display: none !important;
        }

    /* Active Highlight for Search to match UI */
    .search-toggle-checkbox:checked ~ .btn-search {
        background-color: var(--primary-light) !important;
        color: var(--primary) !important;
        border-radius: 50%;
    }

    .search-wrapper {
        display: flex !important;
        align-items: center !important;
        flex: 0 0 auto !important;
    }

    .search-bar {
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
    }

    .search-toggle-checkbox:checked ~ .search-bar {
        width: 110px;
        margin-right: 4px !important;
    }

    .search-input {
        padding: 0 10px !important;
        font-size: 0.8rem !important;
        height: 100% !important;
        width: 100% !important;
    }

    /* Product Card "De-squishing" */
    .product-card {
        border-radius: 6px;
    }

    .card-content {
        padding: 8px !important;
    }

    .product-name {
        font-size: 0.85rem !important;
    }

    .product-price {
        font-size: 0.9rem !important;
    }

    .product-id-badge {
        font-size: 0.6rem !important;
        padding: 2px 5px !important;
    }

    .action-btn,
    .btn-bag,
    .card-action-btn {
        width: 26px !important;
        height: 26px !important;
        font-size: 0.85rem !important;
    }

        .card-action-btn i {
            font-size: 1rem !important;
        }

    .utility-bar .container-xxl {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }

    .utility-item {
        justify-content: center;
    }

    .action-dropdown-menu {
        min-width: 140px !important;
        max-width: 80vw !important;
        right: 0 !important;
        top: calc(100% + 4px) !important;
        /* Open downwards on mobile */
        bottom: auto !important;
        padding: 4px !important;
    }

    .action-dropdown-item {
        padding: 4px 10px !important;
        font-size: 0.75rem !important;
        gap: 8px !important;
    }

    .card-action-dropdown::after {
        bottom: auto !important;
        top: 100% !important;
        /* Flip bridge for mobile */
    }

    html,
    body {
        overflow-x: hidden;
        max-width: 100%;
    }
}

/* Conflicting tablet override removed */

/* --- Unified Portal Announcement --- */
.portal-announcement {
    background: #3A5778;
    color: #fff;
    padding: 8px 0;
    font-size: 0.85rem;
    font-family: var(--font-sans);
}

.announcement-text {
    display: flex;
    align-items: center;
    gap: 10px;
}

.announcement-contact u {
    font-weight: 600;
}

/* --- Control Hub --- */
.control-hub {
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.hub-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.hub-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hub-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-sub);
    letter-spacing: 1px;
}

/* Compact Dashboard Buttons */
.action-strip {
    display: flex;
    gap: 10px;
}

.btn-dash-sm {
    background: var(--bg-neutral);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

    .btn-dash-sm:hover {
        background: var(--primary-light);
        border-color: var(--primary);
        color: var(--primary-dark);
    }

.btn-filter-hub {
    background: #3A5778;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

    .btn-filter-hub:hover {
        background: var(--primary);
    }

/* Responsive Hub Overrides */
@media (max-width: 991px) {
    .hub-layout {
        flex-direction: column;
        gap: 1.5rem;
        align-items: stretch;
    }

    .hub-group {
        justify-content: center;
    }

    .action-strip {
        overflow-x: auto;
        padding-bottom: 5px;
        justify-content: flex-start;
        width: 100%;
    }

    .btn-dash-sm span {
        display: none;
        /* Icon only on small screens to save space */
    }

    .btn-dash-sm {
        padding: 10px;
    }
}

/* --- Active Filter Tags (Sidebar Version) --- */
.active-filters-container {
    display: none !important;
    flex-direction: row;
    flex-wrap: wrap;
    background: #ffffff;
}

    .active-filters-container:not(:empty) {
        display: flex !important;
    }

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--text-sub);
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

    .filter-tag:hover {
        background: #e2e8f0;
        border-color: #cbd5e1;
    }

.btn-remove-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s ease;
}

    .btn-remove-filter:hover {
        color: #ef4444;
    }

/* --- Quick View Modal Premium Styling --- */
#quickViewModal .modal-content {
    background: white;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.btn-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1060;
    background: var(--primary-dark);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

    .btn-modal-close:hover {
        background: #111827;
        transform: rotate(90deg);
    }

.qv-header {
    background: #ffffff;
    border-color: #f1f5f9 !important;
}

.qv-order-id {
    color: #1e293b;
    font-family: var(--font-serif);
}

.qv-specs-content {
    animation: fadeInModal 0.5s ease;
}

.qv-detail-item {
    font-family: var(--font-sans);
    color: #334155;
    padding: 4px 0;
}

    .qv-detail-item .fw-bold {
        color: #1e293b;
        margin-right: 8px;
    }

.qv-image-stage {
    background: #ffffff;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.qv-img-display {
    max-height: 480px;
    object-fit: contain;
    transition: opacity 0.2s ease, transform 0.3s ease;
}

.qv-nav-btn {
    background: transparent;
    border: none;
    color: #1e293b;
    font-size: 3.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    line-height: 1;
    opacity: 0.4;
    padding: 10px;
}

    .qv-nav-btn:hover {
        opacity: 1;
        color: var(--primary-dark);
    }

.qv-thumbnails-footer {
    background-color: #f8fafc !important;
    border-color: #f1f5f9 !important;
}

.qv-thumb {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .qv-thumb img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .qv-thumb:hover {
        border-color: #94a3b8;
        transform: translateY(-4px);
    }

    .qv-thumb.active {
        border-color: var(--primary-dark);
        background: #eff6ff;
        box-shadow: 0 4px 12px rgba(58, 87, 120, 0.15);
    }

@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.modal-dialog-scrollable .modal-content {
    overflow: hidden;
}

.modal-dialog-scrollable .modal-body {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-dark) #f1f5f9;
}


/* Text Based Thumbnails */
.qv-thumb-text {
    min-width: 80px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .qv-thumb-text:hover {
        color: var(--primary-dark);
        border-color: #94a3b8;
        background: #f8fafc;
    }

    .qv-thumb-text.active {
        background: white;
        border-color: var(--primary-dark);
        color: var(--primary-dark);
        box-shadow: 0 0 0 2px rgba(58, 87, 120, 0.1);
    }


/* --- Utility Bar Styles --- */
.btn-action-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    color: var(--primary-dark);
    background-color: transparent;
    transition: all 0.2s ease;
}

    .btn-action-icon:hover {
        background-color: #f1f5f9;
        color: var(--primary);
        transform: translateY(-2px);
    }

.input-group-text {
    color: #94a3b8 !important;
}

.input-group:focus-within {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    border-color: var(--primary-dark) !important;
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--primary-dark);
}

@media (max-width: 767.98px) {
    .w-mobile-100 {
        width: 100% !important;
    }
}

@media (min-width: 768px) {
    .w-md-auto {
        width: auto !important;
    }
}

/* --- Dropdown Fixes --- */
.dashboard-toolbar,
.dashboard-toolbar .d-flex {
    overflow: visible !important;
}

    .dashboard-toolbar .dropdown-menu {
        z-index: 2000 !important;
        position: absolute !important;
        inset: auto auto auto auto !important;
        /* Reset inset */
        top: 100% !important;
        margin-top: 0.5rem !important;
        display: none;
        /* Hide by default */
    }

        .dashboard-toolbar .dropdown-menu.show {
            display: block !important;
        }

.dropdown-toggle::after {
    display: inline-block !important;
    margin-left: 0.5em !important;
    vertical-align: 0.255em !important;
    content: '' !important;
    border-top: 0.3em solid !important;
    border-right: 0.3em solid transparent !important;
    border-bottom: 0 !important;
    border-left: 0.3em solid transparent !important;
}

/* --- Quick Quote Modal / Calculator Styles --- */
.font-headings {
    font-family: var(--font-serif);
}

.rounded-4 {
    border-radius: 1rem !important;
}

.rounded-bottom-4 {
    border-bottom-left-radius: 1rem !important;
    border-bottom-right-radius: 1rem !important;
}

.modal-header .btn-close {
    opacity: 0.5;
    transition: opacity 0.2s;
}

    .modal-header .btn-close:hover {
        opacity: 1;
    }

/* Premium Segmented Control */
.btn-segmented {
    border: none !important;
    background: transparent !important;
    color: #a0aec0 !important;
    /* Lighter grey for inactive */
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    letter-spacing: 0.5px;
}

    .btn-segmented:hover {
        color: #4a5568 !important;
    }

.btn-check:checked + .btn-segmented {
    background-color: white !important;
    color: #3A5778 !important;
    /* Darker blue from the image */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    border-radius: 8px !important;
}

/* Custom Utilities */
.btn-white {
    background-color: white;
    border: 1px solid #dee2e6;
    color: #333;
}

    .btn-white:hover {
        background-color: #f8f9fa;
    }

.hover-lift {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

    .hover-lift:hover {
        transform: translateY(-2px);
    }

.transition-all {
    transition: all 0.25s ease-in-out;
}

.border-dashed {
    border-style: dashed !important;
    border-width: 2px !important;
}

/* Sticky Footer */
.modal-footer.sticky-bottom {
    position: sticky;
    bottom: 0;
    z-index: 1020;
    margin-bottom: -1px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.05) !important;
}

/* Stone Section Tabs */
.stone-section .nav-pills .nav-link {
    color: #6c757d;
    transition: all 0.2s;
}

    .stone-section .nav-pills .nav-link.active {
        background-color: white !important;
        color: #3A5778 !important;
        /* Consistent blue */
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
        font-weight: 700;
    }

/* Image Gallery Refinement */
.modal-image-gallery {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .modal-image-gallery img {
        max-height: 100%;
        object-fit: contain;
    }

.thumbnails .img-thumbnail {
    border: 2px solid transparent;
    transition: all 0.2s;
}

    .thumbnails .img-thumbnail:hover,
    .thumbnails .img-thumbnail.border-primary {
        border-color: var(--primary) !important;
        transform: scale(1.05);
    }

/* Custom thin scrollbar for modal body */
.modal-dialog-scrollable .modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-dialog-scrollable .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-dialog-scrollable .modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

    .modal-dialog-scrollable .modal-body::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

/* --- Mobile Refinements --- */
@media (max-width: 767.98px) {
    .modal-body {
        padding: 1rem !important;
    }

    .modal-header {
        padding: 1.25rem 1.25rem 0 1.25rem !important;
    }

    /* Stacked Pill Tabs for Mobile */
    .stone-section .nav-pills {
        flex-direction: column;
        border-radius: 1.25rem !important;
        padding: 0.25rem !important;
        background-color: #f8f9fa !important;
    }

        .stone-section .nav-pills .nav-item {
            width: 100%;
        }

        .stone-section .nav-pills .nav-link {
            padding: 8px !important;
            font-size: 0.85rem !important;
            border-radius: 1.25rem !important;
            margin-bottom: 2px;
        }

            .stone-section .nav-pills .nav-link:last-child {
                margin-bottom: 0;
            }

    /* Compact Sticky Footer */
    .modal-footer.sticky-bottom {
        flex-direction: column;
        gap: 0.75rem !important;
        padding: 1rem !important;
        align-items: stretch !important;
    }

        .modal-footer.sticky-bottom .d-flex.flex-column {
            width: 100%;
            gap: 0.25rem !important;
        }

        .modal-footer.sticky-bottom .text-muted.small {
            font-size: 0.7rem !important;
        }

        .modal-footer.sticky-bottom .fw-bold.text-dark {
            font-size: 0.9rem !important;
        }

        .modal-footer.sticky-bottom .btn-primary {
            width: 100%;
            justify-content: center;
            padding: 0.75rem !important;
            gap: 1rem !important;
        }

            .modal-footer.sticky-bottom .btn-primary .fs-4 {
                font-size: 1.1rem !important;
            }

            .modal-footer.sticky-bottom .btn-primary .fw-semibold {
                font-size: 0.9rem !important;
            }

    /* Image Gallery Centering */
    .col-lg-5.mb-lg-0 {
        margin-bottom: 1rem;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .modal-image-gallery {
        max-height: 220px;
        max-width: 280px;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .thumbnails {
        justify-content: center;
        width: 100%;
    }

        .thumbnails .img-thumbnail {
            width: 45px !important;
            height: 45px !important;
        }

    /* Data Cards sizing */
    /* Table Overflow Fix */
    .stone-section .table {
        font-size: 0.75rem !important;
    }

        .stone-section .table th,
        .stone-section .table td {
            padding: 8px 4px !important;
        }

    .stone-section .card-body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .stone-section .table .fs-5 {
        font-size: 0.85rem !important;
    }

    .fs-4.fw-bold.text-dark {
        font-size: 1.1rem !important;
    }

    .btn-segmented {
        font-size: 0.75rem;
        padding: 6px 4px !important;
    }
}

/* Master Typography Overrides */
.top-banner {
    font-size: 3.5rem !important;
    font-weight: 500 !important;
}

.banner-subtext {
    font-size: 1rem !important;
    font-weight: 400 !important;
}

@media (max-width: 767.98px) {
    .top-banner {
        font-size: 1.8rem !important;
    }

    .banner-subtext {
        font-size: 0.9rem !important;
    }
}

/* ============ ULTRA WIDE DESKTOPS (min-width: 1920px) ============ */
@media (min-width: 1600px) {
    .container-xxl {
        max-width: 1860px !important;
    }

    .product-grid {
        grid-template-columns: repeat(4 1fr) !important;
        gap: 1.5rem !important;
    }

    .top-banner {
        font-size: 3rem !important;
    }

    .product-card {
        padding: 15px !important;
    }
}

/* --- Mobile Specific Refinements --- */
@media (max-width: 768px) {

    /* Smaller Show More Button */
    #show-more-btn {
        padding: 0.6rem 1.5rem !important;
        font-size: 0.9rem !important;
    }
}

/* --- Search History Dropdown --- */
.search-bar-modern {
    position: relative;
    /*z-index: 1100;*/
    /* Ensure parent is high up */
}

.search-history-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    margin-top: 8px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    overflow: hidden;
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history-item {
    transition: background-color 0.2s;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-main);
}

    .history-item:hover {
        background-color: var(--bg-neutral);
    }

    .history-item .remove-item {
        opacity: 0.5;
        transition: opacity 0.2s, color 0.2s;
        cursor: pointer;
    }

/* --- Search Visibility Fixes --- */
.advanced-search-container {
    position: relative;
    /*z-index: 1000;*/
    overflow: visible !important;
}

.search-bar-modern {
    position: relative;
    /*z-index: 1001;*/
    /* Higher than container */
}


/* --- Search Input Wrapper Specifics --- */
.search-input-wrapper {
    position: relative !important;
    overflow: visible !important;
    /* Allow dropdown to spill out */
    /*z-index: 1002;*/
}

.search-history-dropdown {
    position: absolute;
    top: calc(50% + 12px);
    /* Slightly more gap */
    left: 0;
    width: 100%;
    /* Remove 'right' and rely on width 100% of parent */
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    z-index: 9999 !important;
    /* Maximum Priority */
    padding: 0;
    overflow: hidden;
}

.history-header {
    background-color: #f8fafc;
    border-bottom: 1px solid #edf2f7;
}

.history-item {
    font-size: 0.95rem;
    padding: 10px 16px;
}

/* --- Mobile Header Size Adjustment --- */
@media (max-width: 768px) {
    .top-banner {
        font-size: 1.5rem !important;
        padding: 0.75rem 1rem !important;
        line-height: 1.2;
    }

    .banner-subtext {
        font-size: 0.8rem !important;
        margin-top: 6px !important;
        line-height: 1.4;
        padding: 0 10px;
    }

    .beta-notice {
        margin: 0.5rem 1rem !important;
        padding: 8px 12px !important;
        font-size: 0.75rem !important;
        gap: 8px !important;
        line-height: 1.3;
    }

        .beta-notice i {
            font-size: 1rem !important;
        }

    .helper-notice {
        font-size: 0.75rem !important;
        margin: 0 1rem 1rem 1rem !important;
        text-align: center;
        color: var(--text-sub);
        /* If helper-notice has no base style, add some here or via a separate rule if needed 
           but assume standard div behavior plus this specific styling */
    }
}

/* --- Stone Visual Grid (Added for HTML Image Support) --- */
.visual-stone-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 8px 0;
}

.stone-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-align: center;
}

    .stone-option input {
        display: none;
    }

.stone-image {
    width: 64px;
    /* Slightly larger targets */
    height: 64px;
    background-color: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
}

    .stone-image img {
        width: 32px;
        height: 32px;
        object-fit: contain;
        display: block !important;
        opacity: 1 !important;
        /* Ensure always visible */
        visibility: visible !important;
    }

.stone-option input:checked + .stone-image {
    background-color: var(--primary-light);
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.stone-label {
    font-size: 0.75rem;
    color: var(--text-sub);
    font-weight: 600;
}

.stone-option:hover .stone-image {
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* --- Utilities for Borders --- */
.border-primary-theme {
    border-color: var(--primary) !important;
}

.border-accent-theme {
    border-color: var(--accent) !important;
}

/* --- Utilities for Text --- */
.text-primary-theme {
    color: var(--primary) !important;
}

.text-primary-dark-theme {
    color: var(--primary-dark) !important;
}

.text-accent-theme {
    color: var(--accent) !important;
}
