﻿/**
 * CPS Price Calculator — stiluri pentru calculatorul de stickere personalizate
 * Toate stilurile sunt scopate sub #cps-calculator pentru izolare față de Flatsome.
 */

#cps-calculator {
    --cps-green: #1a6b3c;
    --cps-green-dark: #134a2a;
    --cps-green-light: #e8f4ee;
    --cps-orange: #f5a623;
    --cps-orange-dark: #d88c0e;
    --cps-text: #1a1a1a;
    --cps-muted: #666;
    --cps-border: #e0e0e0;
    --cps-bg-soft: #fafafa;
    --cps-radius: 8px;

    max-width: 540px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--cps-text);
    margin: 0 0 24px;
}

#cps-calculator *,
#cps-calculator *::before,
#cps-calculator *::after {
    box-sizing: border-box;
}

/* ── Secțiune ──────────────────────────────────────────────────────── */
.cps-calc-section {
    padding: 20px 0;
    border-bottom: 1px solid var(--cps-border);
}

.cps-calc-section:first-child {
    padding-top: 0;
}

.cps-calc-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--cps-muted);
    margin: 0 0 12px;
}

/* ── Preseturi dimensiune (5/7/10/12 cm) ──────────────────────────── */
.cps-preset-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.cps-preset-btn,
.cps-option-btn {
    padding: 12px 8px;
    background: #fff;
    border: 2px solid var(--cps-border);
    border-radius: var(--cps-radius);
    font-size: 15px;
    font-weight: 600;
    color: var(--cps-text);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    font-family: inherit;
    line-height: 1.2;
}

.cps-preset-btn:hover,
.cps-option-btn:hover {
    border-color: var(--cps-green);
    background: var(--cps-green-light);
}

.cps-preset-btn.active,
.cps-option-btn.active {
    background: var(--cps-green-light);
    border-color: var(--cps-green);
    color: var(--cps-green-dark);
}

/* ── Inputuri lățime/înălțime ─────────────────────────────────────── */
.cps-size-inputs {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 12px;
}

.cps-input-group {
    flex: 1;
    min-width: 0;
}

.cps-input-group label {
    display: block;
    font-size: 12px;
    color: var(--cps-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.cps-input-wrap {
    position: relative;
}

.cps-input-wrap input {
    width: 100%;
    padding: 10px 36px 10px 12px;
    border: 2px solid var(--cps-border);
    border-radius: var(--cps-radius);
    font-size: 16px;
    font-family: inherit;
    color: var(--cps-text);
    background: #fff;
    outline: none;
    transition: border-color 0.15s ease;
    -moz-appearance: textfield;
    appearance: textfield;
}

.cps-input-wrap input::-webkit-outer-spin-button,
.cps-input-wrap input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cps-input-wrap input:focus {
    border-color: var(--cps-green);
}

.cps-input-unit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--cps-muted);
    pointer-events: none;
}

.cps-times-sep {
    font-size: 18px;
    color: var(--cps-muted);
    padding-bottom: 10px;
    user-select: none;
}

/* ── Info suprafață & warning dimensiune personalizată ────────────── */
.cps-area-info {
    font-size: 13px;
    color: var(--cps-muted);
    margin: 0;
}

.cps-area-info #cps-area-val {
    color: var(--cps-text);
    font-weight: 600;
}

.cps-dim-warning {
    display: none;
    margin: 10px 0 0;
    padding: 10px 12px;
    background: #fff8e1;
    border-left: 3px solid var(--cps-orange);
    font-size: 12px;
    color: #6b4d00;
    border-radius: 4px;
    line-height: 1.5;
}

/* ── Butoane Die Cut/Kiss Cut + Lucios/Mat/Nelaminat ──────────────── */
.cps-btn-group {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.cps-btn-group .cps-option-btn {
    flex: 1;
    min-width: 90px;
    padding: 12px 16px;
    font-size: 14px;
}

.cps-option-hint {
    font-size: 13px;
    color: var(--cps-muted);
    margin: 0;
    line-height: 1.5;
}

.cps-option-hint strong {
    color: var(--cps-text);
    font-weight: 600;
}

/* ── Tabel cantități ──────────────────────────────────────────────── */
.cps-qty-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--cps-border);
    border-radius: var(--cps-radius);
    overflow: hidden;
    background: #fff;
}

.cps-qty-table thead th {
    background: var(--cps-bg-soft);
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cps-muted);
    text-align: left;
    border-bottom: 1px solid var(--cps-border);
}

.cps-qty-table thead th.cps-qty-savings-cell {
    text-align: center;
}

.cps-qty-row {
    cursor: pointer;
    border-bottom: 1px solid var(--cps-border);
    transition: background 0.1s ease;
}

.cps-qty-row:last-child {
    border-bottom: none;
}

.cps-qty-row:hover {
    background: var(--cps-bg-soft);
}

.cps-qty-row.selected {
    background: var(--cps-green-light);
}

.cps-qty-row.selected td.cps-qty-radio-cell {
    box-shadow: inset 3px 0 0 var(--cps-green);
}

.cps-qty-row td {
    padding: 14px 16px;
    vertical-align: middle;
}

/* Radio personalizat */
.cps-qty-radio-cell {
    width: 48px;
}

/* Padding-left explicit pe prima celulă — bara (inset shadow) e la x=0..3,
   radio-ul trebuie să înceapă la cel puțin x=16 ca să nu se suprapună */
.cps-qty-row td.cps-qty-radio-cell {
    padding-left: 20px;
}

.cps-qty-radio {
    width: 18px;
    height: 18px;
    border: 2px solid var(--cps-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: border-color 0.15s ease;
}

.cps-qty-row.selected .cps-qty-radio {
    border-color: var(--cps-green);
}

.cps-qty-radio-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    transition: background 0.15s ease;
}

.cps-qty-row.selected .cps-qty-radio-dot {
    background: var(--cps-green);
}

.cps-qty-label {
    font-weight: 600;
    font-size: 15px;
}

.cps-qty-price-cell {
    text-align: right;
}

.cps-qty-total {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: var(--cps-text);
}

.cps-qty-per {
    display: block;
    font-size: 12px;
    color: var(--cps-muted);
    margin-top: 2px;
}

.cps-qty-savings-cell {
    text-align: center;
    width: 90px;
}

.cps-savings-badge {
    display: inline-block;
    padding: 3px 8px;
    background: var(--cps-orange);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

/* ── Footer cu sumar + CTA ────────────────────────────────────────── */
.cps-calc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 0 0;
    flex-wrap: wrap;
}

.cps-selected-summary {
    flex: 1;
    min-width: 180px;
}

#cps-summary-price {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--cps-green-dark);
    line-height: 1.1;
}

#cps-summary-label {
    display: block;
    font-size: 13px;
    color: var(--cps-muted);
    margin-top: 4px;
}

.cps-summary-sep {
    margin: 0 6px;
    opacity: 0.5;
}

.cps-summary-qty {
    font-weight: 600;
    color: var(--cps-text);
}

.cps-cta-btn {
    padding: 14px 32px;
    background: var(--cps-orange);
    color: #fff;
    border: none;
    border-radius: var(--cps-radius);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    font-family: inherit;
    line-height: 1.2;
}

.cps-cta-btn:hover:not(:disabled) {
    background: var(--cps-orange-dark);
}

.cps-cta-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.cps-cta-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cps-cta-arrow {
    display: inline-block;
    margin-left: 4px;
    transition: transform 0.15s ease;
}

.cps-cta-btn:hover:not(:disabled) .cps-cta-arrow {
    transform: translateX(3px);
}

/* ── Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .cps-preset-row {
        gap: 6px;
    }

    .cps-preset-btn {
        padding: 10px 4px;
        font-size: 13px;
    }

    .cps-btn-group {
        gap: 6px;
    }

    .cps-btn-group .cps-option-btn {
        padding: 10px 12px;
        font-size: 13px;
        min-width: 80px;
    }

    .cps-qty-table thead th {
        font-size: 10px;
        padding: 8px 6px;
    }

    .cps-qty-row td {
        padding: 10px 8px;
    }

    .cps-qty-row td.cps-qty-radio-cell {
        padding-left: 14px;
    }

    .cps-qty-label,
    .cps-qty-total {
        font-size: 14px;
    }

    .cps-qty-per {
        font-size: 11px;
    }

    .cps-qty-savings-cell {
        width: 70px;
    }

    .cps-savings-badge {
        font-size: 10px;
        padding: 2px 5px;
    }

    #cps-summary-price {
        font-size: 22px;
    }

    .cps-cta-btn {
        width: 100%;
        padding: 16px;
    }
}


/* — Eticheta forma aleasa (Rotunde, Patrate etc.) — */
.cps-forma-badge {
    background: #f0f9f4;
    border: 2px solid #1a6b3c;
    border-left: 6px solid #f5a623;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 15px;
    color: #1a6b3c;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.cps-forma-badge strong {
    color: #1a6b3c;
    font-weight: 700;
}

.cps-forma-icon {
    font-size: 20px;
    line-height: 1;
}


/* ================================================================
   UPLOAD DESIGN — zona de incarcare fisier (v1.3.0)
   ================================================================ */

.cps-design-section {
    padding-bottom: 0;
}

/* Dropzone */
.cps-design-dropzone {
    border: 2px dashed var(--cps-border);
    border-radius: var(--cps-radius);
    background: var(--cps-bg-soft);
    transition: border-color 0.15s ease, background 0.15s ease;
    cursor: pointer;
}

.cps-design-dropzone:hover,
.cps-design-dropzone.cps-drag-over {
    border-color: var(--cps-green);
    background: var(--cps-green-light);
}

.cps-design-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 24px 16px;
    cursor: pointer;
    text-align: center;
}

.cps-design-icon {
    fill: var(--cps-green);
    opacity: 0.7;
    flex-shrink: 0;
}

.cps-design-dropzone:hover .cps-design-icon,
.cps-design-dropzone.cps-drag-over .cps-design-icon {
    opacity: 1;
}

.cps-design-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--cps-text);
}

.cps-design-hint {
    font-size: 12px;
    color: var(--cps-muted);
    line-height: 1.4;
}

/* Input file ascuns vizual */
.cps-design-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Preview dupa upload reusit */
.cps-design-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--cps-green-light);
    border: 2px solid var(--cps-green);
    border-radius: var(--cps-radius);
}

.cps-design-ok {
    font-size: 18px;
    color: var(--cps-green);
    font-weight: 700;
    flex-shrink: 0;
}

.cps-design-filename {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--cps-text);
    word-break: break-all;
}

.cps-design-filesize {
    font-size: 12px;
    color: var(--cps-muted);
    flex-shrink: 0;
}

.cps-design-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--cps-muted);
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.cps-design-remove:hover {
    color: #c00;
}

/* Stare incarcare */
.cps-design-uploading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--cps-muted);
    padding: 10px 0 0;
    margin: 0;
}

.cps-design-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--cps-border);
    border-top-color: var(--cps-green);
    border-radius: 50%;
    animation: cps-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes cps-spin {
    to { transform: rotate(360deg); }
}

/* Eroare */
.cps-design-error {
    font-size: 13px;
    color: #c00;
    background: #fff0f0;
    border: 1px solid #fcc;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 8px 0 0;
}

/* Mobile */
@media (max-width: 600px) {
    .cps-design-label {
        padding: 18px 12px;
    }

    .cps-design-text {
        font-size: 13px;
    }

    .cps-design-hint {
        font-size: 11px;
    }
}
/* CPS CUSTOM QTY STICKERE START */
.cps-custom-qty {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #e0e0e0;
}
.cps-custom-qty > label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
}
.cps-custom-qty > label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1a6b3c;
    cursor: pointer;
}
#cps-custom-input {
    display: block;
    margin-top: 10px;
    width: 140px;
    max-width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    color: #1a1a1a;
    background: #fff;
    outline: none;
    transition: border-color 0.15s ease;
    -moz-appearance: textfield;
    appearance: textfield;
}
#cps-custom-input::-webkit-outer-spin-button,
#cps-custom-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#cps-custom-input:focus {
    border-color: #1a6b3c;
}
.cps-hint {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    margin: 8px 0 0;
}
/* CPS CUSTOM QTY STICKERE END */

/* CPS POSTERE BTN LABEL/SUBTITLE START */
.cps-option-btn .cps-btn-label,
.cps-option-btn .cps-btn-subtitle {
    display: block !important;
    width: 100%;
    text-align: center;
}
.cps-option-btn .cps-btn-label {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
    margin: 0 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.cps-option-btn .cps-btn-subtitle {
    font-weight: 400;
    font-size: 11px;
    line-height: 1.3;
    opacity: 0.7;
    text-transform: none;
    letter-spacing: 0;
    margin: 0;
}
/* Buton mai inalt cand are subtitle */
.cps-option-btn:has(.cps-btn-subtitle) {
    padding-top: 14px;
    padding-bottom: 14px;
    min-height: 64px;
}
/* CPS POSTERE BTN LABEL/SUBTITLE END */
