/* ── Engraved Sign Designer ── */

.esd-full-width .product-info-main { max-width: 100%; }

#engraved-sign-designer {
    font-family: inherit;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    box-sizing: border-box;
}

/* ── Two-column layout ── */
.esd-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.esd-panel {
    flex: 0 0 260px;
    min-width: 220px;
}

.esd-preview-panel {
    flex: 1 1 400px;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Sections ── */
.esd-section {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.esd-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #444;
    margin: 0 0 12px;
    padding: 0;
    border: none;
}

/* ── Dimensions ── */
.esd-dimensions {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.esd-dim-group { display: flex; flex-direction: column; gap: 4px; }
.esd-dim-group label { font-size: 12px; color: #666; }

.esd-dim-input {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.esd-dim-input input {
    width: 70px;
    padding: 7px 8px;
    border: none;
    font-size: 15px;
    text-align: right;
    outline: none;
    -moz-appearance: textfield;
}
.esd-dim-input input::-webkit-outer-spin-button,
.esd-dim-input input::-webkit-inner-spin-button { -webkit-appearance: none; }

.esd-unit {
    padding: 0 8px;
    font-size: 12px;
    color: #888;
    background: #f0f0f0;
    border-left: 1px solid #ddd;
    height: 100%;
    display: flex;
    align-items: center;
}

.esd-dim-x { font-size: 18px; color: #999; padding-bottom: 6px; }

/* ── Shape buttons ── */
.esd-shape-buttons {
    display: flex;
    gap: 10px;
}

.esd-shape-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    border: 2px solid #ccc;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    color: #555;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.esd-shape-btn:hover  { border-color: #888; color: #222; }
.esd-shape-btn.active { border-color: #1a7ec8; color: #1a7ec8; background: #eaf4ff; }

.esd-hole-buttons { display: flex; gap: 10px; }
.esd-hole-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    border: 2px solid #ccc;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    color: #555;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.esd-hole-btn:hover  { border-color: #888; color: #222; }
.esd-hole-btn.active { border-color: #1a7ec8; color: #1a7ec8; background: #eaf4ff; }

/* ── Colour swatches ── */
.esd-color-swatches {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.esd-color-swatch {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s;
}

.esd-color-swatch:hover  { border-color: #999; }
.esd-color-swatch.active { border-color: #1a7ec8; }

.esd-swatch-preview {
    width: 36px;
    height: 22px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.15);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.esd-swatch-label { font-size: 12px; color: #444; }

/* ── Price ── */
.esd-price-display {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.esd-price-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a7ec8;
    line-height: 1;
}

.esd-price-note  { font-size: 11px; color: #888; }
.esd-price-calc  { font-size: 14px; color: #000; margin: 6px 0 0; }

/* ── Canvas ── */
#esd-canvas-container {
    width: 100%;
    background: #e8e8e8;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

#esd-canvas {
    display: block;
    max-width: 100%;
    cursor: crosshair;
}

.esd-canvas-hint {
    font-size: 11px;
    color: #999;
    text-align: center;
    margin: -8px 0 0;
}

/* ── Text section ── */
.esd-text-section {
    margin-top: 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.esd-text-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f2f2f2;
    border-bottom: 1px solid #e0e0e0;
}

.esd-text-header .esd-section-title { margin: 0; }

.esd-add-text-btn {
    padding: 7px 14px;
    background: #1a7ec8;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}
.esd-add-text-btn:hover { background: #155fa0; }

/* ── Individual text block ── */
.esd-text-block {
    padding: 14px 16px;
    border-bottom: 1px solid #ebebeb;
    background: #fff;
    transition: background 0.1s;
}
.esd-text-block:last-child { border-bottom: none; }
.esd-text-block.selected   { background: #f0f7ff; }

.esd-tb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.esd-tb-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.esd-tb-remove {
    width: 24px;
    height: 24px;
    line-height: 22px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: #fff;
    color: #888;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}
.esd-tb-remove:hover { background: #cc3333; color: #fff; border-color: #cc3333; }

.esd-tb-text {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    box-sizing: border-box;
    margin-bottom: 10px;
    outline: none;
    transition: border-color 0.15s;
}
.esd-tb-text:focus { border-color: #1a7ec8; }

.esd-tb-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.esd-tb-font-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.esd-tb-font-pill {
    padding: 5px 11px;
    border: 2px solid #ddd;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    transition: border-color 0.12s, background 0.12s, color 0.12s;
    white-space: nowrap;
}

.esd-tb-font-pill:hover {
    border-color: #aaa;
    background: #f5f5f5;
}

.esd-tb-font-pill.active {
    border-color: #1a7ec8;
    background: #eaf4ff;
    color: #1a7ec8;
}

.esd-tb-size-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.esd-tb-size-wrap label { font-size: 12px; color: #666; }

.esd-tb-size {
    width: 90px;
    cursor: pointer;
    accent-color: #1a7ec8;
}

.esd-tb-size-val {
    min-width: 20px;
    font-size: 12px;
    color: #555;
    text-align: center;
}

/* ── Cart section ── */
.esd-cart-section {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.esd-cart-section .esd-price-section {
    flex: 1;
}

.esd-cart-section .esd-price-value {
    font-size: 1.6em;
    font-weight: 700;
}

.esd-cart-section .action.esd-submit {
    padding: 14px 40px;
    font-size: 16px;
    white-space: nowrap;
}

/* ── Loading overlay ── */
.esd-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.esd-loading-box {
    background: #fff;
    padding: 28px 36px;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    color: #333;
}

.esd-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #ddd;
    border-top-color: #1a7ec8;
    border-radius: 50%;
    animation: esd-spin 0.7s linear infinite;
    margin: 0 auto 14px;
}

@keyframes esd-spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 640px) {
    .esd-layout { flex-direction: column; }
    .esd-panel  { flex: none; width: 100%; }
    .esd-tb-controls { flex-direction: column; }
}

.esd-add-text-hint {
    font-size: 13px;
    font-weight: 700;
    color: #444;
    white-space: nowrap;
    text-transform: none;
}

.esd-dim-limits {
    margin: 4px 0 0;
    font-size: 0.78em;
    color: #888;
}
.esd-dim-warning {
    margin: 4px 0 0;
    font-size: 0.78em;
    color: #c0392b;
    font-weight: 600;
}

/* ── SVG download section ── */
.esd-svg-section {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.esd-svg-btn {
    padding: 9px 18px;
    background: #fff;
    color: #444;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.esd-svg-btn:hover {
    border-color: #1a7ec8;
    color: #1a7ec8;
    background: #f0f7ff;
}

.esd-svg-hint {
    font-size: 11px;
    color: #999;
    margin: 0;
    line-height: 1.5;
}

/* ── Hole diameter input ── */
.esd-hole-diam-wrap {
    display: none;
    
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.esd-hole-diam-wrap label {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.esd-hole-diam-wrap .esd-dim-input input {
    width: 50px;
}
