/* ================================================================
   Sign4Less — Frontend Styles
   Applied to: WooCommerce product pages
   ================================================================ */

/* ================================================================
   Template Download Bar (always visible when template is uploaded)
   ================================================================ */

.s4l-template-download-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 8px;
}

.s4l-tpl-dl-icon {
    flex-shrink: 0;
    color: #0369a1;
    line-height: 0;
}

.s4l-tpl-dl-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.s4l-tpl-dl-label {
    font-size: 14px;
    font-weight: 700;
    color: #0c4a6e;
}

.s4l-tpl-dl-hint {
    font-size: 12px;
    color: #0369a1;
    line-height: 1.4;
}

.s4l-tpl-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 9px 18px;
    background: #0369a1;
    color: #ffffff !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .15s, transform .1s, box-shadow .15s;
    box-shadow: 0 2px 6px rgba(3, 105, 161, .30);
    white-space: nowrap;
}

.s4l-tpl-dl-btn:hover {
    background: #0284c7;
    box-shadow: 0 4px 10px rgba(3, 105, 161, .35);
    transform: translateY(-1px);
    color: #ffffff !important;
}

.s4l-tpl-dl-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(3, 105, 161, .25);
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .s4l-template-download-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .s4l-tpl-dl-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ================================================================
   Sign4Less Section (upload / designer / calculator wrapper)
   ================================================================ */

.s4l-section {
    margin: 20px 0;
    padding: 22px 24px;
    background: #ffffff;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

/* ── Individual feature blocks ────────────────────────────────── */
.s4l-block + .s4l-block {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.s4l-block-title {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    letter-spacing: .01em;
}

/* ================================================================
   Feature 2 — Designer Service Radio
   ================================================================ */

.s4l-radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: border-color .15s, background .15s, box-shadow .15s;
    user-select: none;
}

.s4l-radio-label:hover {
    border-color: #2271b1;
    background: #f0f5ff;
}

.s4l-radio-label:has(input:checked) {
    border-color: #2271b1;
    background: #f0f5ff;
    box-shadow: 0 0 0 1px #2271b1;
}

.s4l-radio-label input[type="radio"] {
    margin: 0;
    flex-shrink: 0;
    accent-color: #2271b1;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.s4l-info-note {
    margin-top: 10px;
    padding: 12px 16px;
    background: #fffbea;
    border-left: 4px solid #dba617;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #5a4a00;
    line-height: 1.6;
}

/* ================================================================
   Feature 1 — Design Upload / Dropzone
   ================================================================ */

.s4l-dropzone {
    border: 2px dashed #b0b8c4;
    border-radius: 8px;
    padding: 28px 24px;
    text-align: center;
    cursor: pointer;
    background: #fafbfc;
    transition: border-color .15s, background .15s;
    position: relative;
}

.s4l-dropzone:hover,
.s4l-dropzone:focus {
    border-color: #2271b1;
    background: #f0f5ff;
    outline: none;
}

.s4l-dropzone.s4l-drag-over {
    border-color: #2271b1;
    background: #e8f0fd;
    border-style: solid;
}

.s4l-dropzone.s4l-uploading {
    opacity: .65;
    pointer-events: none;
}

.s4l-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.s4l-drop-icon {
    color: #8c9aaa;
    line-height: 1;
    transition: color .15s, transform .15s;
}

.s4l-dropzone:hover .s4l-drop-icon,
.s4l-dropzone.s4l-drag-over .s4l-drop-icon {
    color: #2271b1;
    transform: translateY(-3px);
}

.s4l-drop-text {
    font-size: 14px;
    color: #555d66;
    font-weight: 500;
}

.s4l-drop-meta {
    font-size: 11px;
    color: #a0aab4;
    letter-spacing: .01em;
}

/* Upload status */
#s4l-upload-status {
    margin-top: 8px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
}

.s4l-status-loading { background: #e8f0fe; color: #1a56c4; }
.s4l-status-success { background: #e6f4ea; color: #1a6b31; }
.s4l-status-error   { background: #fdecea; color: #b91c1c; }

/* File preview */
.s4l-file-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 9px 14px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 13px;
}

.s4l-file-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
}

.s4l-file-name-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
}

.s4l-remove-btn {
    flex-shrink: 0;
    background: transparent;
    border: 1px solid #dc2626;
    color: #dc2626;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    line-height: 1.4;
    transition: background .15s, color .15s;
}

.s4l-remove-btn:hover {
    background: #dc2626;
    color: #fff;
}

/* ================================================================
   Feature 3 — Size Calculator
   ================================================================ */

.s4l-calc-inputs {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.s4l-calc-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.s4l-calc-field-label {
    font-size: 12px;
    color: #646970;
    font-weight: 500;
}

.s4l-calc-field input[type="number"] {
    width: 120px;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
    color: #1d2327;
    transition: border-color .15s, box-shadow .15s;
    -moz-appearance: textfield;
}

.s4l-calc-field input[type="number"]::-webkit-outer-spin-button,
.s4l-calc-field input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.s4l-calc-field input[type="number"]:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, .25);
}

.s4l-calc-x {
    font-size: 22px;
    color: #9ca3af;
    padding-bottom: 10px;
    flex-shrink: 0;
    font-weight: 300;
}

.s4l-calc-result {
    margin-top: 18px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #f0f5ff 0%, #e8effe 100%);
    border: 1px solid #c7d7f0;
    border-radius: 10px;
}

.s4l-calc-price-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7a99;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 4px;
}

.s4l-calc-price {
    font-size: 32px;
    font-weight: 700;
    color: #1e40af;
    line-height: 1.1;
    margin-bottom: 10px;
    transition: color .3s;
}

.s4l-calc-formula {
    font-size: 12px;
    color: #4b5563;
    line-height: 2;
    border-top: 1px dashed #c7d7f0;
    padding-top: 10px;
    font-family: "Courier New", Courier, monospace;
}

.s4l-calc-formula strong {
    color: #1e40af;
    font-family: inherit;
}

/* ── Price flash animation ────────────────────────────────────── */
@keyframes s4l-flash {
    0%   { color: #d97706; transform: scale(1.10); }
    50%  { color: #2563eb; transform: scale(1.05); }
    100% { color: #1e40af; transform: scale(1.00); }
}

.s4l-price-flash {
    animation: s4l-flash .55s cubic-bezier(.22, .61, .36, 1) forwards;
}

/* ── Responsive tweaks ────────────────────────────────────────── */
@media (max-width: 480px) {
    .s4l-section {
        padding: 16px;
    }

    .s4l-calc-inputs {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .s4l-calc-x {
        padding-bottom: 0;
        align-self: center;
    }

    .s4l-calc-field input[type="number"] {
        width: 100%;
        max-width: 180px;
    }

    .s4l-calc-price {
        font-size: 26px;
    }
}
