/* ═══════════════════════════════════════════════════════════════════════
   HYDROMATE CONFIGURATOR CSS v8 — Native Mobile-First
   ═══════════════════════════════════════════════════════════════════════ */
:root {
    --brand-navy:     #141c2b;
    --brand-sky:      #72BFE3;
    --brand-aqua:     #98E2E5;
    --brand-lime:     #B5D345;
    --bg:             #f8fafc;
    --surface:        #ffffff;
    --border:         #e2e8f0;
    --border-light:   #f1f5f9;
    --text:           #0f172a;
    --muted:          #64748b;
    --muted-light:    #94a3b8;
    --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06); --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12); --shadow-brand: 0 4px 20px rgba(20,28,43,0.18);
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
html, body, button, input, select, textarea {
    font-family: "Alexandria", "Cairo", -apple-system, BlinkMacSystemFont, sans-serif;
}
i[class*="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
}
html, body { height: 100%; overflow: hidden; }
body { display: flex; flex-direction: column; height: 100dvh; background: var(--bg); color: var(--text); }

/* HEADER */
.cfg-header { height: 52px; min-height: 52px; flex-shrink: 0; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 14px; z-index: 100; }
.cfg-back-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; font-weight: 700; color: var(--brand-navy); text-decoration: none; padding: 5px 10px; background: var(--border-light); border-radius: var(--radius-full); transition: background 0.2s; }
.cfg-back-btn:hover { background: var(--border); }
.cfg-logo img { height: 26px; width: auto; display: block; object-fit: contain; }
.cfg-header-right { display: flex; align-items: center; gap: 8px; }
.cfg-price { font-size: 0.95rem; font-weight: 800; color: var(--text); }
.cfg-cart-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: var(--brand-navy); color: #fff; border: none; border-radius: var(--radius-full); font-size: 1rem; cursor: pointer; transition: transform 0.2s, background 0.2s; }
.cfg-cart-btn:hover { background: #000; transform: scale(1.06); }
.cfg-cart-badge { position: absolute; top: -4px; right: -4px; background: #f97316; color: #fff; font-size: 0.62rem; font-weight: 900; min-width: 18px; height: 18px; border-radius: var(--radius-full); display: inline-flex; align-items: center; justify-content: center; padding: 0 3px; border: 2px solid var(--surface); }

/* MAIN LAYOUT */
.cfg-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }

/* CANVAS */
.canvas-section {
    height: 48vh;
    min-height: 250px;
    flex-shrink: 0;
    position: relative;
    background: radial-gradient(ellipse at 50% 40%, #eef3f8 0%, #dde4ed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: height 0.35s var(--ease-spring);
}
.canvas-section canvas,
#canvas-container canvas {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    outline: none !important;
    touch-action: none;
}
.canvas-face-badge {
    display: none !important;
}
.face-pulse-dot {
    display: none !important;
}
.canvas-expand-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-navy);
    font-size: 0.85rem;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s var(--ease-spring);
}
.canvas-expand-btn:hover {
    background: #fff;
    transform: scale(1.08);
}
.canvas-pills {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 3px 4px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    z-index: 20;
}
.cpill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--brand-navy);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s var(--ease-spring);
}
.cpill:hover {
    background: rgba(20, 28, 43, 0.06);
}
.cpill.active {
    background: var(--brand-navy);
    color: #fff;
    box-shadow: 0 2px 8px rgba(20, 28, 43, 0.2);
}
.cpill.active i {
    color: var(--brand-sky);
}
.canvas-hint {
    display: none;
}
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(248, 250, 252, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 50;
}
.loading-overlay p {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}
.cfg-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--brand-navy);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* CONTROLS PANEL */
.controls-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    position: relative;
    transition: max-height 0.35s var(--ease-spring), flex 0.35s var(--ease-spring);
}
.sheet-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0 2px;
    cursor: pointer;
}
.sheet-drag-handle .handle-bar {
    width: 38px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 99px;
    transition: background 0.2s;
}
.sheet-drag-handle:hover .handle-bar {
    background: #94a3b8;
}
.cfg-progress-row {
    height: 54px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 10px;
    border-bottom: 1px solid var(--border-light);
    background: var(--surface);
}
.step-dots-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.step-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 700;
    border: 1px solid var(--border);
    background: var(--border-light);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.25s var(--ease-spring);
    flex-shrink: 0;
}
.step-pill:hover:not(.active) {
    background: #e2e8f0;
    color: var(--text);
}
.step-pill.active {
    background: var(--brand-navy);
    color: #fff;
    border-color: var(--brand-navy);
    box-shadow: 0 2px 8px rgba(20, 28, 43, 0.18);
}
.step-pill.completed {
    background: #e0f2fe;
    color: #0284c7;
    border-color: #bae6fd;
}
.step-num {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    background: rgba(0, 0, 0, 0.06);
}
.step-pill.active .step-num {
    background: var(--brand-sky);
    color: var(--brand-navy);
}
.step-pill.completed .step-num {
    background: #0284c7;
    color: #fff;
}
.step-name {
    font-size: 0.73rem;
    letter-spacing: -0.2px;
}
@media (max-width: 600px) {
    .step-pill:not(.active) .step-name {
        display: none;
    }
    .step-pill:not(.active) {
        padding: 4px;
        border-radius: 50%;
    }
    .step-pill:not(.active) .step-num {
        margin: 0;
    }
}
/* UNIFIED SLEEK TAB NAVIGATION */
.cfg-tabs-nav {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-bottom: 1px solid #cbd5e1;
    padding: 4px 6px;
    gap: 4px;
    flex-shrink: 0;
}
.cfg-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 38px;
    padding: 0 4px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s var(--ease-spring);
    font-family: inherit;
    white-space: nowrap;
}
.cfg-tab-text-short {
    display: none;
}
.cfg-tab-text-full {
    display: inline;
}
.cfg-tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.6);
    color: #0f172a;
}
.cfg-tab-btn.active {
    background: #ffffff;
    color: var(--brand-navy, #0f172a);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    font-weight: 800;
}
.cfg-tab-btn i {
    font-size: 0.78rem;
}
.cfg-tab-btn.active i {
    color: #0284c7;
}
@media (max-width: 480px) {
    .cfg-tabs-nav {
        padding: 3px 4px;
        gap: 2px;
    }
    .cfg-tab-btn {
        font-size: 0.68rem;
        padding: 0 2px;
        gap: 3px;
        height: 36px;
    }
    .cfg-tab-btn i {
        font-size: 0.72rem;
    }
}

/* SINGLE UNIFIED CTA BOTTOM BAR (IN-FLOW FLEX ITEM - NO OVERLAPPING) */
.cfg-bottom-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.04);
    z-index: 10;
}
.cfg-bottom-action-btn {
    width: 100%;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--brand-navy, #0f172a);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s var(--ease-spring);
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
}
.cfg-bottom-action-btn:hover {
    background: #000000;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.24);
}
.cfg-bottom-action-btn:active {
    transform: scale(0.98);
}
.cfg-bottom-action-btn i {
    font-size: 0.82rem;
    transition: transform 0.2s;
}
.cfg-bottom-action-btn:hover i {
    transform: translateX(-3px);
}

.steps-container { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 18px 14px 24px; }
.steps-container::-webkit-scrollbar { display: none; }
.step-heading { margin-bottom: 18px; }
.step-heading h3 { font-size: 1.15rem; font-weight: 800; color: var(--text); margin-bottom: 4px; letter-spacing: -0.3px; }
.step-heading p { font-size: 0.82rem; color: var(--muted); line-height: 1.45; }

/* STEP 1: COLORS */
.color-swatches { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.swatch { width: 46px; height: 46px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: all 0.2s var(--ease-spring); position: relative; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.swatch-check { color: #fff; font-size: 15px; font-weight: bold; display: none; }
.swatch[data-color="#ffffff"] .swatch-check { color: #111; }
.swatch.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand-navy); transform: scale(1.1); }
.swatch.active .swatch-check { display: block; }
.swatch:hover:not(.active):not(.out-of-stock) { transform: scale(1.06); }
.swatch.out-of-stock {
    opacity: 0.45;
    filter: grayscale(0.2) contrast(0.9);
    cursor: not-allowed;
    border: 2px dashed rgba(100, 116, 139, 0.6);
    box-shadow: none !important;
    overflow: hidden;
}
.swatch.out-of-stock:hover {
    transform: none !important;
    opacity: 0.52;
}
.swatch.out-of-stock.swatch-shake {
    animation: swatchShake 0.35s ease-in-out;
}
@keyframes swatchShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}
.swatch-x-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    color: #475569;
    filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.95)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
    pointer-events: none;
    z-index: 2;
}
.selected-color-name-badge { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.color-dot-indicator { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,0.12); flex-shrink: 0; }
.selected-color-name { font-weight: 700; font-size: 0.9rem; }
.stock-status-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; background: #d1fae5; color: #065f46; border-radius: var(--radius-full); font-size: 0.72rem; font-weight: 700; }
.stock-status-pill.out-of-stock { background: #fee2e2; color: #b91c1c; }

/* STEP 2: TYPE CARDS */
.type-cards-list { display: flex; flex-direction: column; gap: 10px; }
.type-card { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; background: #f8fafc; border: 2px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; text-align: right; transition: all 0.22s var(--ease-spring); }
.type-card:hover { border-color: #94a3b8; background: #f1f5f9; transform: translateY(-1px); }
.type-card.active { background: var(--surface); border-color: var(--brand-navy); box-shadow: 0 0 0 3px rgba(20,28,43,0.07), var(--shadow-md); }
.type-card--featured { border-color: var(--brand-navy); background: linear-gradient(135deg, #f8fafc 0%, #f0f9ff 100%); }
.type-card--featured.active { background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); }
.type-card-badge { position: absolute; top: -10px; right: 16px; background: linear-gradient(135deg, #f97316, #ef4444); color: #fff; font-size: 0.68rem; font-weight: 800; padding: 2px 10px; border-radius: var(--radius-full); box-shadow: 0 2px 8px rgba(249,115,22,0.35); letter-spacing: 0.3px; }
.type-card-icon-wrap { width: 52px; height: 52px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; transition: all 0.22s var(--ease-spring); }
.type-card-icon-wrap.text-icon { background: #e0f2fe; color: #0284c7; }
.type-card-icon-wrap.graphic-icon { background: #f3e8ff; color: #9333ea; }
.type-card-icon-wrap.mixed-icon { background: #fef3c7; color: #d97706; }
.type-card.active .type-card-icon-wrap.text-icon { background: var(--brand-navy); color: var(--brand-sky); }
.type-card.active .type-card-icon-wrap.graphic-icon { background: var(--brand-navy); color: var(--brand-aqua); }
.type-card.active .type-card-icon-wrap.mixed-icon { background: var(--brand-navy); color: var(--brand-lime); }
.type-card-body { flex: 1; text-align: right; }
.type-card-body h4 { font-size: 0.95rem; font-weight: 800; color: var(--text); margin-bottom: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.type-card-body span { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }
.type-card-tag { display: inline-block; font-size: 0.65rem; font-weight: 700; padding: 1px 7px; background: var(--brand-navy); color: #fff; border-radius: var(--radius-full); vertical-align: middle; letter-spacing: 0.3px; }
.type-card-check { width: 24px; height: 24px; border-radius: 50%; background: var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; color: transparent; flex-shrink: 0; transition: all 0.2s; }
.type-card.active .type-card-check { background: var(--brand-navy); color: #fff; }

/* FORM FIELDS */
.cfg-field { margin-bottom: 18px; }
.cfg-label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.cfg-field textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-md); font-size: 16px; font-weight: 600; color: var(--text); background: #fafafa; resize: none; line-height: 1.5; font-family: inherit; transition: border-color 0.2s, box-shadow 0.2s; -webkit-appearance: none; }
.cfg-field textarea:focus { outline: none; border-color: var(--brand-navy); background: var(--surface); box-shadow: 0 0 0 3px rgba(20,28,43,0.07); }

/* SEGMENTED CONTROL */
.seg-ctrl { display: grid; grid-template-columns: 1fr 1fr; background: var(--border-light); padding: 3px; border-radius: var(--radius-md); gap: 3px; }
.seg-ctrl--3 { grid-template-columns: 1fr 1fr 1fr; }
.seg-btn { padding: 9px 8px; background: transparent; border: none; border-radius: 9px; font-size: 0.82rem; font-weight: 700; color: var(--muted); cursor: pointer; transition: all 0.2s var(--ease-spring); white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 4px; }
.seg-btn:hover:not(.active) { color: var(--text); }
.seg-btn.active { background: var(--surface); color: var(--brand-navy); box-shadow: var(--shadow-sm); font-weight: 800; }

/* FONT CHIPS & LANGUAGE PILLS */
.font-lang-pills { display: flex; gap: 4px; background: var(--bg-soft, #f1f5f9); padding: 2px; border-radius: 20px; border: 1px solid var(--border); }
.font-lang-pill { padding: 3px 10px; font-size: 0.68rem; font-weight: 700; color: var(--muted); background: transparent; border: none; border-radius: 16px; cursor: pointer; transition: all 0.2s ease; }
.font-lang-pill:hover { color: var(--text); }
.font-lang-pill.active { background: var(--brand-navy, #0f172a); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }

/* LUXURY FONT STUDIO CARDS */
.font-chips-scroll {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-height: 290px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 2px 8px 2px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 640px) {
    .font-chips-scroll {
        grid-template-columns: repeat(3, 1fr);
    }
}

.font-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #ffffff;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: var(--radius-md, 14px);
    padding: 10px 14px 12px 14px;
    cursor: pointer;
    text-align: center;
    transition: all 0.22s var(--ease-spring);
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    min-height: 104px;
    width: 100%;
}

.font-card:hover {
    border-color: #94a3b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.font-card.active {
    border-color: var(--brand-navy, #0f172a);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.15), 0 6px 16px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
}

.font-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 2px;
}

.font-card-tag {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    transition: all 0.2s ease;
}

.font-card.active .font-card-tag {
    background: #e2e8f0;
    color: #0f172a;
    font-weight: 800;
}

.font-card-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e2e8f0;
    color: transparent;
    font-size: 0.7rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.font-card.active .font-card-check {
    background: var(--brand-navy, #0f172a);
    color: #ffffff;
}

.font-card-preview {
    font-size: 2.15rem;
    color: #0f172a;
    line-height: 1.35;
    margin: 4px 0 2px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    flex: 1;
    transition: font-size 0.15s ease;
}

.font-card.active .font-card-preview {
    color: #0f172a;
    font-weight: bold;
}

.font-card-footer {
    display: none !important;
}

.font-card-name,
.font-card-sub {
    display: none !important;
}

/* SLIDERS */
.slider-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.slider-badge { display: inline-flex; align-items: center; padding: 2px 10px; background: var(--brand-navy); color: var(--brand-sky); font-size: 0.75rem; font-weight: 800; border-radius: var(--radius-full); min-width: 48px; justify-content: center; }
.custom-slider { width: 100%; height: 6px; -webkit-appearance: none; appearance: none; background: var(--border); border-radius: 6px; outline: none; cursor: pointer; }
.custom-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-navy); cursor: pointer; border: 3px solid var(--surface); box-shadow: 0 2px 8px rgba(20,28,43,0.25); transition: transform 0.15s; }
.custom-slider:active::-webkit-slider-thumb { transform: scale(1.15); }
.custom-slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-navy); cursor: pointer; border: 3px solid var(--surface); }

/* ENGRAVING TABS */
.engraving-tabs { display: grid; background: var(--border-light); padding: 3px; border-radius: var(--radius-md); gap: 3px; margin-bottom: 16px; }
.engraving-tabs.three-tabs { grid-template-columns: 1fr 1fr 1fr; }
.engraving-tabs.two-tabs { grid-template-columns: 1fr 1fr; }
.tab-btn { padding: 9px 8px; background: transparent; border: none; border-radius: 9px; font-weight: 700; font-size: 0.82rem; color: var(--muted); cursor: pointer; transition: all 0.2s; white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; }
.tab-btn.active { background: var(--surface); color: var(--brand-navy); box-shadow: var(--shadow-sm); font-weight: 800; }
.control-group { margin-bottom: 16px; }

/* LAYOUT CARDS */
.layout-arrangement-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.layout-card { display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f8fafc; border: 2px solid var(--border); border-radius: var(--radius-md); padding: 12px 8px; cursor: pointer; transition: all 0.22s; text-align: center; position: relative; user-select: none; }
.layout-card:hover { border-color: #94a3b8; background: #f1f5f9; transform: translateY(-1px); }
.layout-card.active { border-color: var(--brand-navy); background: var(--surface); box-shadow: var(--shadow-md); }
.layout-visual-diagram { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 64px; height: 64px; background: #f1f5f9; border-radius: var(--radius-sm); border: 1.5px dashed #cbd5e1; margin-bottom: 7px; padding: 4px; transition: all 0.2s; }
.layout-card.active .layout-visual-diagram { background: #f8fafc; border-color: var(--brand-navy); border-style: solid; }
.layout-visual-diagram.is-horizontal-flow { flex-direction: row; width: 80px; height: 44px; padding: 3px 5px; gap: 5px; }
.layout-visual-diagram.is-horizontal-flow .diagram-graphic-box { width: 24px; height: 24px; flex-shrink: 0; }
.layout-visual-diagram.is-horizontal-flow .diagram-text-box { flex: 1; height: 22px; font-size: 0.58rem; padding: 0 3px; }
.diagram-graphic-box { display: flex; align-items: center; justify-content: center; width: 100%; height: 24px; color: #64748b; }
.layout-card.active .diagram-graphic-box { color: var(--brand-navy); }
.diagram-text-box { display: flex; align-items: center; justify-content: center; width: 100%; height: 16px; background: #e2e8f0; border-radius: 3px; font-size: 0.6rem; font-weight: 800; color: #475569; }
.layout-card.active .diagram-text-box { background: var(--brand-navy); color: #fff; }
.layout-info { display: flex; flex-direction: column; gap: 2px; }
.layout-title { font-size: 0.82rem; font-weight: 700; color: #1e293b; }
.layout-sub { font-size: 0.7rem; color: var(--muted); }
.layout-check { position: absolute; top: 6px; right: 7px; font-size: 0.75rem; font-weight: 800; color: var(--brand-navy); opacity: 0; transition: opacity 0.2s; }
.layout-card.active .layout-check { opacity: 1; }

/* GALLERY SEARCH & CATEGORIES */
.gallery-search-wrap {
    position: relative;
    margin-bottom: 12px;
}

.gallery-search-wrap i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.85rem;
    pointer-events: none;
}

#gallery-search-input,
#modal-gallery-search-input {
    width: 100%;
    padding: 10px 38px 10px 14px;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 10px;
    font-size: 0.82rem;
    font-family: inherit;
    background: #ffffff;
    color: #0f172a;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

#gallery-search-input:focus,
#modal-gallery-search-input:focus {
    border-color: var(--brand-navy, #0f172a);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.gallery-categories {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 8px 2px;
    margin-bottom: 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.gallery-categories::-webkit-scrollbar { display: none; }

.cat-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 800;
    color: #334155;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    user-select: none;
}

.cat-card:hover {
    border-color: #0f172a;
    color: #0f172a;
    background: #f8fafc;
    transform: translateY(-1px);
}

.cat-card.active {
    background: var(--brand-navy, #0f172a);
    color: #ffffff;
    border-color: var(--brand-navy, #0f172a);
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.22);
}

.cat-card-icon {
    font-size: 1.05rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

/* ICON GALLERY GRID */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
}

.icon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.icon-card:hover {
    border-color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
}

.icon-card.active {
    border-color: var(--brand-navy, #0f172a);
    background: #ffffff;
    box-shadow: 0 0 0 2.5px var(--brand-navy, #0f172a), 0 6px 18px rgba(15, 23, 42, 0.15);
}

.icon-svg-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
    background: #ffffff;
    flex: 1 1 auto;
    overflow: hidden;
}

.icon-card:hover .icon-svg-wrap img {
    transform: scale(1.06);
}

.icon-svg-wrap img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.14));
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.icon-card-label {
    width: 100%;
    padding: 6px 5px 7px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #334155;
    text-align: center;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    line-height: 1.25;
    flex-shrink: 0;
    transition: all 0.2s;
}

.icon-card.active .icon-card-label {
    background: var(--brand-navy, #0f172a);
    color: #ffffff;
    font-weight: 800;
    border-top-color: var(--brand-navy, #0f172a);
}

.gallery-empty-state {
    grid-column: 1 / -1;
    padding: 30px 16px;
    text-align: center;
    color: #94a3b8;
}

.gallery-empty-state i {
    font-size: 2rem;
    margin-bottom: 8px;
    opacity: 0.6;
}

.gallery-empty-state p {
    font-size: 0.88rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 4px;
}

.gallery-empty-state span {
    font-size: 0.75rem;
}

/* UPLOAD */
.upload-dropzone { border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 28px 16px; text-align: center; background: #fafafa; cursor: pointer; transition: all 0.2s; margin-bottom: 12px; }
.upload-dropzone:hover { border-color: var(--brand-navy); background: #f0f9ff; }
.upload-icon { font-size: 2rem; margin-bottom: 8px; color: var(--muted); }
.upload-dropzone p { font-size: 0.88rem; margin-bottom: 4px; }
.upload-hint { font-size: 0.73rem; color: var(--muted); }
.upload-preview-card { padding: 12px; background: #f9fafb; border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 12px; }
.preview-info { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.preview-header-row { display: flex; align-items: center; justify-content: space-between; }
.preview-label { font-size: 0.78rem; font-weight: 700; color: var(--text); }
.detected-badge { font-size: 0.7rem; font-weight: 700; padding: 2px 7px; background: #e0f2fe; color: #0369a1; border-radius: 6px; border: 1px solid #bae6fd; white-space: nowrap; transition: all 0.2s; }
.detected-badge.mode-photo { background: #fdf4ff; color: #9333ea; border-color: #f0abfc; }
.detected-badge.mode-logo { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.preview-thumb-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#laser-preview-canvas { background: #0f172a; border-radius: 7px; width: 70px; height: 70px; border: 1.5px solid var(--border); flex-shrink: 0; }
.preview-actions { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.mode-switch-group { display: inline-flex; background: #f1f5f9; border: 1.5px solid #cbd5e1; padding: 2px; border-radius: 7px; gap: 2px; }
.btn-mode-toggle { background: transparent; border: none; padding: 4px 7px; font-size: 0.7rem; font-weight: 700; color: #475569; border-radius: 5px; cursor: pointer; transition: all 0.15s; }
.btn-mode-toggle.active { background: var(--surface); color: var(--brand-navy); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.btn-invert-laser { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); padding: 6px 8px; border-radius: 6px; font-weight: 700; font-size: 0.72rem; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 3px; }
.btn-invert-laser.active { background: var(--brand-navy); color: var(--surface); border-color: var(--brand-navy); }
.btn-remove { background: #fee2e2; color: #ef4444; border: none; padding: 6px 8px; border-radius: 6px; font-size: 0.85rem; cursor: pointer; transition: all 0.2s; }
.btn-remove:hover { background: #fecaca; }

/* SIZE CALIBRATION */
.size-calibration-card { background: var(--border-light); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; margin-top: 4px; }
.calibration-title { display: flex; align-items: center; gap: 7px; font-size: 0.82rem; font-weight: 800; color: var(--text); margin-bottom: 14px; }
.calibration-title i { color: var(--muted); }

/* STEP 5: REVIEW */
.unified-preview-banner { width: 100%; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 16px; background: #0f172a; min-height: 120px; display: flex; align-items: center; justify-content: center; }
.unified-preview-banner img { width: 100%; height: auto; display: block; max-height: 200px; object-fit: contain; }
.custom-terms-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 16px; }
.terms-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.terms-label input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; accent-color: var(--brand-navy); }
.terms-label span { font-size: 0.78rem; color: #166534; line-height: 1.5; }
.review-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.review-item { display: flex; justify-content: space-between; align-items: center; padding: 11px 16px; font-size: 0.85rem; }
.review-item + .review-item { border-top: 1px solid var(--border-light); }
.review-title { font-weight: 600; color: var(--muted); }
.review-val { font-weight: 700; color: var(--text); text-align: left; }
.review-divider { height: 1px; background: var(--border); margin: 0 16px; }
.review-item.total { padding: 14px 16px; }
.review-item.total .review-title { font-weight: 800; color: var(--text); font-size: 0.9rem; }
.review-item.total .review-val { font-weight: 900; font-size: 1.05rem; color: var(--brand-navy); }

/* CART DRAWER */
.cart-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.65); backdrop-filter: blur(6px); z-index: 99998; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.cart-backdrop.active { opacity: 1; visibility: visible; }
.cart-drawer { position: fixed; top: 0; left: 0; bottom: 0; width: 100%; max-width: 440px; background: var(--surface); box-shadow: 4px 0 30px rgba(0,0,0,0.2); z-index: 99999; display: flex; flex-direction: column; transform: translateX(-100%); transition: transform 0.35s var(--ease-spring); direction: rtl; }
.cart-drawer.active { transform: translateX(0); }
.cart-drawer-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); background: var(--border-light); }
.cart-drawer-header h3 { margin: 0; font-size: 1.05rem; font-weight: 800; color: var(--text); }
.cart-close-btn { background: none; border: none; font-size: 1.7rem; cursor: pointer; color: var(--muted); line-height: 1; }
.cart-close-btn:hover { color: var(--text); }
.cart-drawer-body { flex: 1; overflow-y: auto; padding: 16px; background: var(--border-light); }
.cart-empty-state { text-align: center; padding: 50px 16px; color: var(--muted); }
.empty-cart-icon { font-size: 3rem; margin-bottom: 10px; }
.cart-item-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.cart-item-main { display: flex; gap: 12px; margin-bottom: 10px; }
.cart-item-thumb { width: 72px; height: 72px; border-radius: var(--radius-md); background: #f1f5f9; border: 1px solid #cbd5e1; overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-title { font-size: 0.9rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.cart-item-color-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.74rem; color: #475569; background: #f1f5f9; padding: 1px 7px; border-radius: var(--radius-full); margin-bottom: 5px; }
.color-dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.1); }
.cart-item-engraving-desc { font-size: 0.74rem; color: var(--muted); line-height: 1.4; }
.cart-item-price-row { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px dashed var(--border); }
.cart-item-price { font-size: 1rem; font-weight: 800; color: var(--text); }
.cart-item-stepper { display: flex; align-items: center; gap: 6px; background: #f1f5f9; border-radius: 7px; padding: 2px 5px; }
.qty-btn { background: none; border: none; font-weight: 800; font-size: 0.95rem; cursor: pointer; color: #334155; padding: 0 3px; }
.qty-val { font-weight: 700; font-size: 0.85rem; min-width: 16px; text-align: center; }
.cart-item-remove-btn { background: none; border: none; cursor: pointer; font-size: 0.9rem; opacity: 0.6; transition: opacity 0.2s; }
.cart-item-remove-btn:hover { opacity: 1; }
.cart-drawer-footer { padding: 16px 18px; background: var(--surface); border-top: 1px solid var(--border); }
.cart-phone-box { margin-bottom: 14px; }
.cart-phone-box label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.phone-input-wrap { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: #fafafa; }
.phone-flag { padding: 10px; font-size: 1.1rem; border-left: 1px solid var(--border); background: var(--border-light); }
.phone-input-wrap input { flex: 1; padding: 10px 12px; border: none; background: transparent; font-size: 0.9rem; outline: none; font-family: inherit; }
.phone-err-msg { font-size: 0.75rem; color: #ef4444; margin-top: 5px; font-weight: 600; }
.cart-total-row { display: flex; justify-content: space-between; align-items: center; font-size: 1.05rem; font-weight: 800; color: var(--text); margin-bottom: 12px; }
.cart-actions-row { display: flex; flex-direction: column; gap: 8px; }
.btn-cart-primary { width: 100%; padding: 14px; background: var(--brand-navy); color: #fff; border: none; border-radius: var(--radius-md); font-size: 0.95rem; font-weight: 800; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-cart-primary:hover { background: #000; transform: translateY(-1px); }
.btn-cart-secondary { width: 100%; padding: 11px; background: var(--border-light); color: #334155; border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.btn-cart-secondary:hover { background: var(--border); }

/* MODALS */
.processing-fullscreen-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.97); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; z-index: 999999; text-align: center; padding: 20px; }
.processing-spinner { width: 44px; height: 44px; border: 4px solid var(--border); border-top-color: var(--brand-navy); border-radius: 50%; animation: spin 0.8s linear infinite; }
.dialog-modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.65); backdrop-filter: blur(6px); z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog-modal-card { background: var(--surface); border-radius: 20px; padding: 28px 22px; width: 100%; max-width: 380px; text-align: center; box-shadow: var(--shadow-lg); }
.dialog-modal-icon { font-size: 2.5rem; margin-bottom: 12px; }
.dialog-modal-icon.blue-icon { color: #0284c7; }
.dialog-modal-icon.amber-icon { color: #d97706; }
.dialog-modal-card h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 10px; color: var(--text); }
.dialog-modal-card p { font-size: 0.84rem; color: var(--muted); line-height: 1.55; margin-bottom: 18px; }
.dialog-btn-primary { width: 100%; padding: 13px; background: var(--brand-navy); color: #fff; border: none; border-radius: var(--radius-md); font-size: 0.9rem; font-weight: 800; cursor: pointer; transition: all 0.2s; }
.dialog-btn-primary.dark { background: #1e293b; }
.dialog-btn-primary:hover { background: #000; }
.success-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.92); width: 92%; max-width: 440px; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); z-index: 99999; opacity: 0; visibility: hidden; pointer-events: none; transition: all 0.3s var(--ease-spring); text-align: center; direction: rtl; max-height: 86dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain; }
.success-modal::-webkit-scrollbar { width: 5px; }
.success-modal::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 999px; }
.success-modal::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
.success-modal::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.success-modal.active { display: block !important; opacity: 1 !important; visibility: visible !important; pointer-events: auto !important; transform: translate(-50%, -50%) scale(1) !important; }
.success-modal-content { padding: 26px 20px; touch-action: pan-y; }
.success-icon { font-size: 3rem; margin-bottom: 12px; }
.success-modal-content h3 { font-size: 1.3rem; font-weight: 900; color: var(--text); margin-bottom: 8px; }
.success-status-pill { display: inline-block; background: #d1fae5; color: #065f46; font-size: 0.78rem; font-weight: 700; padding: 4px 12px; border-radius: var(--radius-full); margin-bottom: 10px; }
.success-order-id { font-size: 1rem; color: #0284c7; margin-bottom: 14px; font-weight: 700; }
.success-actions-col { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.btn-success-action { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px; border-radius: var(--radius-md); font-size: 0.9rem; font-weight: 800; text-decoration: none; transition: all 0.2s; }
.btn-success-action.dark { background: var(--brand-navy); color: #fff; }
.btn-success-action.whatsapp { background: #25d366; color: #fff; }
.btn-success-action:hover { transform: translateY(-1px); }
.btn-success-close { background: none; border: none; color: var(--muted); font-weight: 700; font-size: 0.85rem; cursor: pointer; padding: 8px; }


/* LEGACY COMPAT */
.slider-val-badge { display: inline-flex; align-items: center; padding: 2px 10px; background: var(--brand-navy); color: var(--brand-sky); font-size: 0.75rem; font-weight: 800; border-radius: var(--radius-full); min-width: 48px; justify-content: center; }
.control-label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.slider-row { margin-bottom: 16px; }
.slider-control-group { margin-bottom: 16px; }
.slider-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.input-group { margin-bottom: 18px; }
.input-group label { display: block; font-weight: 700; font-size: 0.82rem; margin-bottom: 8px; color: var(--text); }
.input-with-clear textarea, .input-group textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-md); font-size: 16px; font-weight: 600; color: var(--text); background: #fafafa; resize: none; line-height: 1.5; font-family: inherit; transition: border-color 0.2s, box-shadow 0.2s; -webkit-appearance: none; }
.input-with-clear textarea:focus, .input-group textarea:focus { outline: none; border-color: var(--brand-navy); background: var(--surface); box-shadow: 0 0 0 3px rgba(20,28,43,0.07); }
.toggle-pills { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.three-pills { grid-template-columns: 1fr 1fr 1fr; }
.pill-btn { padding: 10px 8px; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 4px; }
.pill-btn.active { border-color: var(--brand-navy); background: var(--brand-navy); color: #fff; }
.font-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.font-btn { padding: 10px 12px; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 0.9rem; cursor: pointer; transition: all 0.2s; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.font-btn:hover { border-color: #94a3b8; }
.font-btn.active { border-color: var(--brand-navy); background: var(--brand-navy); color: var(--brand-sky); box-shadow: var(--shadow-brand); }
.font-preview-sample { font-size: 1.1rem; line-height: 1; }
.font-name-label { font-size: 0.65rem; font-weight: 700; font-family: "Alexandria", sans-serif; }

/* COMPACT SETTINGS DOCK & LARGE 3D HERO VIEWPORT (MOBILE) */
@media (max-width: 767px) {
    .cfg-header {
        height: 44px;
        min-height: 44px;
        padding: 0 12px;
    }
    .cfg-progress-row {
        height: 38px;
        padding: 0 12px;
        gap: 8px;
    }
    .step-pill {
        padding: 2px 7px;
        font-size: 0.68rem;
    }
    .step-num {
        width: 15px;
        height: 15px;
        font-size: 0.6rem;
    }
    .cfg-step-label {
        display: inline-flex !important;
        font-size: 0.72rem;
    }
    .canvas-section {
        height: auto !important;
        min-height: 280px !important;
        flex: 1 1 0% !important;
        width: 100% !important;
        position: relative;
    }
    .controls-panel {
        height: auto !important;
        max-height: 44dvh !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        flex: 0 0 auto !important;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
        border-top: 1px solid #cbd5e1;
        background: #ffffff;
        z-index: 20;
    }
    .sheet-drag-handle {
        padding: 4px 0 2px;
    }
    .sheet-drag-handle .handle-bar {
        width: 32px;
        height: 3px;
    }
    .steps-container {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        padding: 6px 14px 4px !important;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .steps-container::-webkit-scrollbar {
        display: none;
    }
    .step-heading {
        margin-bottom: 6px !important;
    }
    .step-heading h3 {
        font-size: 0.88rem !important;
        font-weight: 800 !important;
        margin: 0 !important;
        color: #0f172a !important;
    }
    .step-heading p {
        display: none !important;
    }
    .step-sub-hint {
        display: none !important;
    }
    .adjust-specs-card {
        display: none !important;
    }

    /* Step 1 Compact Swatches */
    .color-swatches {
        gap: 8px !important;
        margin-bottom: 4px !important;
    }
    .swatch {
        width: 36px !important;
        height: 36px !important;
    }
    .selected-color-name-badge {
        padding: 3px 8px !important;
        font-size: 0.72rem !important;
        margin-top: 2px !important;
        margin-bottom: 2px !important;
    }

    /* Step 2 Compact Text & Font Fields */
    .cfg-field {
        margin-bottom: 4px !important;
    }
    .cfg-label {
        font-size: 0.7rem !important;
        margin-bottom: 2px !important;
    }
    .text-choice-pills {
        margin-bottom: 6px !important;
        padding: 2px !important;
        gap: 6px !important;
    }
    .btn-text-choice {
        height: 32px !important;
        font-size: 0.75rem !important;
        gap: 4px !important;
    }
    .btn-text-choice i {
        font-size: 0.75rem !important;
    }
    .skip-text-banner {
        padding: 8px 10px !important;
        margin-bottom: 4px !important;
        gap: 6px !important;
    }
    .stb-icon-wrap {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.88rem !important;
    }
    .stb-content strong {
        font-size: 0.72rem !important;
    }
    .stb-content span {
        display: none !important;
    }
    .stb-actions-row {
        gap: 6px !important;
    }
    .btn-stb-action {
        padding: 6px 8px !important;
        font-size: 0.7rem !important;
    }
    .btn-picker-modal-alt-upload {
        padding: 5px 8px !important;
        font-size: 0.68rem !important;
    }
    .selected-font-trigger-card {
        padding: 6px 10px !important;
        margin-bottom: 6px !important;
        border-radius: 10px !important;
    }
    .sft-name-sub strong {
        font-size: 0.76rem !important;
    }
    .sft-name-sub span {
        display: none !important;
    }
    .sft-preview {
        font-size: 1.05rem !important;
        margin: 0 4px !important;
    }
    .sft-btn {
        padding: 5px 9px !important;
        font-size: 0.7rem !important;
        border-radius: 8px !important;
    }
    #engraving-text-input {
        height: 38px !important;
        min-height: 38px !important;
        padding: 8px 12px !important;
        font-size: 0.88rem !important;
        border-radius: 9px !important;
    }

    /* Step 3 Compact Graphic Actions */
    .graphic-entry-actions {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
        margin-bottom: 4px !important;
    }
    .btn-graphic-action {
        min-height: 50px !important;
        padding: 5px 3px !important;
        border-radius: 10px !important;
    }
    .btn-graphic-action .bga-icon-wrap {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.8rem !important;
    }
    .btn-graphic-action .bga-title {
        font-size: 0.74rem !important;
    }
    .btn-graphic-action .bga-sub {
        display: none !important;
    }
    .text-only-active-banner {
        padding: 6px 10px !important;
        margin-bottom: 4px !important;
        gap: 6px !important;
    }
    .text-only-active-banner span {
        display: none !important;
    }
    .text-only-active-banner strong {
        font-size: 0.74rem !important;
    }
    .active-design-summary-card {
        padding: 5px 8px !important;
        height: 42px !important;
        box-sizing: border-box !important;
        margin-bottom: 4px !important;
    }
    .adsc-thumb {
        width: 32px !important;
        height: 32px !important;
    }
    .adsc-title {
        font-size: 0.74rem !important;
    }
    .adsc-sub {
        font-size: 0.65rem !important;
    }
    .btn-adsc-action {
        padding: 4px 8px !important;
        font-size: 0.68rem !important;
    }

    /* Step 4 Compact Adjust & Size Controls */
    .adjust-controls-grid {
        gap: 6px !important;
        margin-bottom: 4px !important;
    }
    .seg-ctrl {
        height: 32px !important;
    }
    .seg-btn {
        padding: 4px 6px !important;
        font-size: 0.7rem !important;
    }
    .size-calibration-card {
        padding: 6px 10px !important;
        margin-top: 4px !important;
        border-radius: 10px !important;
    }
    .slider-header label {
        font-size: 0.7rem !important;
    }
    .slider-badge {
        font-size: 0.68rem !important;
        padding: 1px 5px !important;
    }
    .custom-slider {
        height: 5px !important;
        margin: 4px 0 0 !important;
    }
    #adjust-graphic-slider-group {
        margin-top: 4px !important;
    }

    /* Sticky Bottom Bar */
    .cfg-bottom-bar {
        height: auto !important;
        padding: 6px 14px 8px !important;
        flex-shrink: 0 !important;
        background: #ffffff;
        border-top: 1px solid #f1f5f9;
    }
    .cfg-bottom-action-btn {
        height: 40px !important;
        font-size: 0.88rem !important;
        border-radius: 10px !important;
    }
    .cfg-bottom-prev-btn {
        height: 36px;
        padding: 0 12px;
        font-size: 0.78rem;
        border-radius: 10px;
    }
    .cfg-bottom-next-btn {
        height: 36px;
        padding: 0 14px;
        font-size: 0.82rem;
        border-radius: 10px;
    }
    /* Fullscreen 3D Toggle State */
    .cfg-main.is-expanded .canvas-section {
        height: calc(100dvh - 44px - 44px) !important;
        flex: 1 1 auto !important;
    }
    .cfg-main.is-expanded .controls-panel {
        height: 44px !important;
        max-height: 44px !important;
        flex: 0 0 44px !important;
        overflow: hidden !important;
    }
    .cfg-main.is-expanded .steps-container,
    .cfg-main.is-expanded .cfg-bottom-bar {
        display: none !important;
    }
    .cfg-main.is-expanded .canvas-expand-btn i::before {
        content: "\f066" !important; /* fa-compress */
    }
}
@media (min-width: 768px) {
    .sheet-drag-handle { display: none; }
    .canvas-expand-btn { display: none; }
    .cfg-main { flex-direction: row; }
    .canvas-section { width: 55%; height: 100%; flex-shrink: 0; border-right: 1px solid var(--border); }
    .controls-panel { width: 45%; height: 100%; border-top: none; display: flex; flex-direction: column; overflow: hidden; }
    .canvas-pills { bottom: auto; top: 16px; left: 20px; transform: none; }
    .canvas-face-badge { display: none !important; }
    .steps-container { flex: 1 1 auto; overflow-y: auto; padding: 20px 24px 24px; }
    .cfg-bottom-bar { flex-shrink: 0; padding: 12px 24px; }
    .cfg-progress-row { padding: 0 20px; }
    .cfg-header { padding: 0 24px; }
    .gallery-grid { grid-template-columns: repeat(5, 1fr); }
    .step-heading h3 { font-size: 1.25rem; }
}
@media (min-width: 1024px) {
    .canvas-section { width: 58%; }
    .controls-panel { width: 42%; }
}

/* =========================================================================
   FULLSCREEN MODAL PICKERS & COMPACT ACTIONS
   ========================================================================= */

/* =========================================================================
   STEP 2 & 3 PERSONALIZATION CHOICE PILLS (TEXT OR GRAPHIC ONLY)
   ========================================================================= */
.text-choice-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 12px;
    border: 1.5px solid #cbd5e1;
}
.btn-text-choice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 10px;
    background: transparent;
    border: none;
    border-radius: 9px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.btn-text-choice:hover {
    color: #0f172a;
}
.btn-text-choice.active {
    background: #ffffff;
    color: #0f172a;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
}
.btn-text-choice.active i {
    color: #0284c7;
}

/* Skip Text Banner (shown when "بدون كتابة (رسمة فقط)" is active) */
.skip-text-banner {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.stb-top-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.stb-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #dcfce7;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.stb-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    text-align: right;
}
.stb-content strong {
    font-size: 0.8rem;
    font-weight: 800;
    color: #15803d;
    line-height: 1.25;
}
.stb-content span {
    font-size: 0.68rem;
    color: #475569;
    line-height: 1.25;
    margin-top: 1px;
}
.stb-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}
.btn-stb-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 9px;
    padding: 7px 10px;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: all 0.2s var(--ease-spring);
}
.btn-stb-gallery {
    background: #0f172a;
    color: #ffffff;
    border: 1.5px solid #0f172a;
}
.btn-stb-gallery:hover {
    background: #1e293b;
    border-color: #1e293b;
}
.btn-stb-upload {
    background: #ffffff;
    color: #0f172a;
    border: 1.5px solid #cbd5e1;
}
.btn-stb-upload:hover {
    border-color: #0f172a;
    background: #f8fafc;
}

/* Gallery Modal Switch to Upload Button */
.picker-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-picker-modal-alt-upload {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    color: #0f172a;
    border: 1.5px solid #cbd5e1;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.74rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s var(--ease-spring);
    font-family: inherit;
}
.btn-picker-modal-alt-upload:hover {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

/* Sleek Action Buttons for Graphic Selection (3 Core Choices: بدون رسمة · مكتبة التصاميم · رفع تصميم) */
.graphic-entry-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}
.btn-graphic-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 58px;
    padding: 6px 4px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s var(--ease-spring);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    font-family: inherit;
    text-align: center;
}
.btn-graphic-action .bga-icon-wrap {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    font-size: 0.9rem;
    color: #0f172a;
    transition: all 0.2s ease;
}
.btn-graphic-action .bga-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
    white-space: nowrap;
}
.btn-graphic-action .bga-sub {
    font-size: 0.65rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1;
    white-space: nowrap;
}
.btn-graphic-action:hover {
    border-color: #0f172a;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}
.btn-graphic-action:active {
    transform: scale(0.97);
}
.btn-graphic-action.active {
    background: #0f172a;
    border-color: #0f172a;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}
.btn-graphic-action.active .bga-icon-wrap {
    background: rgba(255, 255, 255, 0.18);
    color: #38bdf8;
}
.btn-graphic-action.active .bga-title {
    color: #ffffff;
}
.btn-graphic-action.active .bga-sub {
    color: #94a3b8;
}

/* Banner when Text-Only is active */
.text-only-active-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0fdf4;
    border: 1.5px dashed #86efac;
    border-radius: 12px;
    padding: 7px 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(22, 163, 74, 0.05);
}
.text-only-active-banner i {
    font-size: 1.15rem;
    color: #16a34a;
    flex-shrink: 0;
}
.text-only-active-banner .toab-content {
    display: flex;
    flex-direction: column;
    text-align: right;
}
.text-only-active-banner .toab-content strong {
    font-size: 0.78rem;
    font-weight: 700;
    color: #14532d;
    line-height: 1.2;
}
.text-only-active-banner .toab-content span {
    font-size: 0.68rem;
    color: #166534;
    line-height: 1.2;
}

/* Active Design Summary Card */
.active-design-summary-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 12px;
    padding: 6px 10px;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.06);
}
.adsc-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 2px;
    overflow: hidden;
}
.adsc-thumb i {
    font-size: 1.1rem;
    color: #15803d;
}
.adsc-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.adsc-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.adsc-sub {
    font-size: 0.68rem;
    color: #15803d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.adsc-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.btn-adsc-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.2s;
}
.btn-adsc-change {
    background: #0f172a;
    color: #ffffff;
}
.btn-adsc-change:hover {
    background: #000000;
}
.btn-adsc-remove {
    background: #fee2e2;
    color: #dc2626;
}
.btn-adsc-remove:hover {
    background: #fecaca;
}

/* Upload Controls Row */
.upload-controls-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px 10px;
    margin-bottom: 8px;
}
.upload-controls-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: space-between;
}

/* Text Controls Grid (Direction & Valign in one line) */
.text-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 8px;
    margin-bottom: 8px;
}

/* Streamlined Selected Font Trigger Card */
.selected-font-trigger-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s var(--ease-spring);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.selected-font-trigger-card:hover {
    border-color: var(--brand-navy, #0f172a);
    background: #f8fafc;
    transform: translateY(-1px);
}
.sft-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.sft-font-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: #fef3c7;
    color: #d97706;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.sft-name-sub {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex-shrink: 0;
}
.sft-name-sub strong {
    font-size: 0.78rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}
.sft-name-sub span {
    font-size: 0.65rem;
    color: #64748b;
}
.sft-preview {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    padding: 0 4px;
}
.sft-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--brand-navy, #0f172a);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 5px 9px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
}
.sft-btn:hover {
    background: #000000;
}

/* Selected Gallery Trigger Hero Card */
.selected-gallery-trigger-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.25s var(--ease-spring);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.selected-gallery-trigger-card:hover {
    border-color: #0284c7;
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.12);
    transform: translateY(-1px);
}
.sgt-thumb-wrap {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 6px;
    color: #64748b;
    font-size: 1.3rem;
}
.sgt-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sgt-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sgt-tag {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    background: #e0f2fe;
    color: #0369a1;
}
.sgt-indicator {
    font-size: 0.65rem;
    color: #64748b;
}
.sgt-name {
    font-size: 0.85rem;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sgt-sub {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* FULLSCREEN MODAL CORE */
.fullscreen-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.fullscreen-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.fullscreen-picker-modal {
    position: fixed;
    z-index: 1000001;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    direction: rtl;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

/* Mobile: Bottom Sheet full height */
@media (max-width: 767px) {
    .fullscreen-picker-modal {
        bottom: 0;
        left: 0;
        right: 0;
        height: 92dvh;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
    }
    .fullscreen-picker-modal.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* Desktop: Centered Floating Studio */
@media (min-width: 768px) {
    .fullscreen-picker-modal {
        top: 50%;
        left: 50%;
        width: 90%;
        max-width: 820px;
        height: 86vh;
        border-radius: 22px;
        transform: translate(-50%, -46%) scale(0.96);
    }
    .fullscreen-picker-modal.active {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Modal Header */
.picker-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    flex-shrink: 0;
}
.picker-modal-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
}
.picker-modal-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.picker-modal-header-main h3 {
    font-size: 1.1rem;
    font-weight: 900;
    color: #0f172a;
    margin: 0;
}
.picker-modal-header-main p {
    font-size: 0.75rem;
    color: #64748b;
    margin: 2px 0 0;
}
.picker-modal-close {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.picker-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Modal Sticky Bar */
.picker-modal-sticky-bar {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}
.picker-modal-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    padding: 6px 14px;
    transition: all 0.2s;
}
.picker-modal-input-wrap:focus-within {
    border-color: var(--brand-navy, #0f172a);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}
.picker-modal-input-wrap i {
    color: #64748b;
    font-size: 0.95rem;
}
.picker-modal-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.92rem;
    font-weight: 600;
    color: #0f172a;
    font-family: inherit;
}
.modal-lang-auto-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.2s;
}
.modal-lang-auto-badge.is-english {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.picker-modal-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.picker-modal-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 4px 12px;
    flex: 1;
    min-width: 140px;
    max-width: 240px;
}
.picker-modal-search-wrap input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.78rem;
    font-family: inherit;
    width: 100%;
}
.picker-modal-search-wrap i {
    color: #94a3b8;
    font-size: 0.75rem;
}

/* Modal Body */
.picker-modal-body {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 16px;
    background: #f8fafc;
    -webkit-overflow-scrolling: touch;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.modal-font-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
@media (min-width: 640px) {
    .modal-font-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }
}

@media (max-width: 639px) {
    .font-card {
        padding: 8px 10px 10px 10px;
        min-height: 94px;
        border-radius: 12px;
    }
    .font-card-preview {
        font-size: 1.85rem;
        min-height: 46px;
    }
    .font-card-tag {
        font-size: 0.65rem;
        padding: 1.5px 6px;
        max-width: 110px;
    }
}

.modal-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}
@media (min-width: 540px) {
    .modal-gallery-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
    }
}
@media (min-width: 768px) {
    .modal-gallery-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 14px;
    }
}
@media (min-width: 1024px) {
    .modal-gallery-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 14px;
    }
}

/* Modal Footer */
.picker-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    flex-shrink: 0;
}
.picker-modal-footer-selection {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.picker-modal-footer-selection .footer-label {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 600;
}
.picker-modal-footer-selection .footer-val {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
}
.btn-confirm-picker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--brand-navy, #0f172a);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 11px 22px;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-confirm-picker:hover {
    background: #000000;
    transform: translateY(-1px);
}

@media (max-width: 639px) {
    .picker-modal-header {
        padding: 12px 14px;
    }
    .picker-modal-sticky-bar {
        padding: 10px 14px;
        gap: 8px;
    }
    .picker-modal-footer {
        padding: 10px 14px;
        gap: 8px;
    }
    .btn-confirm-picker {
        padding: 9px 16px;
        font-size: 0.82rem;
    }
    .picker-modal-footer-selection .footer-val {
        font-size: 0.84rem;
    }
}

/* Quick Direct Add to Cart from Text Step */
.btn-text-direct-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    height: 38px;
    margin-top: 10px;
    background: #f8fafc;
    border: 1.5px dashed #cbd5e1;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-text-direct-cart:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
}
.btn-text-direct-cart i {
    font-size: 0.85rem;
}

/* =========================================================================
   INTERACTIVE 3D LIGHTING & MATERIAL STUDIO PANEL
   ========================================================================= */
.canvas-lighting-btn {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 25;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.canvas-lighting-btn:hover {
    background: #ffffff;
    color: #f59e0b;
    transform: scale(1.06);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.22);
}
.canvas-lighting-btn i {
    font-size: 1rem;
}

.lighting-studio-panel {
    position: absolute;
    top: 60px;
    left: 14px;
    z-index: 45;
    width: 320px;
    max-width: calc(100vw - 28px);
    max-height: calc(100% - 80px);
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: lspFadeIn 0.25s ease-out;
}
@keyframes lspFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.lsp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.lsp-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #ffffff;
}
.lsp-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}
.lsp-close:hover {
    color: #ffffff;
}

.lsp-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
}
.lsp-tab-btn {
    flex: 1;
    padding: 6px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    font-family: inherit;
}
.lsp-tab-btn.active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.lsp-content {
    padding: 12px 14px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.lsp-pane {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lsp-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.lsp-row label {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 700;
    color: #cbd5e1;
}
.lsp-row label span {
    font-size: 0.75rem;
    color: #fbbf24;
    font-family: monospace;
    font-weight: 800;
}
.lsp-slider {
    width: 100%;
    accent-color: #f59e0b;
    height: 4px;
    cursor: pointer;
}
.lsp-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

.lsp-footer {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
}
.lsp-btn-reset, .lsp-btn-copy {
    flex: 1;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    border: none;
}
.lsp-btn-reset {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}
.lsp-btn-reset:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}
.lsp-btn-copy {
    background: #f59e0b;
    color: #0f172a;
}
.lsp-btn-copy:hover {
    background: #d97706;
}

/* =========================================================================
   STEP 4: LAYOUT & ADJUSTMENTS (التنسيق والضبط) & SUB-HINTS
   ========================================================================= */
.adjust-specs-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 8px 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.asc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}
.asc-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    flex-shrink: 0;
}
.asc-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.asc-text small {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 700;
    line-height: 1.1;
}
.asc-text strong {
    font-size: 0.75rem;
    color: #0f172a;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.asc-divider {
    width: 1px;
    height: 22px;
    background: #e2e8f0;
    margin: 0 6px;
    flex-shrink: 0;
}
.adjust-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 6px;
}
.step-sub-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
    color: #64748b;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-top: 8px;
    margin-bottom: 0;
    line-height: 1.35;
}
.step-sub-hint i {
    color: #0284c7;
    font-size: 0.82rem;
    flex-shrink: 0;
}
