/* ═══════════════════════════════════════════════════════
   Squiggle Card Designer v8 — Elegant feminine redesign
   Contextual bottom panel, warm cream/rose/gold palette.
   Mobile-first, HTML overlays for interaction,
   Fabric.js only for print export.
   ═══════════════════════════════════════════════════════ */

:root {
    /* Palette */
    --sq-cream:      #FDFAF8;
    --sq-blush:      #F9F0EE;
    --sq-rose:       #E8B4B8;
    --sq-rose-dark:  #C8956C;
    --sq-gold:       #C9A96E;
    --sq-warm-dark:  #2C1810;
    --sq-warm-mid:   #8B6F6A;
    --sq-warm-light: #D4B8B5;
    --sq-white:      #FFFFFF;
    --sq-editor-bg:  #F5EDE8;

    /* Typography */
    --sq-font: "Poppins", -apple-system, sans-serif;
    --sq-font-display: "Playfair Display", serif;

    /* Radii */
    --sq-radius-lg: 20px;
    --sq-radius:    12px;
    --sq-radius-sm: 8px;
    --sq-radius-xs: 6px;

    /* Shadows */
    --sq-shadow-card: 0 8px 40px rgba(44,24,16,0.15);
    --sq-shadow-float: 0 4px 24px rgba(44,24,16,0.12);
    --sq-shadow-sm: 0 2px 8px rgba(44,24,16,0.08);
}

/* ── Reset & wrapper ──────────────────────────────────── */
#squiggle-designer-wrap {
    font-family: var(--sq-font);
    color: var(--sq-warm-dark);
    line-height: 1.5;
    max-width: 1200px;
    margin: 20px auto;
    -webkit-font-smoothing: antialiased;
}

#squiggle-designer-wrap *,
#squiggle-designer-wrap *::before,
#squiggle-designer-wrap *::after {
    box-sizing: border-box;
}


/* ═══════════════════════════════════════════════════════
   Template Picker
   ═══════════════════════════════════════════════════════ */

.sq-picker {
    background: var(--sq-cream);
    padding: 32px 16px;
}

.sq-picker-header {
    text-align: center;
    margin-bottom: 32px;
}

.sq-picker-header h2 {
    font-family: var(--sq-font-display);
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--sq-warm-dark);
}

.sq-picker-header p {
    font-size: 14px;
    color: var(--sq-warm-mid);
    margin: 0;
}

/* (old size picker pills removed in v9 — now uses .sq-size-screen) */

/* ── Template grid ────────────────────────────────────── */
.sq-template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 0;
}

/* ── Template Card ────────────────────────────────────── */
.sq-tmpl-card {
    position: relative;
    background: var(--sq-white);
    border-radius: var(--sq-radius);
    box-shadow: var(--sq-shadow-sm);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    border: 2px solid transparent;
}

.sq-tmpl-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sq-shadow-float);
    border-color: var(--sq-rose);
}

.sq-tmpl-card:active {
    transform: translateY(-1px);
}

/* CTA pill on hover */
.sq-tmpl-card::after {
    content: 'Choose this design';
    position: absolute;
    bottom: 52px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--sq-rose-dark);
    color: var(--sq-white);
    font-family: var(--sq-font);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 6;
}

.sq-tmpl-card:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Preview (ratio set inline via JS based on card size) */
.sq-tmpl-preview {
    position: relative;
    width: 100%;
    padding-top: 141.89%;  /* fallback, overridden by inline style */
    background: var(--sq-white);
    overflow: hidden;
}

.sq-tmpl-inner {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}

/* Photo zone in picker */
.sq-prev-photo {
    position: absolute;
    background: var(--sq-blush);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sq-prev-photo::after {
    content: '';
    width: 24px;
    height: 24px;
    background: var(--sq-warm-light);
    border-radius: 50%;
    opacity: 0.5;
}

/* Text zone in picker */
.sq-prev-text {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: italic;
    color: var(--sq-warm-mid);
    font-size: 10px;
    opacity: 0.6;
    text-align: center;
    padding: 2px 4px;
    line-height: 1.2;
    overflow: hidden;
}

.sq-tmpl-name {
    padding: 12px 14px;
    font-family: var(--sq-font);
    font-size: 13px;
    font-weight: 600;
    color: var(--sq-warm-dark);
    border-top: 1px solid var(--sq-blush);
    text-align: center;
}

/* Heart icon */
.sq-heart {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    border: none;
    padding: 0;
    transition: transform 0.2s ease, background 0.2s ease;
}

.sq-heart:hover {
    transform: scale(1.15);
    background: rgba(255,255,255,1);
}

.sq-heart svg {
    width: 16px;
    height: 16px;
    stroke: var(--sq-rose);
    stroke-width: 2;
    fill: none;
    transition: fill 0.2s ease;
}

.sq-heart.active svg {
    fill: var(--sq-rose);
}

/* Badge */
.sq-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--sq-gold);
    color: var(--sq-white);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* "Design Your Own" blank card */
.sq-blank-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 3px dashed var(--sq-warm-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: border-color 0.2s ease;
}

.sq-tmpl-card:hover .sq-blank-circle {
    border-color: var(--sq-rose-dark);
}

.sq-blank-circle svg {
    width: 32px;
    height: 32px;
    opacity: 0.5;
    stroke: var(--sq-warm-mid);
}

.sq-blank-circle span {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sq-warm-mid);
}


/* ═══════════════════════════════════════════════════════
   Editor — Mobile-first (full-screen overlay)
   ═══════════════════════════════════════════════════════ */

.sq-editor-wrap {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    background: var(--sq-editor-bg);
    overflow: hidden;
}

/* ── Top bar (56px) ──────────────────────────────────── */
.sq-topbar {
    display: flex;
    align-items: center;
    height: 56px;
    min-height: 56px;
    padding: 0 12px;
    background: var(--sq-white);
    border-bottom: 1px solid var(--sq-warm-light);
    gap: 8px;
    position: relative;
    z-index: 10;
}

.sq-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--sq-warm-mid);
    font-family: var(--sq-font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--sq-radius-sm);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.sq-back-btn:hover {
    color: var(--sq-warm-dark);
    background: var(--sq-blush);
}

.sq-back-btn svg {
    stroke: currentColor;
}

.sq-topbar-title {
    flex: 1;
    font-family: var(--sq-font-display);
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    color: var(--sq-warm-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sq-topbar-actions {
    display: flex;
    gap: 8px;
}

.sq-preview-btn,
.sq-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 20px;
    font-family: var(--sq-font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    white-space: nowrap;
}

.sq-preview-btn:active,
.sq-cart-btn:active {
    transform: scale(0.97);
}

.sq-preview-btn {
    background: transparent;
    color: var(--sq-warm-mid);
    border: 1px solid var(--sq-warm-light);
}

.sq-preview-btn:hover {
    background: var(--sq-blush);
    color: var(--sq-warm-dark);
}

.sq-cart-btn {
    background: var(--sq-gold);
    color: var(--sq-white);
}

.sq-cart-btn:hover {
    background: #b8984f;
}

/* ── Card area (flex: 1, fills middle) ────────────────── */
.sq-card-area {
    flex: 1;
    background: var(--sq-editor-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    overflow: hidden;
    min-height: 0;
}

.sq-card {
    position: relative;
    width: 100%;
    /* max-width set inline by JS based on selected card size */
    max-height: calc(100vh - 56px - 220px);
    background: #fff;
    box-shadow: var(--sq-shadow-card);
    border-radius: 4px;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

/* Aspect ratio set inline by JS via padding-top */
.sq-card-sizer {
    padding-top: 141.89%; /* fallback */
}

.sq-card-inner {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}

/* ── Zone common (photo + text) ───────────────────────── */
.sq-zone {
    position: absolute;
    transition: border-color 0.15s ease;
}

/* Selected zone highlight */
.sq-zone.sq-zone-selected {
    outline: 2px solid var(--sq-rose-dark);
    outline-offset: 1px;
}

/* Delete button on selected zone */
.sq-zone-delete {
    display: none;
    position: absolute;
    top: -11px;
    right: -11px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--sq-white);
    color: var(--sq-warm-mid);
    border: none;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-family: var(--sq-font);
    box-shadow: var(--sq-shadow-sm);
}

.sq-zone.sq-zone-selected .sq-zone-delete {
    display: flex;
}

/* ── Resize handles ───────────────────────────────────── */
.sq-resize-handle {
    display: none;
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--sq-white);
    border: 1.5px solid var(--sq-rose-dark);
    border-radius: 2px;
    z-index: 99;
}

.sq-zone.sq-zone-selected .sq-resize-handle {
    display: block;
}

.sq-handle-nw { top: -4px; left: -4px; cursor: nw-resize; }
.sq-handle-n  { top: -4px; left: 50%; margin-left: -4px; cursor: n-resize; }
.sq-handle-ne { top: -4px; right: -4px; cursor: ne-resize; }
.sq-handle-w  { top: 50%; margin-top: -4px; left: -4px; cursor: w-resize; }
.sq-handle-e  { top: 50%; margin-top: -4px; right: -4px; cursor: e-resize; }
.sq-handle-sw { bottom: -4px; left: -4px; cursor: sw-resize; }
.sq-handle-s  { bottom: -4px; left: 50%; margin-left: -4px; cursor: s-resize; }
.sq-handle-se { bottom: -4px; right: -4px; cursor: se-resize; }

/* ── Photo zones ──────────────────────────────────────── */
.sq-photo-zone {
    border: 2px dashed var(--sq-warm-light);
    border-radius: 4px;
    cursor: pointer;
    background-size: cover;
    background-position: 50% 50%;
    background-repeat: no-repeat;
    overflow: visible;
    -webkit-user-select: none;
    user-select: none;
}

.sq-photo-zone:hover {
    border-color: var(--sq-rose);
}

.sq-photo-zone.filled {
    border: none;
    cursor: grab;
}

.sq-photo-zone.filled:active {
    cursor: grabbing;
}

/* Empty state content */
.sq-photo-empty {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--sq-blush);
    pointer-events: none;
}

.sq-photo-empty svg {
    width: 24px;
    height: 24px;
    opacity: 0.5;
    stroke: var(--sq-warm-light);
}

.sq-photo-empty span {
    font-size: 11px;
    font-weight: 500;
    color: var(--sq-warm-mid);
    opacity: 0.7;
}

/* Hide empty state when filled */
.sq-photo-zone.filled .sq-photo-empty {
    display: none;
}

/* "Change ↺" button on filled photo */
.sq-photo-change {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(255,255,255,0.85);
    color: var(--sq-warm-dark);
    border: none;
    border-radius: 20px;
    padding: 4px 12px;
    font-family: var(--sq-font);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.sq-photo-zone.filled:hover .sq-photo-change {
    opacity: 1;
}

/* ── Text zones ───────────────────────────────────────── */
.sq-text-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    cursor: move;
    border: 1.5px solid transparent;
    border-radius: 4px;
    transition: border-color 0.15s ease;
}

.sq-text-zone textarea {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    overflow: hidden;
    font-family: inherit;
    color: inherit;
    text-align: center;
    padding: 2px 4px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    cursor: text;
}

.sq-text-zone textarea::placeholder {
    color: var(--sq-warm-mid);
    opacity: 0.4;
    font-style: italic;
}

/* Subtle focus ring */
.sq-text-zone textarea:focus {
    box-shadow: none;
}

.sq-text-zone.sq-zone-selected {
    outline: none;
    border-color: var(--sq-rose);
}

.sq-text-zone.sq-zone-selected .sq-resize-handle {
    display: block;
}

.sq-text-zone.sq-zone-selected .sq-zone-delete {
    display: flex;
}


/* ═══════════════════════════════════════════════════════
   Bottom Panel — Contextual (220px on mobile)
   ═══════════════════════════════════════════════════════ */

.sq-bottom-panel {
    background: var(--sq-white);
    height: 220px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    border-radius: var(--sq-radius-lg) var(--sq-radius-lg) 0 0;
    box-shadow: 0 -4px 20px rgba(44,24,16,0.08);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Context label pill */
.sq-context-label {
    display: inline-block;
    font-family: var(--sq-font);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sq-rose-dark);
    background: var(--sq-blush);
    padding: 3px 10px;
    border-radius: 20px;
    margin: 12px 14px 8px;
    align-self: flex-start;
}

/* Panel content areas */
.sq-panel-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 14px 14px;
}

/* ── Default panel (background + gallery) ─────────────── */
.sq-section-title {
    font-family: var(--sq-font);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--sq-warm-mid);
    margin: 0 0 8px;
}

/* Colour swatches */
.sq-color-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.sq-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--sq-warm-light);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    padding: 0;
    outline: none;
    min-width: 28px;
    min-height: 28px;
}

.sq-swatch:hover {
    transform: scale(1.2);
}

.sq-swatch.active {
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--sq-white), 0 0 0 4px var(--sq-rose-dark);
}

/* Rainbow custom picker swatch */
.sq-swatch-custom {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    border: 2px dashed var(--sq-warm-light) !important;
    background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red) !important;
    transition: transform 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.sq-swatch-custom:hover {
    transform: scale(1.2);
    border-color: var(--sq-rose-dark) !important;
}

/* Add text button (default panel) */
.sq-add-text-default-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 20px;
    font-family: var(--sq-font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1.5px solid var(--sq-warm-light);
    background: var(--sq-white);
    color: var(--sq-warm-dark);
    margin-bottom: 12px;
}

.sq-add-text-default-btn:hover {
    border-color: var(--sq-rose);
    background: var(--sq-blush);
}

.sq-add-text-default-btn:active {
    transform: scale(0.97);
}

/* Gallery section */
.sq-gallery-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--sq-radius);
    font-family: var(--sq-font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 2px dashed var(--sq-warm-light);
    background: var(--sq-blush);
    color: var(--sq-warm-mid);
    transition: all 0.15s ease;
    min-height: 48px;
}

.sq-gallery-add-btn:hover {
    border-color: var(--sq-rose);
    color: var(--sq-rose-dark);
    background: var(--sq-white);
}

.sq-gallery-add-btn:active {
    transform: scale(0.97);
}

.sq-gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 8px;
    -webkit-overflow-scrolling: touch;
}

.sq-gallery-thumb {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: var(--sq-radius-sm);
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border: 2px solid var(--sq-warm-light);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.sq-gallery-thumb:hover {
    border-color: var(--sq-rose);
    transform: scale(1.05);
}

.sq-gallery-thumb.active {
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--sq-white), 0 0 0 4px var(--sq-rose-dark);
}

/* ── Photo panel ──────────────────────────────────────── */
.sq-photo-actions-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.sq-pill-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 20px;
    font-family: var(--sq-font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1.5px solid var(--sq-warm-light);
    background: var(--sq-white);
    color: var(--sq-warm-dark);
}

.sq-pill-btn:hover {
    border-color: var(--sq-rose);
    background: var(--sq-blush);
}

.sq-pill-btn:active {
    transform: scale(0.97);
}

.sq-add-more-photos-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--sq-font);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1px dashed var(--sq-warm-light);
    background: transparent;
    color: var(--sq-warm-mid);
    transition: all 0.15s ease;
    margin-top: 6px;
}

.sq-add-more-photos-btn:hover {
    border-color: var(--sq-rose);
    color: var(--sq-rose-dark);
}

/* ── Text panel ───────────────────────────────────────── */
.sq-text-controls-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.sq-font-select {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1.5px solid var(--sq-warm-light);
    border-radius: var(--sq-radius-sm);
    font-family: var(--sq-font);
    font-size: 13px;
    color: var(--sq-warm-dark);
    background: var(--sq-white);
    cursor: pointer;
    outline: none;
    min-height: 40px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238B6F6A' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.sq-font-select:focus {
    border-color: var(--sq-rose);
}

/* Size stepper */
.sq-size-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--sq-warm-light);
    border-radius: var(--sq-radius-sm);
    overflow: hidden;
    height: 40px;
}

.sq-size-step-btn {
    width: 36px;
    height: 100%;
    border: none;
    background: var(--sq-blush);
    color: var(--sq-warm-dark);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-family: var(--sq-font);
}

.sq-size-step-btn:hover {
    background: var(--sq-warm-light);
}

.sq-size-step-btn:active {
    transform: scale(0.97);
}

.sq-size-display {
    width: 36px;
    text-align: center;
    font-family: var(--sq-font);
    font-size: 13px;
    font-weight: 600;
    color: var(--sq-warm-dark);
    background: var(--sq-white);
    border: none;
    border-left: 1px solid var(--sq-warm-light);
    border-right: 1px solid var(--sq-warm-light);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Format buttons */
.sq-format-row {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-bottom: 8px;
}

.sq-fmt-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--sq-warm-light);
    border-radius: var(--sq-radius-xs);
    background: var(--sq-white);
    color: var(--sq-warm-dark);
    font-family: var(--sq-font);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
}

.sq-fmt-btn:hover {
    background: var(--sq-blush);
}

.sq-fmt-btn:active {
    transform: scale(0.97);
}

.sq-fmt-btn.active {
    background: var(--sq-warm-dark);
    color: var(--sq-white);
    border-color: var(--sq-warm-dark);
}

.sq-fmt-btn svg {
    width: 14px;
    height: 14px;
}

.sq-fmt-spacer {
    width: 8px;
}

/* Text colour row */
.sq-text-color-row {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.sq-text-color-row .sq-swatch {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
}

.sq-text-color-row .sq-swatch-custom {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
}

/* Text panel action row (z-order, add, delete) */
.sq-text-actions-row {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.sq-text-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-family: var(--sq-font);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid var(--sq-warm-light);
    background: var(--sq-white);
    color: var(--sq-warm-mid);
    white-space: nowrap;
}

.sq-text-action-btn:hover {
    border-color: var(--sq-rose);
    color: var(--sq-warm-dark);
    background: var(--sq-blush);
}

.sq-text-action-btn:active {
    transform: scale(0.97);
}

.sq-text-action-btn.sq-delete-btn {
    border-color: var(--sq-rose);
    color: var(--sq-rose-dark);
}

.sq-text-action-btn.sq-delete-btn:hover {
    background: var(--sq-rose);
    color: var(--sq-white);
}


/* ═══════════════════════════════════════════════════════
   Preview Modal
   ═══════════════════════════════════════════════════════ */

.sq-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(44,24,16,0.5);
    backdrop-filter: blur(6px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sq-modal.visible {
    display: flex;
}

.sq-modal-content {
    background: var(--sq-white);
    border-radius: var(--sq-radius-lg);
    padding: 24px;
    max-width: 600px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(44,24,16,0.25);
}

.sq-modal-content h3 {
    margin: 0 0 16px;
    font-family: var(--sq-font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--sq-warm-dark);
}

.sq-modal-content img {
    width: 100%;
    border-radius: var(--sq-radius);
    display: block;
}

.sq-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 28px;
    cursor: pointer;
    color: var(--sq-warm-mid);
    line-height: 1;
    background: none;
    border: none;
    font-family: var(--sq-font);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sq-modal-close:hover {
    color: var(--sq-warm-dark);
}

/* Loading spinner on export */
.sq-exporting .sq-cart-btn,
.sq-exporting .sq-preview-btn {
    opacity: 0.6;
    pointer-events: none;
}


/* ═══════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════ */

/* Mobile: 2 columns */
@media (max-width: 600px) {
    .sq-template-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 4px;
    }
}

/* Tablet: 3 columns */
@media (min-width: 601px) and (max-width: 900px) {
    .sq-template-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* Desktop: 4 columns */
@media (min-width: 901px) {
    .sq-template-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ── Small mobile adjustments ─────────────────────────── */
@media (max-width: 768px) {
    .sq-topbar-title {
        font-size: 14px;
    }

    .sq-preview-btn span {
        display: none;
    }
}

/* Landscape phone — shorter bottom panel */
@media (max-height: 500px) and (orientation: landscape) {
    .sq-bottom-panel {
        height: 170px;
        min-height: 170px;
    }

    .sq-card {
        max-height: calc(100vh - 56px - 170px);
    }
}


/* ═══════════════════════════════════════════════════════
   Desktop (>768px) — inline editor, not fixed overlay
   ═══════════════════════════════════════════════════════ */

@media (min-width: 769px) {
    .sq-editor-wrap {
        position: relative;
        inset: auto;
        z-index: auto;
        border-radius: var(--sq-radius-lg);
        overflow: visible;
        max-width: 900px;
        margin: 0 auto;
    }

    .sq-topbar {
        border-radius: var(--sq-radius-lg) var(--sq-radius-lg) 0 0;
    }

    .sq-card-area {
        background: var(--sq-white);
        padding: 24px 16px;
        min-height: 300px;
    }

    .sq-card {
        max-width: 420px;
        max-height: none;
    }

    .sq-bottom-panel {
        height: auto;
        min-height: auto;
        border-radius: 0 0 var(--sq-radius-lg) var(--sq-radius-lg);
        box-shadow: none;
        border-top: 1px solid var(--sq-warm-light);
    }

    .sq-panel-content {
        padding: 16px 20px;
        overflow: visible;
    }

    /* On desktop, show all sections stacked */
    .sq-context-label {
        display: none;
    }

    .sq-desktop-section {
        margin-bottom: 16px;
        padding-bottom: 16px;
        border-bottom: 1px solid var(--sq-blush);
    }

    .sq-desktop-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .sq-desktop-section-title {
        font-family: var(--sq-font);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        color: var(--sq-warm-mid);
        margin: 0 0 8px;
    }

    .sq-text-color-row .sq-swatch {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
    }

    .sq-text-color-row .sq-swatch-custom {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
    }

    .sq-fmt-btn {
        width: 40px;
        height: 40px;
    }

    .sq-fmt-btn svg {
        width: 16px;
        height: 16px;
    }
}


/* ═══════════════════════════════════════════════════════
   v8 Additions
   ═══════════════════════════════════════════════════════ */

/* ── Undo/Redo buttons in topbar ──────────────────────── */
.sq-undo-redo { display: flex; gap: 2px; }
.sq-undo-btn, .sq-redo-btn {
    background: none; border: none; color: var(--sq-warm-mid);
    font-size: 16px; cursor: pointer; padding: 6px 8px;
    border-radius: var(--sq-radius-sm); transition: all 0.15s ease;
    display: inline-flex; align-items: center; gap: 3px;
    font-family: var(--sq-font); font-size: 11px; font-weight: 500;
}
.sq-undo-btn:hover, .sq-redo-btn:hover { background: var(--sq-blush); color: var(--sq-warm-dark); }
.sq-undo-btn:disabled, .sq-redo-btn:disabled { opacity: 0.3; cursor: default; }
.sq-undo-btn:disabled:hover, .sq-redo-btn:disabled:hover { background: none; color: var(--sq-warm-mid); }

/* ── Sticker zone ─────────────────────────────────────── */
.sq-sticker-zone {
    display: flex; align-items: center; justify-content: center;
    overflow: visible; cursor: move; border: 1.5px solid transparent;
    border-radius: 4px; transition: border-color 0.15s ease;
}
.sq-sticker-zone svg { width: 100%; height: 100%; }
.sq-sticker-zone.sq-zone-selected { outline: none; border-color: var(--sq-rose); }
.sq-sticker-zone.sq-zone-selected .sq-resize-handle { display: block; }
.sq-sticker-zone.sq-zone-selected .sq-zone-delete { display: flex; }

/* ── Sticker grid in panel ────────────────────────────── */
.sq-sticker-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
    margin-bottom: 12px;
}
.sq-sticker-cell {
    width: 100%; aspect-ratio: 1; display: flex; align-items: center;
    justify-content: center; border-radius: var(--sq-radius-sm);
    border: 1.5px solid var(--sq-warm-light); background: var(--sq-white);
    cursor: pointer; transition: all 0.15s ease; padding: 6px;
}
.sq-sticker-cell:hover { transform: scale(1.1); border-color: var(--sq-rose); background: var(--sq-blush); }
.sq-sticker-cell svg { width: 100%; height: 100%; color: var(--sq-warm-dark); }

/* ── Photo filter row ─────────────────────────────────── */
.sq-filter-row {
    display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px;
    -webkit-overflow-scrolling: touch; margin-bottom: 8px;
}
.sq-filter-thumb {
    min-width: 52px; width: 52px; text-align: center; cursor: pointer;
    transition: all 0.15s ease;
}
.sq-filter-preview {
    width: 44px; height: 44px; margin: 0 auto 4px;
    border-radius: var(--sq-radius-sm); background: var(--sq-blush);
    border: 2px solid var(--sq-warm-light); background-size: cover;
    background-position: center; transition: border-color 0.15s ease;
}
.sq-filter-thumb.active .sq-filter-preview { border-color: var(--sq-rose-dark); box-shadow: 0 0 0 2px var(--sq-white), 0 0 0 4px var(--sq-rose-dark); }
.sq-filter-thumb:hover .sq-filter-preview { border-color: var(--sq-rose); }
.sq-filter-name { font-size: 10px; font-weight: 500; color: var(--sq-warm-mid); }
.sq-filter-thumb.active .sq-filter-name { color: var(--sq-rose-dark); font-weight: 600; }

/* ── Background patterns row ──────────────────────────── */
.sq-pattern-row {
    display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
}
.sq-pattern-swatch {
    width: 28px; height: 28px; border-radius: 50%;
    border: 2px solid var(--sq-warm-light); cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    padding: 0; outline: none; min-width: 28px; min-height: 28px;
    background-size: 8px 8px;
}
.sq-pattern-swatch:hover { transform: scale(1.2); }
.sq-pattern-swatch.active {
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--sq-white), 0 0 0 4px var(--sq-rose-dark);
}

/* ── Snap guide lines ─────────────────────────────────── */
.sq-guide-h, .sq-guide-v {
    position: absolute; background: var(--sq-rose); opacity: 0.7;
    z-index: 9999; pointer-events: none; display: none;
}
.sq-guide-h { left: 0; right: 0; height: 1px; }
.sq-guide-v { top: 0; bottom: 0; width: 1px; }
.sq-guide-h.visible, .sq-guide-v.visible { display: block; }

/* ── Opacity control row ──────────────────────────────── */
.sq-opacity-row {
    display: flex; align-items: center; gap: 8px; margin-top: 8px; margin-bottom: 8px;
}
.sq-opacity-label {
    font-family: var(--sq-font); font-size: 11px; font-weight: 600;
    color: var(--sq-warm-mid); white-space: nowrap;
}
.sq-opacity-slider {
    flex: 1; -webkit-appearance: none; appearance: none;
    height: 4px; border-radius: 2px; background: var(--sq-warm-light);
    outline: none;
}
.sq-opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 16px; height: 16px;
    border-radius: 50%; background: var(--sq-rose-dark); cursor: pointer;
    border: 2px solid var(--sq-white); box-shadow: var(--sq-shadow-sm);
}
.sq-opacity-slider::-moz-range-thumb {
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--sq-rose-dark); cursor: pointer;
    border: 2px solid var(--sq-white); box-shadow: var(--sq-shadow-sm);
}
.sq-opacity-val {
    font-family: var(--sq-font); font-size: 11px; font-weight: 600;
    color: var(--sq-warm-dark); min-width: 32px; text-align: right;
}

/* ── Save/Load toast ──────────────────────────────────── */
.sq-toast {
    position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
    background: var(--sq-white); border-radius: var(--sq-radius);
    box-shadow: var(--sq-shadow-float); padding: 12px 20px;
    display: flex; align-items: center; gap: 12px; z-index: 999998;
    font-family: var(--sq-font); font-size: 13px; color: var(--sq-warm-dark);
    animation: sq-toast-in 0.3s ease;
}
@keyframes sq-toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.sq-toast-btn {
    padding: 6px 14px; border-radius: 20px; font-family: var(--sq-font);
    font-size: 12px; font-weight: 600; cursor: pointer; border: none;
    transition: all 0.15s ease;
}
.sq-toast-yes { background: var(--sq-gold); color: var(--sq-white); }
.sq-toast-yes:hover { background: #b8984f; }
.sq-toast-no { background: var(--sq-blush); color: var(--sq-warm-mid); }
.sq-toast-no:hover { background: var(--sq-warm-light); }


/* ═══════════════════════════════════════════════════════
   v9 — Size Picker Screen
   ═══════════════════════════════════════════════════════ */

.sq-size-screen {
    background: var(--sq-cream);
    padding: 40px 16px 32px;
    text-align: center;
}

.sq-size-grid {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
    padding: 0 8px;
}

.sq-size-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px 16px;
    background: var(--sq-white);
    border: 2px solid var(--sq-warm-light);
    border-radius: var(--sq-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    max-width: 150px;
    flex: 1;
}

.sq-size-card:hover {
    border-color: var(--sq-rose);
    transform: translateY(-2px);
    box-shadow: var(--sq-shadow-sm);
}

.sq-size-card.active {
    border-color: var(--sq-rose-dark);
    background: var(--sq-blush);
    box-shadow: 0 0 0 3px rgba(200,149,108,0.2);
}

.sq-size-mini {
    background: var(--sq-blush);
    border-radius: 3px;
    border: 1.5px solid var(--sq-warm-light);
    transition: border-color 0.2s ease;
}

.sq-size-card.active .sq-size-mini {
    border-color: var(--sq-rose-dark);
    background: var(--sq-rose);
    opacity: 0.5;
}

.sq-size-card-label {
    font-family: var(--sq-font);
    font-size: 15px;
    font-weight: 700;
    color: var(--sq-warm-dark);
    line-height: 1.2;
}

.sq-size-card.active .sq-size-card-label {
    color: var(--sq-rose-dark);
}

.sq-size-card-sub {
    font-family: var(--sq-font);
    font-size: 11px;
    color: var(--sq-warm-mid);
    line-height: 1;
}

.sq-size-card-dims {
    font-family: var(--sq-font);
    font-size: 10px;
    color: var(--sq-warm-mid);
    opacity: 0.7;
    line-height: 1;
}

.sq-size-card-check {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--sq-rose-dark);
    color: var(--sq-white);
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
}

.sq-size-card.active .sq-size-card-check {
    display: block;
}

.sq-size-next-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 40px;
    border-radius: 30px;
    font-family: var(--sq-font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: var(--sq-gold);
    color: var(--sq-white);
    transition: all 0.15s ease;
    box-shadow: var(--sq-shadow-sm);
}

.sq-size-next-btn:hover {
    background: #b8984f;
    transform: translateY(-1px);
    box-shadow: var(--sq-shadow-float);
}

.sq-size-next-btn:active {
    transform: scale(0.97);
}

/* Mobile: 2-col size grid */
@media (max-width: 600px) {
    .sq-size-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .sq-size-card {
        max-width: none;
        min-width: 0;
    }

    /* DL is slim — let it span full width on mobile */
    .sq-size-card[data-size-id="dl"] {
        grid-column: 1 / -1;
        max-width: 200px;
        margin: 0 auto;
    }
}

/* ── Change size link in template picker ─────────────── */
.sq-change-size-link {
    display: inline-block;
    background: none;
    border: none;
    font-family: var(--sq-font);
    font-size: 12px;
    font-weight: 500;
    color: var(--sq-rose-dark);
    cursor: pointer;
    padding: 4px 8px;
    margin-top: 6px;
    transition: color 0.15s ease;
}

.sq-change-size-link:hover {
    color: var(--sq-warm-dark);
    text-decoration: underline;
}


/* ═══════════════════════════════════════════════════════
   v9 — Font Pills (mobile)
   ═══════════════════════════════════════════════════════ */

.sq-font-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 8px;
    margin-bottom: 4px;
}

.sq-font-pill {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--sq-warm-light);
    background: var(--sq-white);
    font-size: 13px;
    font-weight: 500;
    color: var(--sq-warm-dark);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.sq-font-pill:hover {
    border-color: var(--sq-rose);
    background: var(--sq-blush);
}

.sq-font-pill.active {
    border-color: var(--sq-rose-dark);
    background: var(--sq-blush);
    color: var(--sq-rose-dark);
    font-weight: 600;
}

/* Desktop: hide pills, show dropdown */
@media (min-width: 769px) {
    .sq-font-pills {
        display: none;
    }
}

/* Mobile: hide dropdown, show pills */
@media (max-width: 768px) {
    .sq-desktop-font-select {
        display: none;
    }
}


/* ═══════════════════════════════════════════════════════
   v9 — Touch Target & Panel Fixes
   ═══════════════════════════════════════════════════════ */

/* Ensure action buttons are at least 44px on mobile */
@media (max-width: 768px) {
    .sq-text-action-btn {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 12px;
    }

    .sq-pill-btn {
        min-height: 44px;
    }

    .sq-fmt-btn {
        width: 44px;
        height: 44px;
    }

    .sq-size-step-btn {
        width: 44px;
        min-width: 44px;
    }

    .sq-add-text-default-btn {
        min-height: 44px;
    }

    .sq-back-btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Bottom panel: ensure internal scroll */
    .sq-panel-content {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Desktop: remove max-width override on card */
@media (min-width: 769px) {
    .sq-card {
        max-height: none;
    }
}


/* ═══════════════════════════════════════════════════════
   v9.1 — Side Toggle (Outside / Inside)
   ═══════════════════════════════════════════════════════ */

.sq-side-toggle {
    display: flex;
    border: 1.5px solid var(--sq-warm-light);
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
}

.sq-side-btn {
    padding: 6px 16px;
    border: none;
    background: var(--sq-white);
    color: var(--sq-warm-mid);
    font-family: var(--sq-font);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.sq-side-btn.active {
    background: var(--sq-gold);
    color: var(--sq-white);
}

.sq-side-btn:not(.active):hover {
    background: var(--sq-blush);
    color: var(--sq-warm-dark);
}


/* ═══════════════════════════════════════════════════════
   v9.1 — Step Indicator
   ═══════════════════════════════════════════════════════ */

.sq-step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
    padding: 0 16px;
}

.sq-step {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sq-step-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-family: var(--sq-font);
    font-size: 12px;
    font-weight: 700;
    border: 2px solid var(--sq-warm-light);
    color: var(--sq-warm-mid);
    background: var(--sq-white);
    transition: all 0.2s ease;
}

.sq-step.active .sq-step-circle {
    background: var(--sq-gold);
    border-color: var(--sq-gold);
    color: var(--sq-white);
}

.sq-step.completed .sq-step-circle {
    background: var(--sq-warm-light);
    border-color: var(--sq-warm-light);
    color: var(--sq-white);
}

.sq-step-label {
    font-family: var(--sq-font);
    font-size: 12px;
    font-weight: 500;
    color: var(--sq-warm-mid);
}

.sq-step.active .sq-step-label {
    font-weight: 700;
    color: var(--sq-warm-dark);
}

.sq-step-line {
    width: 32px;
    height: 2px;
    background: var(--sq-warm-light);
    margin: 0 8px;
    flex-shrink: 0;
}

.sq-step-line.completed {
    background: var(--sq-warm-mid);
}

@media (max-width: 400px) {
    .sq-step-label { display: none; }
    .sq-step-line { width: 20px; margin: 0 4px; }
}


/* ═══════════════════════════════════════════════════════
   v9.1 — Arabic Font Tag
   ═══════════════════════════════════════════════════════ */

.sq-font-ar-tag {
    display: inline-block;
    font-size: 8px;
    font-weight: 700;
    background: var(--sq-rose);
    color: var(--sq-white);
    border-radius: 3px;
    padding: 1px 4px;
    margin-left: 4px;
    vertical-align: middle;
    font-family: var(--sq-font);
    letter-spacing: 0.5px;
}

/* RTL toggle button */
.sq-rtl-toggle {
    font-family: "Noto Naskh Arabic", serif !important;
    font-size: 16px !important;
}


/* ═══════════════════════════════════════════════════════
   v9.1 — Preview Modal (Both Sides)
   ═══════════════════════════════════════════════════════ */

.sq-preview-modal {
    max-width: 700px;
}

.sq-preview-modal h3 {
    text-align: center;
    margin-bottom: 20px;
}

.sq-preview-cards {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.sq-preview-card-wrap {
    flex: 1;
    text-align: center;
}

.sq-preview-label {
    display: block;
    font-family: var(--sq-font);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--sq-warm-mid);
    margin-bottom: 8px;
}

.sq-preview-zoomable {
    cursor: zoom-in;
    transition: transform 0.15s ease;
    border-radius: var(--sq-radius);
    box-shadow: var(--sq-shadow-sm);
}

.sq-preview-zoomable:hover {
    transform: scale(1.02);
}

.sq-preview-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.sq-preview-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border-radius: 20px;
    font-family: var(--sq-font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--sq-warm-light);
    background: var(--sq-white);
    color: var(--sq-warm-dark);
    transition: all 0.15s ease;
}

.sq-preview-edit-btn:hover {
    border-color: var(--sq-rose);
    background: var(--sq-blush);
}

.sq-preview-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border-radius: 20px;
    font-family: var(--sq-font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: var(--sq-gold);
    color: var(--sq-white);
    transition: all 0.15s ease;
}

.sq-preview-cart-btn:hover {
    background: #b8984f;
}

/* Zoom overlay */
.sq-zoom-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(44,24,16,0.85);
    backdrop-filter: blur(8px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: zoom-out;
}

.sq-zoom-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--sq-radius);
    box-shadow: 0 20px 80px rgba(0,0,0,0.4);
}

.sq-zoom-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 32px;
    color: var(--sq-white);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--sq-font);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile: stack preview cards vertically */
@media (max-width: 600px) {
    .sq-preview-cards {
        flex-direction: column;
    }

    .sq-side-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
}
