/* Canvthis workspace builder — styles from the source design, scoped to
   .canvthis-workspace so the host theme's header/footer are untouched. */

.canvthis-workspace {
            --bg-deep: #0b0f19;
            --bg-panel: rgba(17, 24, 39, 0.85);
            --bg-card: rgba(255, 255, 255, 0.02);
            --brand-primary: #32b38a;
            --brand-light: #4ade80;
            --brand-glow: rgba(50, 179, 138, 0.2);
            --text-main: #f1f5f9;
            --text-muted: #94a3b8;
            --border-color: rgba(255, 255, 255, 0.08);
            --border-hover: rgba(50, 179, 138, 0.4);
            --success: #10b981;
            --alert: #fbbf24;
        }

        .canvthis-workspace * { box-sizing: border-box; margin: 0; padding: 0; }
        
        .canvthis-workspace {
            font-family: 'Inter', sans-serif;
            background-color: var(--bg-deep);
            color: var(--text-main);
            display: flex;
            align-items: flex-start;
            background-image: radial-gradient(circle at 50% -20%, rgba(50, 179, 138, 0.1), transparent 50%);
        }

        .canvthis-workspace ::-webkit-scrollbar { width: 6px; }
        .canvthis-workspace ::-webkit-scrollbar-track { background: transparent; }
        .canvthis-workspace ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }
        .canvthis-workspace ::-webkit-scrollbar-thumb:hover { background: var(--brand-primary); }

        .canvthis-workspace .tabular-nums { font-variant-numeric: tabular-nums; }

        /* Sidebar Layout */
        .canvthis-workspace .sidebar {
            width: 280px;
            background: var(--bg-panel);
            backdrop-filter: blur(20px);
            border-right: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            padding: 30px 20px;
            z-index: 10;
            align-self: stretch;
        }

        .canvthis-workspace .brand {
            margin-bottom: 40px;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .canvthis-workspace .brand-logo {
            max-width: 90%;
            height: auto;
            filter: drop-shadow(0 0 15px var(--brand-glow)) brightness(1.2);
            transition: all 0.3s;
        }

        .canvthis-workspace .category-label {
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--text-muted);
            margin-bottom: 15px;
            font-weight: 700;
        }

        .canvthis-workspace .nav-link {
            padding: 12px 15px;
            margin-bottom: 6px;
            border-radius: 8px;
            cursor: pointer;
            color: var(--text-muted);
            transition: all 0.2s;
            font-size: 0.9rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: 600;
        }
        
        .canvthis-workspace .nav-link:hover,
.canvthis-workspace .nav-link.active {
            color: var(--text-main);
            background: rgba(255, 255, 255, 0.05);
            border-left: 3px solid var(--brand-primary);
        }

        .canvthis-workspace .nav-count {
            background: rgba(0,0,0,0.3);
            padding: 2px 8px;
            border-radius: 20px;
            font-size: 0.75rem;
            color: var(--brand-primary);
        }

        /* Main Workspace */
        .canvthis-workspace .workspace {
            flex: 1;
            display: flex;
            flex-direction: column;
            padding: 35px 45px;
            overflow-y: auto;
        }

        .canvthis-workspace .top-bar {
            display: flex;
            justify-content: space-between;
            align-items: flex-end;
            margin-bottom: 30px;
        }

        .canvthis-workspace .view-title {
            font-size: 1.8rem;
            font-weight: 800;
            margin-bottom: 5px;
            letter-spacing: -0.5px;
        }

        .canvthis-workspace .search-box {
            position: relative;
            width: 450px;
        }

        .canvthis-workspace .search-box i {
            position: absolute;
            left: 18px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            font-size: 1.2rem;
        }

        .canvthis-workspace .search-box input {
            width: 100%;
            padding: 14px 20px 14px 50px;
            background: rgba(0,0,0,0.2);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            color: #fff;
            font-size: 0.95rem;
            outline: none;
            transition: all 0.3s;
        }

        .canvthis-workspace .search-box input:focus {
            border-color: var(--brand-primary);
            box-shadow: 0 0 0 3px var(--brand-glow);
            background: rgba(0,0,0,0.4);
        }

        /* Product Grid */
        .canvthis-workspace .grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .canvthis-workspace .card {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 24px;
            display: flex;
            flex-direction: column;
            transition: all 0.3s;
        }

        .canvthis-workspace .card:hover {
            transform: translateY(-4px);
            border-color: var(--border-hover);
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            background: rgba(255, 255, 255, 0.04);
        }

        .canvthis-workspace .c-cat { font-size: 0.75rem; color: var(--brand-light); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; font-weight: 700;}
        .canvthis-workspace .c-title { font-size: 1.1rem; font-weight: 700; color: #fff; margin-bottom: 12px; line-height: 1.4; }
        
        /* Updated Description Class: Removed line clamp, allows full text visibility */
        .canvthis-workspace .c-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 25px; flex: 1; display: block; }
        
        .canvthis-workspace .c-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-top: 1px solid var(--border-color);
            padding-top: 15px;
        }

        .canvthis-workspace .price { font-size: 1.25rem; color: #fff; font-weight: 800; }
        
        .canvthis-workspace .btn-add {
            background: transparent;
            color: var(--text-main);
            border: 1px solid var(--border-color);
            padding: 8px 16px;
            border-radius: 8px;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .canvthis-workspace .btn-add:hover {
            border-color: var(--brand-primary);
            color: var(--brand-primary);
        }
        
        .canvthis-workspace .btn-add.added {
            background: var(--brand-primary);
            color: #000;
            border-color: var(--brand-primary);
        }

        /* Pagination */
        .canvthis-workspace .pagination { display: flex; justify-content: center; gap: 20px; align-items: center; margin-top: auto; padding-top: 20px;}
        .canvthis-workspace .page-btn { background: rgba(255,255,255,0.05); color: #fff; border: 1px solid var(--border-color); padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 600; transition: 0.2s;}
        .canvthis-workspace .page-btn:hover:not(:disabled) { border-color: var(--brand-primary); background: rgba(255,255,255,0.1);}
        .canvthis-workspace .page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

        /* Right Cart Panel */
        .canvthis-workspace .cart-panel {
            width: 400px;
            background: var(--bg-panel);
            backdrop-filter: blur(20px);
            border-left: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            z-index: 10;
            align-self: flex-start;
        }

        .canvthis-workspace .cart-header {
            padding: 30px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .canvthis-workspace .cart-items {
            flex: 1;
            overflow-y: auto;
            padding: 25px;
        }

        .canvthis-workspace .cart-item {
            background: rgba(0,0,0,0.2);
            border: 1px solid var(--border-color);
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 12px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .canvthis-workspace .item-name { font-size: 0.85rem; color: #fff; flex: 1; margin-right: 12px; line-height: 1.4; font-weight: 600;}
        .canvthis-workspace .item-price { color: var(--text-main); font-weight: 700; font-size: 0.95rem;}
        .canvthis-workspace .item-remove { color: #ef4444; cursor: pointer; margin-left: 12px; font-size: 1.2rem; opacity: 0.6; transition: 0.2s;}
        .canvthis-workspace .item-remove:hover { opacity: 1; }

        /* MARKETING MYSTERY SPINNER */
        .canvthis-workspace .discount-engine {
            background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(50, 179, 138, 0.05) 100%);
            border-top: 1px solid var(--border-color);
            border-bottom: 1px solid var(--border-color);
            padding: 30px 25px;
            text-align: center;
            transition: all 0.3s;
        }
        
        .canvthis-workspace .engine-title { font-size: 1rem; color: #fff; font-weight: 700; margin-bottom: 8px; display: flex; justify-content: center; align-items: center; gap: 8px;}
        .canvthis-workspace .engine-title i { color: var(--brand-primary); font-size: 1.2rem; }
        .canvthis-workspace .tier-indicator { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px;}
        .canvthis-workspace .tier-highlight { color: var(--brand-light); font-weight: 700; }
        .canvthis-workspace .tier-upgrade-alert { color: var(--alert); font-weight: 700; font-size: 0.85rem; margin-bottom: 15px; animation: cv-pulse 2s infinite; display: none;}
        
        @keyframes cv-pulse {
            0% { opacity: 0.7; }
            50% { opacity: 1; text-shadow: 0 0 10px rgba(251, 191, 36, 0.5); }
            100% { opacity: 0.7; }
        }
        
        .canvthis-workspace .spin-btn {
            width: 100%;
            background: linear-gradient(135deg, var(--brand-primary), #208b68);
            color: #fff;
            border: none;
            padding: 16px;
            font-size: 1rem;
            font-weight: 800;
            cursor: pointer;
            border-radius: 12px;
            transition: all 0.3s;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
            box-shadow: 0 4px 15px rgba(50, 179, 138, 0.3);
        }
        
        .canvthis-workspace .spin-btn:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(50, 179, 138, 0.5);
            background: linear-gradient(135deg, var(--brand-light), var(--brand-primary));
        }
        
        .canvthis-workspace .spin-btn:disabled {
            background: rgba(255,255,255,0.05);
            color: var(--text-muted);
            box-shadow: none;
            cursor: not-allowed;
        }

        .canvthis-workspace .spinning-container {
            display: none;
            padding: 15px 0;
            background: rgba(0,0,0,0.3);
            border-radius: 12px;
            border: 1px solid var(--border-color);
            margin-bottom: 10px;
        }

        .canvthis-workspace .spin-numbers { 
            font-size: 2.5rem; 
            font-weight: 800; 
            color: var(--text-main); 
            letter-spacing: 2px;
            filter: blur(1px);
        }

        .canvthis-workspace .discount-result-box {
            display: none;
            background: rgba(50, 179, 138, 0.1);
            border: 1px solid var(--brand-primary);
            padding: 20px;
            border-radius: 12px;
            margin-top: 10px;
            animation: cv-popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        @keyframes cv-popIn {
            0% { transform: scale(0.9); opacity: 0; }
            100% { transform: scale(1); opacity: 1; }
        }

        .canvthis-workspace .result-text { font-size: 2.2rem; color: var(--brand-light); font-weight: 800; line-height: 1.1;}
        .canvthis-workspace .result-label { font-size: 0.85rem; color: #fff; font-weight: 600; margin-top: 5px;}

        /* Totals */
        .canvthis-workspace .checkout-zone { padding: 30px; }
        .canvthis-workspace .tot-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 0.95rem; color: var(--text-muted); font-weight: 500;}
        .canvthis-workspace .tot-discount { color: var(--brand-light); display: none; font-weight: 600; }
        .canvthis-workspace .tot-final { font-size: 1.8rem; color: #fff; font-weight: 800; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-color); }
        
        .canvthis-workspace .checkout-btn {
            width: 100%;
            background: #fff;
            color: #000;
            border: none;
            padding: 18px;
            font-size: 1.05rem;
            font-weight: 800;
            cursor: pointer;
            border-radius: 12px;
            margin-top: 25px;
            transition: 0.3s;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
        }
        .canvthis-workspace .checkout-btn:hover { background: var(--brand-primary); color: #fff;}
        .canvthis-workspace .checkout-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .canvthis-workspace .checkout-btn:disabled:hover { background: #fff; color: #000; }

        .canvthis-workspace .delivery-note { color: #ef4444; font-size: 0.8rem; line-height: 1.5; margin-top: 16px; text-align: center; font-weight: 600; }
        .canvthis-workspace .consent-label { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; font-size: 0.8rem; color: var(--text-muted); cursor: pointer; line-height: 1.5; }
        .canvthis-workspace .consent-label input[type="checkbox"] { margin-top: 2px; width: 15px; height: 15px; accent-color: var(--brand-primary); cursor: pointer; flex-shrink: 0; }
        .canvthis-workspace .consent-label a { color: var(--brand-light); text-decoration: underline; }
        .canvthis-workspace .consent-label a:hover { color: var(--brand-primary); }

        .canvthis-workspace .modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; z-index: 999999; padding: 20px; }
        .canvthis-workspace .modal-box { background-color: var(--panel-bg, #14161a); border: 1px solid var(--border-color); border-radius: 12px; max-width: 700px; width: 100%; max-height: 80vh; display: flex; flex-direction: column; }
        .canvthis-workspace .modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 25px; border-bottom: 1px solid var(--border-color); }
        .canvthis-workspace .modal-header h2 { margin: 0; border-bottom: none; padding-bottom: 0; font-size: 18px; color: #fff; }
        .canvthis-workspace .modal-close { background: none; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; line-height: 1; padding: 0; }
        .canvthis-workspace .modal-close:hover { color: #fff; }
        .canvthis-workspace .modal-body { padding: 20px 25px; overflow-y: auto; color: var(--text-muted); font-size: 13px; line-height: 1.65; }
        .canvthis-workspace .modal-body h3 { color: #fff; font-size: 15px; margin: 0 0 14px 0; }
        .canvthis-workspace .modal-body h4 { color: var(--brand-light); font-size: 13px; margin: 18px 0 6px 0; }
        .canvthis-workspace .modal-body p { margin: 0 0 10px 0; }
        .canvthis-workspace .modal-body a { color: var(--brand-light); }

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

        /* Laptops: narrow the side panels so the product grid keeps room for more
           than one column. */
        @media (max-width: 1366px) {
            .canvthis-workspace .sidebar { width: 244px; padding: 26px 16px; }
            .canvthis-workspace .cart-panel { width: 344px; }
            .canvthis-workspace .workspace { padding: 30px 30px; }
            .canvthis-workspace .cart-header,
            .canvthis-workspace .checkout-zone { padding: 24px; }
        }

        /* Tablet and below: stack the three panels; the category list becomes a
           horizontal scroll strip. */
        @media (max-width: 960px) {
            .canvthis-workspace { flex-direction: column; align-items: stretch; background-image: none; }

            /* Stacked full-width panels don't need the glass blur, which is costly
               on phones — make them solid instead. */
            .canvthis-workspace .sidebar,
            .canvthis-workspace .cart-panel {
                backdrop-filter: none;
                background: #111827;
            }

            .canvthis-workspace .sidebar {
                width: auto;
                align-self: stretch;
                border-right: none;
                border-bottom: 1px solid var(--border-color);
                padding: 18px 20px;
            }
            .canvthis-workspace .brand { margin-bottom: 14px; }
            .canvthis-workspace .brand-logo { max-width: 150px; }
            .canvthis-workspace .category-label { margin-bottom: 10px; }
            .canvthis-workspace #category-filters {
                display: flex;
                flex-direction: row;
                flex-wrap: nowrap;
                gap: 8px;
                overflow-x: auto;
                padding-bottom: 6px;
                -webkit-overflow-scrolling: touch;
            }
            .canvthis-workspace .nav-link {
                flex: 0 0 auto;
                white-space: nowrap;
                margin-bottom: 0;
                gap: 8px;
                border: 1px solid var(--border-color);
            }
            .canvthis-workspace .nav-link:hover,
            .canvthis-workspace .nav-link.active {
                border-left: 1px solid var(--brand-primary);
                border-color: var(--brand-primary);
            }

            .canvthis-workspace .workspace {
                flex: none;
                width: auto;
                overflow: visible;
                padding: 26px 24px;
            }

            .canvthis-workspace .cart-panel {
                width: auto;
                align-self: stretch;
                border-left: none;
                border-top: 1px solid var(--border-color);
            }
        }

        /* Phones. */
        @media (max-width: 600px) {
            .canvthis-workspace .workspace { padding: 20px 15px; }
            .canvthis-workspace .top-bar {
                flex-direction: column;
                align-items: stretch;
                gap: 14px;
                margin-bottom: 22px;
            }
            .canvthis-workspace .search-box { width: 100%; }
            .canvthis-workspace .view-title { font-size: 1.4rem; }
            .canvthis-workspace .grid { grid-template-columns: 1fr; gap: 14px; }
            .canvthis-workspace .card { padding: 18px; }

            .canvthis-workspace .pagination { gap: 12px; padding-top: 14px; }
            .canvthis-workspace .page-btn { padding: 9px 14px; }

            .canvthis-workspace .cart-header { padding: 20px; }
            .canvthis-workspace .cart-items { padding: 16px; }
            .canvthis-workspace .discount-engine { padding: 24px 16px; }
            .canvthis-workspace .checkout-zone { padding: 22px 16px; }

            .canvthis-workspace .spin-numbers { font-size: 2rem; }
            .canvthis-workspace .result-text { font-size: 1.7rem; }
            .canvthis-workspace .tot-final { font-size: 1.5rem; }
            .canvthis-workspace .checkout-btn { padding: 16px; font-size: 1rem; }

            .canvthis-workspace .modal-overlay { padding: 10px; }
            .canvthis-workspace .modal-header { padding: 14px 16px; }
            .canvthis-workspace .modal-body { padding: 16px; }
        }
