/* ==========================================================================
   Body Procedures Selector — Frontend Styles
   Branding: Columna Esthetic (#0090ff, white, #211f26, Roboto)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&display=swap');

/* ── Wrapper ── */
.bps-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #211f26;
}

/* ── Step Indicator ── */
.bps-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    gap: 0;
}

.bps-step {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.bps-step.active,
.bps-step.completed { opacity: 1; }

.bps-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s;
}

.bps-step.active .bps-step-number {
    background: #0090ff;
    color: #fff;
}

.bps-step.completed .bps-step-number {
    background: #27ae60;
    color: #fff;
}

.bps-step-label {
    font-size: 14px;
    font-weight: 500;
    color: #211f26;
}

.bps-step-divider {
    flex: 0 0 60px;
    height: 2px;
    background: #e0e0e0;
    margin: 0 8px;
}

/* ── Header ── */
.bps-header {
    text-align: center;
    margin-bottom: 24px;
}

.bps-title {
    font-size: 26px;
    font-weight: 700;
    color: #211f26;
    margin: 0 0 6px;
}

.bps-subtitle {
    font-size: 15px;
    color: #666;
    margin: 0;
}

/* ── Toggles Row ── */
.bps-toggles-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.bps-toggle-group {
    display: flex;
    border: 1.5px solid #d0d0d0;
    border-radius: 8px;
    overflow: hidden;
}

.bps-toggle-btn {
    padding: 8px 20px;
    border: none;
    background: #fff;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.bps-toggle-btn + .bps-toggle-btn {
    border-left: 1.5px solid #d0d0d0;
}

.bps-toggle-btn:hover { background: #f0f7ff; color: #0090ff; }

.bps-toggle-btn.active {
    background: #0090ff;
    color: #fff;
}

/* ── SVG Region Overlays ── */
#bps-svg-container .bps-region {
    cursor: pointer;
    opacity: 0;
    pointer-events: all;
    transition: opacity .2s;
}
#bps-svg-container .bps-region polygon,
#bps-svg-container .bps-region path {
    fill: #0090ff;
    stroke: #0090ff;
    stroke-width: 1.5;
    stroke-linejoin: round;
}
#bps-svg-container .bps-region:hover    { opacity: 0.28; }
#bps-svg-container .bps-region.active   { opacity: 0.45; }
#bps-svg-container .bps-region.has-items{ opacity: 0.18; }

/* ── Body Container ── */
.bps-body-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.bps-body-map {
    flex: 0 0 280px;
    max-width: 280px;
    position: relative;
}

#bps-svg-container svg,
.bps-svg {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Region tooltip ── */
.bps-region-tooltip {
    position: absolute;
    background: #211f26;
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 100;
    transform: translate(-50%, -100%);
    margin-top: -8px;
}

.bps-region-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #211f26;
}

/* ── Sidebar ── */
.bps-selected-sidebar {
    flex: 1;
    min-width: 260px;
    background: #f8f9ff;
    border-radius: 12px;
    padding: 22px;
    border: 1.5px solid #e0eaff;
}

.bps-selected-sidebar h3 {
    font-size: 17px;
    font-weight: 600;
    color: #211f26;
    margin: 0 0 14px;
}

.bps-empty-message {
    color: #aaa;
    font-size: 14px;
    text-align: center;
    padding: 16px 0;
}

.bps-selected-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #e4ecff;
    font-size: 14px;
}

.bps-selected-item-name { font-weight: 500; color: #211f26; flex: 1; margin-right: 8px; }
.bps-selected-item-price { color: #0090ff; font-weight: 600; font-size: 13px; white-space: nowrap; }
.bps-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #bbb;
    font-size: 18px;
    line-height: 1;
    padding: 0 0 0 10px;
    flex-shrink: 0;
    transition: color 0.15s;
}
.bps-remove-btn:hover { color: #e74c3c; }

.bps-step1-footer {
    margin-top: 16px;
    text-align: right;
}

/* ── Step 2 ── */
.bps-review-title {
    font-size: 18px;
    font-weight: 600;
    color: #211f26;
    margin: 0 0 16px;
}

.bps-review-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9ff;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #e0eaff;
    font-size: 15px;
}

.bps-review-item-name { font-weight: 500; }
.bps-review-item-price { color: #0090ff; font-weight: 600; }

.bps-step2-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* ── Consultation Form ── */
.bps-consult-form {
    margin-top: 28px;
    padding: 24px;
    background: #f8f9ff;
    border-radius: 12px;
    border: 1.5px solid #e0eaff;
}

.bps-consult-form h4 {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 18px;
    color: #211f26;
}

.bps-form-group {
    margin-bottom: 14px;
}

.bps-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    margin-bottom: 6px;
}

.bps-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d0d0d0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #211f26;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.bps-input:focus {
    outline: none;
    border-color: #0090ff;
    box-shadow: 0 0 0 3px rgba(0,144,255,0.12);
}

.bps-success-msg {
    color: #27ae60;
    font-weight: 500;
    font-size: 15px;
    text-align: center;
    padding: 16px;
}

/* ── Modal ── */
.bps-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 99999;
}

.bps-modal.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bps-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px);
}

.bps-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 680px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: bpsSlideUp 0.25s ease;
}

@keyframes bpsSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bps-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #eee;
}

.bps-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #211f26;
    margin: 0;
}

.bps-modal-close {
    background: none;
    border: none;
    font-size: 26px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.2s;
}

.bps-modal-close:hover { color: #e74c3c; }

.bps-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.bps-modal-footer {
    padding: 14px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}

/* ── Product Cards ── */
.bps-products-grid { display: grid; gap: 12px; }

.bps-product-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 10px;
    transition: all 0.2s;
}

.bps-product-card:hover { border-color: #c0d8ff; }
.bps-product-card.in-cart { border-color: #27ae60; background: #f0fdf4; }

.bps-product-image {
    width: 60px; height: 60px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}

.bps-product-info { flex: 1; min-width: 0; }

.bps-product-name {
    font-size: 14px;
    font-weight: 600;
    color: #211f26;
    margin: 0 0 4px;
}

.bps-product-desc {
    font-size: 12px;
    color: #888;
    margin: 0 0 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bps-product-price { font-size: 14px; font-weight: 700; color: #0090ff; }
.bps-product-category {
    display: inline-block;
    font-size: 11px;
    color: #0090ff;
    background: #e8f4ff;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 2px 4px 2px 0;
}

.bps-product-actions { flex-shrink: 0; }

/* ── Buttons ── */
.bps-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
    font-family: inherit;
}

.bps-btn-primary { background: #0090ff; color: #fff; }
.bps-btn-primary:hover { background: #007ae0; color: #fff; }
.bps-btn-primary:disabled { background: #99d0ff; cursor: not-allowed; }

.bps-btn-secondary { background: #f0f0f0; color: #444; }
.bps-btn-secondary:hover { background: #e0e0e0; }

.bps-btn-outline {
    background: transparent;
    color: #0090ff;
    border: 2px solid #0090ff;
}
.bps-btn-outline:hover { background: #e8f4ff; }

.bps-btn-add {
    background: #0090ff;
    color: #fff;
    padding: 8px 14px;
    font-size: 13px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.bps-btn-add:hover { background: #007ae0; }
.bps-btn-add.added { background: #27ae60; cursor: default; }
.bps-btn-add:disabled { opacity: 0.6; cursor: wait; }

/* ── Loading / Spinner ── */
.bps-loading { text-align: center; padding: 40px 20px; color: #aaa; }

.bps-spinner {
    display: inline-block;
    width: 30px; height: 30px;
    border: 3px solid #eee;
    border-top-color: #0090ff;
    border-radius: 50%;
    animation: bpsSpin 0.8s linear infinite;
    margin-bottom: 10px;
}

@keyframes bpsSpin { to { transform: rotate(360deg); } }

/* ── Toast ── */
.bps-toast {
    position: fixed;
    bottom: 24px; right: 24px;
    background: #211f26;
    color: #fff;
    padding: 13px 20px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 100000;
    animation: bpsToastIn 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.bps-toast.success { background: #27ae60; }
.bps-toast.error   { background: #e74c3c; }

@keyframes bpsToastIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .bps-body-container { flex-direction: column; align-items: center; }
    .bps-body-map { flex: none; max-width: 260px; }
    .bps-selected-sidebar { min-width: 100%; }
    .bps-modal-content { width: 95%; max-height: 90vh; border-radius: 12px; }
    .bps-product-card { flex-wrap: wrap; }
    .bps-product-actions { width: 100%; margin-top: 8px; }
    .bps-btn-add { width: 100%; }
    .bps-step2-actions { flex-direction: column; }
    .bps-step2-actions .bps-btn { width: 100%; }
    .bps-toggles-row { justify-content: center; }
}
