/* ════════════════════════════════════════════════════════════
   MPRO Calculateur – Frontend Form Styles
   ════════════════════════════════════════════════════════════ */

/* Reset within our widget */
.mpro-calculator *, .mpro-calculator *::before, .mpro-calculator *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.mpro-calculator {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    max-width: 560px;
    margin: 0 auto;
    padding: 0 8px;
    box-sizing: border-box;
}

.mpro-calculator-wrap { width: 100%; }

/* ── Loading ───────────────────────────────────────────────── */
.mpro-calculator__loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.mpro-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: mpro-spin 0.6s linear infinite;
}

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

/* ── Header ────────────────────────────────────────────────── */
.mpro-calculator__header {
    text-align: center;
    margin-bottom: 16px;
}

.mpro-calculator__logo {
    height: 40px;
    margin-bottom: 12px;
}

.mpro-calculator__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.mpro-calculator__subtitle {
    font-size: 0.875rem;
    color: #6b7280;
}

/* ── Step Progress ─────────────────────────────────────────── */
.mpro-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
    gap: 0;
}

.mpro-step {
    display: flex;
    align-items: center;
    flex: 1;
}

.mpro-step:last-child {
    flex: 0;
}

.mpro-step__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.mpro-step__circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    background-color: #e5e7eb;
    color: #9ca3af;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.mpro-step--active .mpro-step__circle,
.mpro-step--completed .mpro-step__circle {
    background-color: #2563eb;
    color: #fff;
}

.mpro-step--active .mpro-step__circle {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.mpro-step__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
    white-space: nowrap;
}

.mpro-step--active .mpro-step__label {
    color: #2563eb;
}

.mpro-step--completed .mpro-step__label {
    color: #1a1a2e;
}

.mpro-step__bar-wrapper {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    margin: 0 8px;
    border-radius: 1px;
    overflow: hidden;
    position: relative;
    top: -12px;
}

.mpro-step__bar--filled {
    height: 100%;
    background: #2563eb;
    transition: width 0.4s ease;
    border-radius: 1px;
}

@media (max-width: 640px) {
    .mpro-step__label { display: none; }
    .mpro-step__bar-wrapper { top: 0; }
    .mpro-step__circle { width: 32px; height: 32px; font-size: 0.75rem; }
}

/* ── Step Content Area ─────────────────────────────────────── */
.mpro-step-content {
    min-height: 360px;
    position: relative;
}

.mpro-step-panel {
    animation: mpro-fade-in 0.25s ease;
}

@keyframes mpro-fade-in {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ── Volume Card ───────────────────────────────────────────── */
.mpro-volume-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 16px;
}

.mpro-volume-card__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mpro-volume-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mpro-volume-card__label {
    font-size: 0.875rem;
    color: #6b7280;
}

.mpro-volume-card__value {
    font-size: 1.5rem;
    font-weight: 700;
}

.mpro-volume-card__count {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: right;
}

/* ── Category Tabs ─────────────────────────────────────────── */
.mpro-cat-tabs-wrapper {
    position: relative;
    width: 100%;
}

.mpro-cat-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding-bottom: 8px;
}

@media (max-width: 767px) {
    .mpro-cat-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
        gap: 6px;
    }
}

.mpro-cat-tabs::-webkit-scrollbar { display: none; }

.mpro-cat-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 0 8px !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    border-radius: 9999px !important;
    border: 1px solid #d1d5db !important;
    background: #fff !important;
    color: #374151 !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
    font-family: inherit !important;
    width: 100% !important;
    box-sizing: border-box !important;
    line-height: normal !important;
}

.mpro-cat-btn svg {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
    display: block !important;
}

@media (max-width: 767px) {
    .mpro-cat-btn {
        width: auto !important;
        padding: 0 14px !important;
    }
}

.mpro-swipe-hint {
    display: none;
}

@media (max-width: 767px) {
    .mpro-swipe-hint {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 4px;
        font-size: 0.75rem;
        color: #94a3b8;
        margin-bottom: 12px;
    }
    .mpro-swipe-hint svg {
        width: 14px;
        height: 14px;
        opacity: 0.7;
    }
}

.mpro-cat-btn__text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.mpro-cat-btn * {
    color: inherit !important;
}

.mpro-cat-btn:hover {
    background: #f9fafb !important;
}

.mpro-cat-btn--active {
    background: #2563eb !important;
    color: #fff !important;
    border-color: #2563eb !important;
}

.mpro-cat-btn--active:hover {
    background: #1d4ed8 !important;
}

.mpro-cat-btn__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    font-size: 0.6875rem;
    font-weight: 700;
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.mpro-cat-btn--active .mpro-cat-btn__badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ── Item Row ──────────────────────────────────────────────── */
.mpro-items-grid {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

.mpro-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.mpro-item-row:hover {
    background: #f9fafb;
}

.mpro-item-row--selected {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.mpro-item-row__info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.mpro-item-row__icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #9ca3af;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.mpro-item-row--selected .mpro-item-row__icon {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.mpro-item-row__name {
    font-size: 0.875rem;
    font-weight: 500;
}

.mpro-item-row__volume {
    font-size: 0.75rem;
    color: #9ca3af;
}

.mpro-item-row__controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.mpro-qty-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    border-radius: 50% !important;
    border: 1px solid #cbd5e1 !important;
    background: #fff !important;
    color: #64748b !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.mpro-qty-btn svg {
    width: 14px !important;
    height: 14px !important;
    stroke: currentColor !important;
    fill: none !important;
}

.mpro-qty-btn:hover:not(:disabled) {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

.mpro-qty-btn:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

.mpro-qty-value {
    width: 32px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #9ca3af;
}

.mpro-item-row--selected .mpro-qty-value {
    color: #2563eb;
}

/* ── Form Fields ───────────────────────────────────────────── */
.mpro-form-section {
    max-width: 480px;
    margin: 0 auto;
}

.mpro-form-section__header {
    text-align: center;
    margin-bottom: 24px;
}

.mpro-form-section__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.mpro-form-section__title {
    font-size: 1.25rem;
    font-weight: 700;
}

.mpro-form-section__desc {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 4px;
}

.mpro-field {
    margin-bottom: 16px;
}

.mpro-field--half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.mpro-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.mpro-input, .mpro-select, .mpro-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    color: #261212;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    box-sizing: border-box;
    font-weight: 500;
}

.mpro-input::placeholder,
.mpro-textarea::placeholder { color: #cbd5e1; font-weight: 400; }
.mpro-select:invalid,
.mpro-select:has(option[value=""]:checked) { color: #cbd5e1; font-weight: 400; }
.mpro-select option { color: #261212; font-weight: 500; }
.mpro-select option[value=""] { color: #cbd5e1; }

/* Autofill — keep dark text color */
.mpro-input:-webkit-autofill,
.mpro-input:-webkit-autofill:hover,
.mpro-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #261212 !important;
    -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
    transition: background-color 99999s ease-in-out 0s;
}

.mpro-input, .mpro-select {
    height: 42px;
}

.mpro-input:focus, .mpro-select:focus, .mpro-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.mpro-input--error {
    border-color: #dc2626;
}

.mpro-textarea {
    resize: vertical;
    min-height: 80px;
}

.mpro-select {
    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='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.mpro-error {
    font-size: 0.75rem;
    color: #dc2626;
    margin-top: 4px;
}

/* ── Summary Cards ─────────────────────────────────────────── */
.mpro-summary-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.mpro-summary-card--accent {
    background: rgba(37, 99, 235, 0.05);
    border-color: rgba(37, 99, 235, 0.15);
}

.mpro-summary-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 0.875rem;
}

.mpro-summary-card__header svg {
    color: #2563eb;
}

.mpro-summary-items {
    max-height: 160px;
    overflow-y: auto;
}

.mpro-summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    padding: 2px 0;
}

.mpro-summary-item__name {
    color: #6b7280;
}

.mpro-summary-item__vol {
    font-weight: 500;
}

.mpro-summary-addresses {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 640px) {
    .mpro-summary-addresses { grid-template-columns: 1fr; }
}

.mpro-summary-detail {
    font-size: 0.875rem;
    line-height: 1.6;
}

.mpro-summary-detail p {
    margin: 0;
}

.mpro-summary-detail .mpro-muted {
    color: #6b7280;
}

/* ── Action Bar ────────────────────────────────────────────── */
.mpro-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 24px;
}

/* ── Volume Badge ──────────────────────────────────────────── */
.mpro-volume-badge {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
    padding: 6px 12px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Mobile action bar ─────────────────────────────────────── */
@media (max-width: 560px) {
    .mpro-action-bar {
        gap: 6px;
        padding: 14px 0;
    }
    .mpro-action-bar .mpro-btn {
        padding: 8px 12px;
        font-size: 0.8125rem;
        min-width: 0;
        flex-shrink: 1;
    }
    .mpro-action-bar .mpro-btn span { white-space: nowrap; }
    .mpro-action-bar .mpro-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
    .mpro-volume-badge {
        font-size: 0.75rem;
        padding: 5px 10px;
        min-width: auto;
    }
    .mpro-calculator { padding: 0 4px; }
}

@media (max-width: 380px) {
    .mpro-action-bar .mpro-btn { padding: 7px 10px; font-size: 0.75rem; }
    .mpro-volume-badge { padding: 4px 8px; font-size: 0.7rem; }
}

/* ── Buttons ───────────────────────────────────────────────── */
.mpro-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-decoration: none;
    line-height: 1.5;
}

.mpro-btn--primary {
    background: #2563eb;
    color: #fff;
}

.mpro-btn--primary:hover {
    background: #1d4ed8;
}

.mpro-btn--outline {
    background: transparent;
    border-color: #d1d5db;
    color: #374151;
}

.mpro-btn--outline:hover {
    background: #f9fafb;
}

.mpro-btn--whatsapp {
    background: #16a34a !important;
    color: #ffffff !important;
    border-color: #16a34a !important;
}

.mpro-btn--whatsapp:hover {
    background: #15803d !important;
    color: #ffffff !important;
}

.mpro-btn--whatsapp svg,
.mpro-btn--whatsapp span { color: #ffffff !important; fill: currentColor; }

.mpro-btn--outline-home {
    background: transparent;
    color: #2563eb;
    border: 1.5px solid #2563eb;
    font-weight: 600;
}

.mpro-btn--outline-home:hover {
    background: rgba(37, 99, 235, 0.06);
    color: #1d4ed8;
}

.mpro-btn--phone {
    background: #2563eb;
    color: #fff;
}

.mpro-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

/* ── Success Screen ────────────────────────────────────────── */
.mpro-success {
    text-align: center;
    padding: 48px 24px;
    animation: mpro-fade-in 0.35s ease;
}

.mpro-success__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.mpro-success__title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #111827;
}

.mpro-success__message {
    color: #6b7280;
    font-size: 1rem;
    margin: 0 auto 32px;
    max-width: 360px;
    line-height: 1.6;
}

.mpro-success__actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

.mpro-success__actions-row {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 360px;
}

.mpro-success__actions-row .mpro-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 0.9375rem;
    border-radius: 10px;
}

.mpro-btn--reset {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 0.8125rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 8px;
    transition: color 0.2s;
}

.mpro-btn--reset:hover {
    color: #6b7280;
}

/* Datepicker customizado removido na v4.0.0 — usando <input type="date"> nativo */

/* ── Utilities ─────────────────────────────────────────────── */
.mpro-hidden { display: none !important; }
.mpro-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* ── Step time hint / cube wrap — removed in v3.1.0 ────────── */
