/**
 * Silenthought Sticker Calculator — CSS
 * @package Silenthought
 */

/* ── Wrapper ─────────────────────────────────── */
.st-sticker-calculator {
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    margin: 24px 0;
    background: #fff;
    font-family: inherit;
}

/* ── Header ──────────────────────────────────── */
.st-sticker-calc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    font-size: 16px;
    color: #1f2937;
}

.st-sticker-calc-badge {
    margin-left: auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: .4px;
}

/* ── Field groups ────────────────────────────── */
.st-sticker-field-group {
    margin-bottom: 20px;
}

.st-sticker-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ── Material buttons ────────────────────────── */
.st-material-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.st-material-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    transition: all .2s ease;
    text-align: center;
}

.st-material-btn:hover {
    border-color: #a78bfa;
    background: #f5f3ff;
}

.st-material-btn.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 100%);
}

.st-material-icon { font-size: 20px; }
.st-material-name { font-weight: 600; font-size: 13px; color: #1f2937; }
.st-material-price { font-size: 11px; color: #6b7280; }

/* ── Size inputs ─────────────────────────────── */
.st-size-inputs {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.st-size-field {
    flex: 1;
}

.st-size-field label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
    font-weight: 500;
}

.st-size-field small {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

.st-input-wrap {
    position: relative;
}

.st-input-wrap input {
    width: 100%;
    padding: 10px 36px 10px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .2s;
    -moz-appearance: textfield;
}

.st-input-wrap input::-webkit-outer-spin-button,
.st-input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; }

.st-input-wrap input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,.15);
}

.st-unit {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #9ca3af;
    pointer-events: none;
}

.st-size-divider {
    font-size: 20px;
    color: #9ca3af;
    padding-bottom: 14px;
}

/* ── Quantity ─────────────────────────────────── */
.st-qty-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    width: fit-content;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
}

.st-qty-dec,
.st-qty-inc {
    background: #f3f4f6;
    border: none;
    padding: 10px 16px;
    font-size: 18px;
    cursor: pointer;
    color: #374151;
    transition: background .15s;
    line-height: 1;
}

.st-qty-dec:hover,
.st-qty-inc:hover { background: #e5e7eb; }

.st-qty-wrap input {
    width: 80px;
    border: none;
    border-left: 1.5px solid #d1d5db;
    border-right: 1.5px solid #d1d5db;
    padding: 10px 8px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    -moz-appearance: textfield;
}

.st-qty-wrap input::-webkit-outer-spin-button,
.st-qty-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; }

.st-qty-wrap input:focus { outline: none; }

/* ── Breakdown panel ─────────────────────────── */
.st-sticker-breakdown {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1.5px solid #c4b5fd;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.st-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed #ddd6fe;
    font-size: 13px;
    color: #4b5563;
}

.st-breakdown-row:last-of-type { border-bottom: none; }

.st-breakdown-row strong { color: #1f2937; font-weight: 600; }

.st-bd-bonus { color: #059669 !important; }
.st-bd-bonus strong { color: #059669 !important; }

.st-breakdown-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #a78bfa;
    font-size: 16px;
    font-weight: 700;
    color: #4c1d95;
}

.st-breakdown-total strong {
    font-size: 20px;
    color: #4c1d95;
}

/* ── Error ───────────────────────────────────── */
.st-sticker-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    padding: 10px 14px;
    font-size: 13px;
    margin: 10px 0;
}

/* ── Loading ─────────────────────────────────── */
.st-sticker-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6b7280;
    font-size: 13px;
    padding: 8px 0;
}

.st-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: st-spin .6s linear infinite;
}

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

/* ── Add to Cart button ──────────────────────── */
.st-sticker-add-to-cart {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .25s ease;
    letter-spacing: .3px;
    margin-top: 14px;
}

.st-sticker-add-to-cart:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102,126,234,.4);
}

.st-sticker-add-to-cart:disabled { cursor: not-allowed; }

/* ── Pricing reference table ─────────────────── */
.st-price-reference {
    margin-top: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.st-price-reference summary {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    background: #f9fafb;
    user-select: none;
}

.st-price-reference summary:hover { background: #f3f4f6; }

.st-price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.st-price-table th,
.st-price-table td {
    border: 1px solid #e5e7eb;
    padding: 7px 10px;
    text-align: center;
}

.st-price-table thead th {
    background: #f3f4f6;
    font-weight: 600;
    color: #374151;
}

.st-price-table tbody tr:nth-child(even) { background: #f9fafb; }

/* ── Dimension inputs (width × height) ───────── */
.st-dimension-wrap {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.st-dimension-field {
    flex: 1;
}

.st-dimension-label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 4px;
}

.st-dimension-input-wrap {
    position: relative;
}

.st-dimension-input {
    width: 100%;
    padding: 10px 36px 10px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .2s;
    -moz-appearance: textfield;
}

.st-dimension-input::-webkit-outer-spin-button,
.st-dimension-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.st-dimension-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,.15);
}

.st-unit-label {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #9ca3af;
    pointer-events: none;
}

.st-dimension-x {
    font-size: 18px;
    color: #9ca3af;
    padding-bottom: 10px;
    flex-shrink: 0;
}

/* ── Field hint text ─────────────────────────── */
.st-field-hint {
    font-size: 11px;
    color: #9ca3af;
    margin: 5px 0 0;
}

/* ── Material description text ───────────────── */
.st-material-desc { font-size: 11px; color: #6b7280; }

/* ── Custom quote notice (error variant) ─────── */
.st-sticker-error.st-custom-quote-notice {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

/* ── Upload area ─────────────────────────────── */
#st-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    background: #f9fafb;
}

#st-upload-area:hover { border-color: var(--color-primary, #e11d48); }

#st-upload-icon { font-size: 28px; display: block; margin-bottom: 6px; }

.st-upload-text { margin: 4px 0; font-size: 14px; color: #374151; }

.st-upload-hint { font-size: 12px; color: #9ca3af; margin: 2px 0 8px; }

.st-upload-filename { font-size: 13px; color: #16a34a; margin-top: 6px; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 480px) {
    .st-material-buttons { grid-template-columns: 1fr; }
    .st-dimension-wrap { flex-direction: column; gap: 8px; }
    .st-dimension-x { display: none; }
}