/* ==========================================================================
   GLOBAL SCROLLBAR REMOVAL
   ========================================================================== */
/* Hide for WebKit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* Hide for Firefox and IE/Edge Legacy */
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

:root {
    /* Globally Unified Category Landing Page Theme */
    --cat-title-color: #a855f7;
    
    --cat-primary-bg: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    --cat-primary-shadow: rgba(168, 85, 247, 0.15);
    --cat-primary-shadow-hover: rgba(168, 85, 247, 0.35);
    --cat-primary-text: #fff;
    
    --cat-secondary-bg: #fff;
    --cat-secondary-text: #111;
    --cat-secondary-border: 2px solid #f3e8ff;
    --cat-secondary-shadow: rgba(168, 85, 247, 0.05);
    
    --cat-card-bg: #f5edff;
    --cat-card-border: 2px solid #e9d5ff;
    --cat-card-shadow: rgba(168, 85, 247, 0.1);
    --cat-card-shadow-hover: rgba(168, 85, 247, 0.25);
    --cat-card-text: #6b21a8;
    
    --cat-hover-border: #a855f7;
    --cat-border-color: #f3e8ff;

    --cat-preview-bg: #fff;
    --cat-preview-border: 1px solid #f3e8ff;
    --cat-preview-shadow: rgba(168, 85, 247, 0.05);
    --cat-preview-shadow-hover: rgba(168, 85, 247, 0.2);
    --cat-preview-text: #7e22ce;

    --cat-all-bg: #f9f5ff;
    --cat-all-border: 2px solid #e9d5ff;
    --cat-all-shadow: rgba(168, 85, 247, 0.05);
    --cat-all-text: #6b21a8;
    --cat-all-arrow: #a855f7;
}

/* Simplified Sandbox Styles */
html, body.sandbox-body {
    overflow: hidden !important; /* Prevent classic scrolling */
    height: 100vh !important;
    display: flex !important;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.page-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Modular Widget Layout */
.sandbox-widget-layout {
    display: flex;
    flex-direction: column; /* Stack on mobile by default */
    width: 100%;
    flex: 1; /* Fill the viewport */
    font-family: inherit; /* Inherit host environment fonts */
    box-sizing: border-box;
}

.sandbox-widget-layout * {
    box-sizing: border-box;
}

.sandbox-widget-sidebar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    padding: 20px;
    border-bottom: 2px solid #1a1a1a;
    max-height: 50vh; /* Don't let mobile sidebar grow too huge */
    overflow-y: auto;
}

.sidebar-accordion {
    border-bottom: 2px solid #1a1a1a;
    margin-bottom: 20px;
}

.sidebar-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    padding: 10px 0;
    cursor: pointer;
    color: #1a1a1a;
    text-align: left;
}

.sidebar-accordion-header:hover {
    color: #666;
}

.sidebar-accordion-content {
    padding-top: 10px;
    padding-bottom: 10px;
}
.sandbox-widget-content {
    flex: 1;
    padding: 20px;
    background: #fafafa;
    overflow-y: auto; /* Contain scrolling to the content area */
    scrollbar-width: none; /* Firefox */
}
.sandbox-widget-content::-webkit-scrollbar,
.sandbox-widget-sidebar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.shop-filter-drawer {
    position: fixed;
    left: 0;
    top: var(--drawer-top, 0px);
    height: var(--drawer-height, 100%);
    width: 300px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: none;
    border-right: 2px solid #e9d5ff;
    max-height: none;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    padding: 40px 30px;
    box-sizing: border-box;
}

.shop-filter-drawer.expanded {
    transform: translateX(0);
}

/* Desktop Transformation */
@media (min-width: 1024px) {
    .sandbox-widget-layout {
        display: grid;
        grid-template-columns: 280px 1fr;
        align-items: stretch;
        height: 100%;
        overflow: hidden;
    }

    .sandbox-widget-layout.no-sidebar {
        grid-template-columns: 1fr;
    }

    .sandbox-widget-sidebar {
        border-bottom: none;
        border-right: 2px solid #1a1a1a;
        height: 100%;
        max-height: none;
        overflow-y: auto;
        background: #fff;
    }
    
    .shop-widget-layout {
        display: block;
        height: 100%;
        overflow: hidden;
        position: relative;
    }

    .shop-widget-layout.no-sidebar {
        display: block;
    }

    .sandbox-widget-content {
        padding: 40px;
        height: 100%;
        overflow-y: auto;
    }
}

/* Filter Controls */
.filter-side-tab {
    position: fixed;
    left: 0;
    top: 30%;
    transform: translateY(-50%);
    background: #a855f7;
    color: #fff;
    padding: 20px 8px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    cursor: pointer;
    z-index: 999;
    font-weight: 900;
    border-radius: 0 8px 8px 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-side-tab:hover {
    background: #9333ea;
}

.filter-section {
    margin-bottom: 30px;
}
.filter-section h4 {
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
    border-bottom: 1px dashed #e9d5ff;
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: #6b21a8;
}

.filter-pill {
    display: inline-block;
    padding: 8px 16px;
    margin: 4px;
    background: #f9f5ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.2s;
}

.filter-pill:hover {
    background: #f3e8ff;
    border-color: #d8b4fe;
}

.filter-pill.active {
    background: #a855f7;
    color: #fff;
    border-color: #a855f7;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Admin Navigation Banner */
.admin-nav-banner {
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    padding: 10px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(211, 47, 47, 0.8);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.admin-nav-banner .nav-brand {
    font-weight: 900;
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.admin-nav-banner .nav-links {
    display: flex;
    gap: 20px;
}

.admin-nav-banner .nav-link {
    background: transparent;
    border: none;
    color: #999;
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    padding: 5px 15px;
    border-radius: 4px;
}

.admin-nav-banner .nav-link.active {
    color: #fff;
    background: #333;
}

.admin-nav-banner .nav-link:hover {
    color: #fff;
}

.sandbox-body {
    background-color: #ffffff;
    color: #1a1a1a;
}

.sandbox-header {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid #a855f7;
}

.sandbox-header .brand-main {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -1px;
    margin: 0;
}

.sandbox-header .brand-sub {
    font-size: 0.9rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 4px;
    opacity: 0.7;
}

.sandbox-status {
    font-size: 0.6rem; /* Slightly smaller */
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    opacity: 0.6;
    text-align: center;
}

@media (max-width: 480px) {
    .sandbox-header {
        padding: 10px;
    }
    
    .sandbox-header .brand-main { font-size: 1.5rem; }
    .sandbox-header .brand-sub { font-size: 0.8rem; }
    
    .sandbox-header div[style*="display: flex"] {
        flex-direction: column;
        gap: 10px !important;
    }
}

/* Modal Overlay - Simplified */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 500px;
    padding: 40px;
    border-radius: 0;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

/* Modal Overlay - Industrial Refinement */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #ffffff;
    width: 95%;
    max-width: 550px;
    padding: 50px;
    border-radius: 0;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    border-top: 6px solid #a855f7;
}

.mode-switcher {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    border: 1px solid #eee;
}

.mode-btn {
    flex: 1;
    padding: 18px;
    background: #f9f9f9;
    border: none;
    font-weight: 900;
    cursor: pointer;
    text-align: center;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: #999;
    transition: all 0.2s ease;
}

.mode-btn.active {
    background: #1a1a1a;
    color: #fff;
}

/* Custom Text Input & Font Selection */
#sim-text-input {
    width: 100%;
    padding: 20px;
    font-size: 1.2rem;
    font-family: 'Inter', sans-serif;
    border: 2px solid #eee;
    background: #fff;
    color: #1a1a1a;
    margin-bottom: 25px;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 1px;
    outline: none;
}

#sim-text-input:focus {
    border-color: #1a1a1a;
}

.font-selectors {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 30px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 10px;
    padding-bottom: 10px;
}

.font-selectors::-webkit-scrollbar {
    width: 6px;
}
.font-selectors::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.font-selectors::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}
.font-selectors::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.font-option {
    padding: 15px;
    background: #fff;
    border: 1px solid #eee;
    font-weight: 800;
    font-size: 0.7rem;
    cursor: pointer;
    text-align: center;
    text-transform: uppercase;
    transition: all 0.2s ease;
    color: #444;
}

.font-option:hover {
    border-color: #1a1a1a;
}

.font-option.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

/* Buttons System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 30px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    border-radius: 0;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: #1a1a1a;
    color: #fff;
}

.btn-primary:hover {
    background: #a855f7;
}

.btn-outline {
    background: transparent;
    border: 2px solid #1a1a1a !important;
    color: #1a1a1a;
}

.btn-outline:hover {
    background: #1a1a1a;
    color: #fff;
}

.btn-back {
    background: none;
    border: 1px solid #ddd;
    color: #888;
    padding: 12px 25px;
    font-size: 0.7rem;
    font-weight: 900;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    margin-bottom: 30px;
}

.btn-back:hover {
    border-color: #1a1a1a;
    color: #1a1a1a;
}

.upload-zone {
    border: 2px dashed #ddd;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9f9f9;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-zone:hover {
    border-color: #1a1a1a;
    background: #fff;
}

/* Grid Styles (Scoped to Sandbox Viewport) */
#product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 30px;
    padding: 0 8% 60px 8%;
}

.product-card-dynamic {
    background: var(--cat-card-bg, #ffffff);
    border: var(--cat-card-border, 1px solid #eee);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card-dynamic:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px var(--cat-card-shadow-hover, rgba(0,0,0,0.1));
    border-color: var(--cat-hover-border, #a855f7);
}

.product-card-dynamic .btn-primary {
    background: var(--cat-primary-bg, #a855f7);
    color: var(--cat-primary-text, #fff);
    border: none;
}

.thumbnail-workspace {
    position: relative;
    background: #f9f9f9;
    padding: 20px;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.thumbnail-base-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.thumbnail-logo-overlay {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: none;
    line-height: 0;
}

.thumbnail-logo-overlay img {
    width: 100%;
    height: auto;
}

.logo-limit-guide {
    position: absolute;
    border: 3px solid #a855f7; /* Even thicker for bold blueprint look */
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: none;
    box-shadow: 0 0 8px rgba(0,0,0,0.4); /* Stronger halo */
    box-sizing: border-box;
}

.logo-overlay {
    box-sizing: border-box;
    z-index: 10;
}

/* HUD Label Styles */
.hud-label {
    position: absolute;
    background: #a855f7;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 12px; /* Beefier backgrounds */
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 3px 10px rgba(0,0,0,0.5);
}

.hud-label.horizontal {
    top: -22px; /* Closer to the box */
    left: 50%;
    transform: translateX(-50%);
}

.hud-label.vertical {
    top: 50%;
    left: -22px; /* Closer to the box */
    /* By rotating FIRST, the X/Y axes swap for the translation.
       -50% X centers it on the Y-axis.
       -50% Y centers it on the X-axis. */
    transform: rotate(-90deg) translate(-50%, -50%);
    transform-origin: 0 0;
}

.logo-hud-readout {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 26, 26, 0.95);
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 900;
    padding: 6px 12px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;
    border: 2px solid #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.product-info-sandbox {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.product-brand {
    font-size: 0.65rem;
    color: #888;
    font-weight: 700;
    text-transform: uppercase;
}

.product-price {
    font-weight: 700;
    color: #1a1a1a;
}

.product-name {
    font-size: 0.9rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 15px;
    
    /* Force single line with ellipsis for uniform card heights */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-sizes-badges {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 5px;
    margin-bottom: 20px;
    margin-top: auto;
    min-height: 48px;
}

.size-badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 10px;
    background: var(--cat-preview-bg, #f0f0f0);
    color: var(--cat-preview-text, #1a1a1a);
    border: var(--cat-preview-border, 1px solid transparent);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.size-badge:hover {
    background: var(--cat-primary-bg, #1a1a1a);
    color: var(--cat-primary-text, #ffffff);
    border-color: var(--cat-hover-border, transparent);
}

/* Product Detail Responsive Layout */
.product-detail-view {
    grid-column: 1 / -1;
    animation: fadeIn 0.4s ease;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.detail-nav {
    margin-top: 10px;
    margin-bottom: 20px;
}

.detail-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.detail-visual {
    width: 100%;
}

.composer-workspace {
    height: clamp(400px, 65vh, 800px); /* Gradual, fluid shrinkage */
    background: #f9f9f9;
    border: 1px solid #ddd;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-controls {
    width: 100%;
}

/* Button Overrides for Sandbox */
.btn-small {
    min-width: 100px; /* Reduced from 160px */
    width: auto;
    flex: 1;
}

@media (max-width: 480px) {
    .btn-small {
        font-size: 0.65rem;
        padding: 8px 10px;
        min-width: 0;
    }
}

/* Tablet & Desktop Adjustments */
@media (min-width: 1024px) {
    .detail-layout {
        flex-direction: row;
        gap: 60px;
        align-items: flex-start;
    }
    
    .detail-visual {
        flex: 1.2;
        min-width: 0;
        position: sticky;
        top: 120px;
    }
    
    .detail-controls {
        flex: 1;
        min-width: 0;
    }

    .btn-small {
        min-width: 140px;
        flex: 0 0 auto;
    }
}

/* UI Elements inside Detail */
.angle-selectors {
    display: flex;
    gap: 1px; /* Tighter gap for block look */
    margin-top: 1px; /* Flush with composer */
    justify-content: stretch;
}

.angle-btn-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.angle-btn-container .btn {
    width: 100%;
    border-radius: 0; /* Blocky look */
    border: none;
    background: #f0f0f0;
    color: #666;
    font-size: 0.7rem;
    padding: 15px 5px;
}

.angle-btn-container .btn.active {
    background: #1a1a1a;
    color: #fff;
}

.angle-btn-container .angle-toggle-wrapper {
    background: #e5e5e5;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
    border-top: 1px solid #ddd;
    transition: all 0.2s ease;
    color: #666;
}

.angle-btn-container .angle-toggle-wrapper.active {
    background: #28a745;
    color: white;
    border-top-color: #1e7e34;
}

.angle-btn-container .angle-toggle-wrapper:hover:not(.active) {
    background: #d5d5d5;
}

.angle-btn-container.no-photo .btn {
    opacity: 0.3;
    pointer-events: none;
    cursor: not-allowed;
}

.angle-btn-container.no-photo .angle-toggle-wrapper,
.angle-btn-container.no-logo .angle-toggle-wrapper {
    opacity: 0.3;
    pointer-events: none;
}

.view-options-row {
    display: flex;
    gap: 10px;
    margin-bottom: 40px;
}

.size-selector-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 40px;
}

.detail-description {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.detail-description p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
}

.size-btn {
    min-width: 50px; /* Reduced from 60px */
    width: auto;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #dddddd;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.size-btn:hover {
    border-color: #1a1a1a;
}

.size-btn.active {
    background: #1a1a1a;
    color: #ffffff;
    border-color: #1a1a1a;
}

.loading-state {
    grid-column: 1 / -1;
    padding: 100px;
    text-align: center;
    font-weight: 700;
    letter-spacing: 2px;
    color: #666;
    text-transform: uppercase;
}

/* Debug Monitor Dual Panels */
.debug-monitor-container {
    position: fixed;
    right: 20px;
    top: 100px;
    width: 350px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 2000;
    pointer-events: none;
}

.debug-panel {
    background: rgba(26, 26, 26, 0.95);
    border: 2px solid #333;
    border-radius: 8px;
    overflow: hidden;
    pointer-events: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.debug-panel.collapsed {
    height: 45px !important;
}

.debug-header {
    background: #1a1a1a;
    color: #fff;
    padding: 12px 20px;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    flex: 0 0 45px;
}

.debug-header:after {
    content: '−';
    font-size: 14px;
}

.debug-panel.collapsed .debug-header:after {
    content: '+';
}

.debug-content {
    height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: rgba(26, 26, 26, 0.95);
    color: #00ff00;
    font-family: 'Courier New', monospace;
}

.debug-content pre {
    margin: 0;
    font-size: 0.7rem;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Hide original debug monitor if it exists */
#sandbox-debug-monitor { display: none !important; }

.editor-color-swatch {
    cursor: pointer;
    transition: opacity 0.2s, filter 0.2s;
    position: relative;
    user-select: none;
}
.editor-color-swatch.editor-hidden-color {
    opacity: 0.5;
    filter: grayscale(1);
    text-decoration: line-through;
}
.editor-color-swatch.editor-hidden-color::after {
    content: '\2215'; /* Math slash */
    position: absolute;
    font-size: 24px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #a855f7;
    font-weight: bold;
    pointer-events: none;
}

.editor-size-swatch {
    cursor: pointer;
    transition: opacity 0.2s, filter 0.2s;
    position: relative;
    user-select: none;
}
.editor-size-swatch.editor-hidden-size {
    opacity: 0.5;
    filter: grayscale(1);
    text-decoration: line-through;
}
.editor-size-swatch.editor-hidden-size::after {
    content: '\2215'; /* Math slash */
    position: absolute;
    font-size: 24px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #a855f7;
    font-weight: bold;
    pointer-events: none;
}

/* ------------------------------------- */
/* MOBILE OPTIMIZATIONS (Responsive)     */
/* ------------------------------------- */
@media (max-width: 768px) {
    /* Form & Review Page */
    .form-row {
        flex-direction: column !important;
        gap: 10px !important;
        margin-bottom: 15px !important;
    }
    .radio-group {
        flex-direction: column !important;
        gap: 10px !important;
    }
    .quote-review-page {
        padding: 15px !important;
    }
    #review-composer {
        padding: 20px !important;
    }
    .angle-selectors {
        flex-wrap: wrap;
    }

    /* Admin Quotes Card */
    .quote-card {
        padding: 15px !important;
    }
    .quote-card-header {
        flex-direction: column !important;
        gap: 15px !important;
    }
    .quote-card-actions {
        align-items: flex-start !important;
        text-align: left !important;
    }
    .card-dynamic-content {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    /* Product Editor / Mini Composer */
    .mini-workspace {
        min-height: 200px !important;
    }
    .mini-base-img {
        height: 200px !important;
    }
    .editor-view {
        flex-direction: column !important;
        padding: 15px !important;
    }
    .editor-sidebar {
        flex: none !important;
        max-height: none !important;
    }
    .editor-main {
        padding: 15px !important;
    }
    #calibration-tabs {
        flex-wrap: wrap;
    }
}

.mini-angle-selectors .btn-outline { font-size: 0.75rem !important; font-weight: 900 !important; padding: 8px 14px !important; border: 2px solid #1a1a1a !important; background: #fff !important; color: #1a1a1a !important; }
.mini-angle-selectors .btn-outline.active { background: #1a1a1a !important; color: #fff !important; }


/* =========================================
   PREMIUM DESIGN UPGRADES
   ========================================= */

/* Typography Overhaul */
body.sandbox-body, .sandbox-widget-layout {
    font-family: 'Inter', sans-serif !important;
}

/* Glassmorphism for Sidebars and Modals */
.sandbox-widget-sidebar {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(0,0,0,0.05) !important;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: 6px solid #a855f7 !important;
    box-shadow: 0 40px 80px rgba(0,0,0,0.4) !important;
    border-radius: 12px !important;
}

/* Micro-interactions: Hover states */
.product-card-dynamic {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease !important;
    border-radius: 8px !important;
    overflow: hidden;
}

.product-card-dynamic:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1) !important;
}

.btn, button {
    transition: all 0.2s ease !important;
}

.btn:hover, button.mode-btn:hover:not(.active) {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.btn:active, button.mode-btn:active {
    transform: scale(0.98);
}

/* Shimmering Skeleton Loader */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.loading-state {
    color: transparent !important;
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 1000px 100%; 
    animation-duration: 1.5s;
    animation-fill-mode: forwards; 
    animation-iteration-count: infinite;
    animation-name: shimmer;
    animation-timing-function: linear;
    border-radius: 8px;
    height: 300px;
    width: 100%;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid rgba(0,0,0,0.05);
}

.image-skeleton {
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 1000px 100%; 
    animation: shimmer 1.5s infinite linear forwards;
    border-radius: 6px;
}

.loading-state::after {
    content: "LOADING...";
    position: absolute;
    color: rgba(0,0,0,0.3);
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 4px;
    z-index: 10;
}

/* Refined Dark Accents (Softer than stark black) */
.admin-nav-banner {
    background: #111111 !important;
}
.sandbox-header {
    background-color: #111111 !important;
}

/* Order Management / Quotes UI Responsive Styles */
.quotes-view-container {
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.quote-header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
}

.quote-header-left, .quote-header-right {
    display: flex;
}

.quote-header-right {
    align-items: stretch;
}

.quote-header-date {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2196F3;
    border-left: 1px solid #e0e0e0;
}

.quote-header-due {
    background: #a855f7;
    color: #fff;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 700;
    min-height: 60px;
}

.quote-totals-block {
    width: 400px;
    border-left: 1px solid #e0e0e0;
}

.table-responsive-wrapper {
    overflow-x: auto;
    width: 100%;
}

.quote-tabs-container {
    display: flex;
    flex-wrap: wrap;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 0;
}

.quote-tabs-container > div {
    flex: 1;
    min-width: max-content;
    text-align: center;
}

@media (min-width: 1024px) {
    .quotes-view-container {
        padding: 40px;
    }
}

@media (max-width: 768px) {
    .quote-header-wrap {
        flex-direction: column;
    }
    .quote-header-right {
        width: 100%;
        border-top: 1px solid #e0e0e0;
    }
    .quote-header-date {
        border-left: none;
        border-right: 1px solid #e0e0e0;
        flex: 1;
        justify-content: center;
    }
    .quote-header-due {
        flex: 1;
        justify-content: center;
    }
    .quote-totals-block {
        width: 100%;
        border-left: none;
    }
    .quote-tabs-container > div {
        flex: none;
        width: 100%;
    }
}

/* Quotes Split View Layout */
.quotes-page-wrapper {
    display: flex;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: #f5f6f8;
}

.admin-sidebar {
    width: 280px;
    background: #1a1a1a;
    color: #fff;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.quotes-main-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f6f8;
}

/* Mobile responsive layout for Quotes */
@media (max-width: 768px) {
    .quotes-page-wrapper {
        position: relative;
    }
    .admin-sidebar {
        width: 100%;
        border-right: none;
    }
    
    /* When an item is selected on mobile */
    .quotes-page-wrapper.view-active .admin-sidebar {
        display: none;
    }
    .quotes-page-wrapper:not(.view-active) .quotes-main-viewport {
        display: none;
    }
    
    .mobile-back-btn {
        display: block !important;
    }
}

@media (min-width: 1024px) {
    .quotes-main-viewport {
        padding: 40px;
    }
}

.admin-sidebar .sidebar-section {
    padding: 20px 0 0 0;
}

.admin-sidebar .section-title {
    padding: 0 20px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #666;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.admin-sidebar .sidebar-item {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ccc;
    transition: all 0.2s;
}

.admin-sidebar .sidebar-item:hover,
.admin-sidebar .sidebar-item.active {
    background: #333;
    color: #fff;
}

.admin-sidebar .sidebar-badge {
    background: #444;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
}

.admin-sidebar .sidebar-submenu {
    display: none;
    flex-direction: column;
    background: #0f0f0f;
}

.admin-sidebar .submenu-item {
    padding: 10px 20px 10px 40px;
    font-size: 0.85rem;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-sidebar .submenu-item:hover,
.admin-sidebar .submenu-item.active {
    color: #fff;
    background: #222;
}

.admin-sidebar .status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.quotes-main-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}

.client-summary-card {
    background: #fff;
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
}

@media (max-width: 768px) {
    #zoom-slider-container {
        position: absolute !important;
        bottom: 15px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 90% !important;
        background: rgba(255, 255, 255, 0.95) !important;
        padding: 15px !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
        z-index: 50 !important;
        margin-bottom: 0 !important;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }
    #zoom-slider-container .control-label {
        text-align: center !important;
        margin-bottom: 10px !important;
    }
}


/* Modal Content Responsive Refinements */
.modal-content {
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.mode-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 5px;
}

@media (max-width: 768px) {
    .modal-content {
        padding: 16px !important;
        width: 80% !important;
        max-width: 320px !important;
        max-height: 65vh !important;
        border-radius: 16px !important;
        margin-bottom: 70px !important; /* Dodge the benefits bar */
    }
    .modal-content h2.section-title {
        font-size: 1.2rem !important;
        margin-bottom: 8px !important;
    }
    .modal-content p {
        font-size: 0.75rem !important;
        margin-bottom: 12px !important;
    }
    .mode-btn {
        padding: 8px 4px !important;
        font-size: 0.75rem !important;
    }
    .upload-icon {
        font-size: 1.5rem !important;
    }
    .modal-subtitle {
        display: none !important;
    }
    
    .mode-switcher {
        margin-bottom: 12px !important;
    }
    
    .upload-zone {
        min-height: 120px !important;
        padding: 15px !important;
    }
    
    .modal-content .btn {
        padding: 10px 15px !important;
        font-size: 0.85rem !important;
    }

    .toolbox-btn {
        font-size: 0.65rem !important;
        padding: 6px !important;
    }
    .modal-actions {
        margin-top: 15px !important;
    }
}

