/* =====================================================================
   Rotar Cotizador — Frontend CSS
   Versión 1.0.0 | Ecosistema Rotar 2026
   ===================================================================== */

/* ── Variables globales del componente ── */
:root {
    --rc-primary: var(--rc-color, #0b4268);
    --rc-primary-lgt: color-mix(in srgb, var(--rc-primary) 80%, white);
    --rc-surface: #ffffff;
    --rc-bg: #f8fafc;
    --rc-border: #e2e8f0;
    --rc-text: #1e293b;
    --rc-muted: #64748b;
    --rc-danger: #ef4444;
    --rc-success: #22c55e;
    --rc-radius: 14px;
    --rc-shadow: 0 20px 60px rgba(0, 0, 0, .22), 0 4px 16px rgba(0, 0, 0, .12);
    --rc-font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --rc-transition: all 0.22s cubic-bezier(.4, 0, .2, 1);
}

/* =====================================================================
   BOTÓN: Solicitar Cotización
   ===================================================================== */

/* Botón en página de producto individual */
.rc-quote-btn-wrapper.rc-single {
    margin: 18px 0 4px;
}

/* ── Reset: anular estilos globales del tema sobre botones del cotizador ── */
/* Tema: button { background:transparent; border:1px solid #ed7800; color:#161616 }
   Se usa !important en cada propiedad para ganar independientemente de la especificidad */
button.rc-open-modal,
#rc-modal-overlay [type="button"],
#rc-modal-overlay [type="submit"],
#rc-modal-overlay button {
    background-color: unset;
    border: unset;
    border-radius: unset;
    color: unset;
    font-size: unset;
    font-weight: unset;
    padding: unset;
    text-align: unset;
    transition: unset;
    -webkit-user-select: unset;
    -moz-user-select: unset;
    user-select: unset;
}

button.rc-open-modal {
    --rc-primary: var(--rc-color, #0b4268);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: fit-content;
    background: var(--rc-primary) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px;
    font-family: var(--rc-font);
    font-size: 15px;
    font-weight: 600;
    padding: 10px 24px !important;
    cursor: pointer;
    letter-spacing: .2px;
    transition: var(--rc-transition);
    box-shadow: 0 2px 12px rgba(11, 66, 104, .25);
    text-transform: none !important;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

button.rc-open-modal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background 0.2s;
}

button.rc-open-modal:hover,
button.rc-open-modal:focus {
    background-color: #0b4268 !important;
    color: #fff !important;
    text-decoration: none !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(11, 66, 104, .38) !important;
}

button.rc-open-modal:hover::before,
button.rc-open-modal:focus::before {
    background: rgba(255, 255, 255, .08);
}

button.rc-open-modal:active {
    transform: translateY(0) !important;
}

/* Hover/focus — estrictamente dentro del modal, sin afectar otros plugins */
#rc-modal-overlay .rc-modal-close:hover,
#rc-modal-overlay .rc-modal-close:focus {
    background: rgba(255, 255, 255, .28);
}

button.rc-open-modal svg {
    flex-shrink: 0;
}

/* Variante en loop de productos */
button.rc-open-modal.rc-loop-btn {
    width: 100%;
    font-size: 13px;
    padding: 10px 16px;
    margin-top: 6px;
    border-radius: 8px;
    justify-content: center;
}

/* =====================================================================
   MODAL OVERLAY
   ===================================================================== */

.rc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    /* Sin backdrop-filter: evita crear stacking context persistente que bloquea otros plugins (ej: JoinChat) */
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    pointer-events: none;
    animation: rcFadeIn 0.22s ease;
}

/* Solo bloquear interacciones cuando el overlay está realmente visible */
.rc-modal-overlay.rc-overlay-active {
    pointer-events: auto;
}

@keyframes rcFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* =====================================================================
   MODAL BOX
   ===================================================================== */

.rc-modal-box {
    background: var(--rc-surface);
    border-radius: var(--rc-radius);
    box-shadow: var(--rc-shadow);
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: var(--rc-font);
    animation: rcSlideUp 0.26s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes rcSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Header ── */
.rc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, #0b4268 0%, #1a6fa0 100%);
    flex-shrink: 0;
}

.rc-modal-header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.rc-modal-title {
    font-size: 19px !important;
    font-weight: 700 !important;
    color: #fff !important;
    margin: 0 !important;
    line-height: 1 !important;
    font-family: var(--rc-font) !important;
}

.rc-modal-close {
    background: rgba(255, 255, 255, .15);
    border: none;
    border-radius: 8px;
    padding: 7px;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--rc-transition);
    flex-shrink: 0;
}

.rc-modal-close:hover {
    background: rgba(255, 255, 255, .28);
}

/* ── Body ── */
.rc-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* ── Producto preview ── */
.rc-product-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.rc-product-thumbnail {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

.rc-product-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.rc-product-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: #3b82f6;
}

.rc-product-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--rc-text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rc-product-sku {
    font-size: 12px;
    color: var(--rc-muted);
}

/* ── Section title ── */
.rc-section-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--rc-muted);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--rc-border);
}

/* ── Form Grid ── */
.rc-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.rc-col-full {
    grid-column: 1 / -1;
}

.rc-col-half {
    grid-column: span 1;
}

.rc-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rc-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--rc-text);
}

.rc-required {
    color: var(--rc-danger);
}

/* ── Input wrapper ── */
.rc-input-wrap {
    position: relative;
}

.rc-input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rc-muted);
    pointer-events: none;
    z-index: 2;
    /* sobre el fondo del input, sin tapar el texto */
}

textarea.rc-input~.rc-input-icon,
.rc-input-wrap:has(textarea) .rc-input-icon {
    top: 16px;
    transform: none;
}

.rc-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--rc-bg);
    border: 1.5px solid var(--rc-border);
    border-radius: 9px;
    font-family: var(--rc-font);
    font-size: 14px;
    color: var(--rc-text);
    padding: 11px 14px 11px 42px !important;
    /* !important evita que el tema lo pise */
    transition: var(--rc-transition);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.rc-input:focus {
    border-color: var(--rc-primary);
    background: #fff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc-primary) 12%, transparent);
}

.rc-input::placeholder {
    color: #94a3b8;
}

.rc-input.rc-textarea {
    padding-left: 42px !important;
    resize: vertical;
    min-height: 90px;
}

/* Selector de máxima especificidad para anular estilos del tema en el modal */
#rc-modal-overlay input.rc-input,
#rc-modal-overlay textarea.rc-input,
#rc-modal-overlay select.rc-select {
    padding-left: 42px !important;
}


/* ── Cantidad controller ── */
.rc-qty-wrap {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 1.5px solid var(--rc-border);
    border-radius: 9px;
    overflow: hidden;
    background: var(--rc-bg);
    transition: var(--rc-transition);
}

/* ── Selects de región / comuna ── */
.rc-select-wrap {
    position: relative;
}

.rc-select-wrap .rc-select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rc-muted);
    pointer-events: none;
    z-index: 2;
}

select.rc-select {
    width: 100% !important;
    padding: 11px 36px 11px 42px !important;
    /* derecha para la flecha SVG */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    background: var(--rc-bg);
}

select.rc-select:focus {
    border-color: var(--rc-primary);
    background: #fff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc-primary) 12%, transparent);
    outline: none;
}

select.rc-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f1f5f9;
}

select.rc-select option {
    font-family: var(--rc-font);
    font-size: 14px;
    color: var(--rc-text);
}



.rc-qty-wrap:focus-within {
    border-color: var(--rc-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc-primary) 12%, transparent);
}

#rc-modal-overlay .rc-qty-btn {
    background: transparent;
    border: none;
    padding: 0 16px;
    cursor: pointer;
    color: var(--rc-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    transition: var(--rc-transition);
    flex-shrink: 0;
    min-width: 40px;
    min-height: 40px;
}

#rc-modal-overlay .rc-qty-btn:hover {
    background: color-mix(in srgb, var(--rc-primary) 10%, transparent);
    color: var(--rc-primary);
}

.rc-input.rc-qty-input {
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    text-align: center;
    padding: 11px 4px;
    font-weight: 700;
    font-size: 16px;
    flex: 1;
    min-width: 0;
    -moz-appearance: textfield;
}

.rc-input.rc-qty-input:focus {
    box-shadow: none;
    background: transparent;
}

.rc-input.rc-qty-input::-webkit-outer-spin-button,
.rc-input.rc-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ── Actions ── */
.rc-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--rc-border);
}

#rc-modal-overlay .rc-btn-cancel {
    background: transparent;
    border: 1.5px solid var(--rc-border);
    border-radius: 9px;
    color: var(--rc-muted);
    font-family: var(--rc-font);
    font-size: 14px;
    font-weight: 600;
    padding: 11px 22px;
    cursor: pointer;
    transition: var(--rc-transition);
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

#rc-modal-overlay .rc-btn-cancel:hover {
    border-color: var(--rc-text);
    color: var(--rc-text);
    background: transparent;
}

#rc-modal-overlay .rc-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--rc-primary);
    border: none;
    border-radius: 9px;
    color: #fff;
    font-family: var(--rc-font);
    font-size: 14px;
    font-weight: 700;
    padding: 11px 26px;
    cursor: pointer;
    transition: var(--rc-transition);
    box-shadow: 0 2px 12px rgba(11, 66, 104, .25);
    white-space: nowrap;
}

#rc-modal-overlay .rc-btn-submit:hover:not(:disabled) {
    filter: brightness(1.1);
    box-shadow: 0 4px 18px rgba(11, 66, 104, .35);
    transform: translateY(-1px);
    color: #fff;
    background: var(--rc-primary);
}

.rc-btn-submit:disabled {
    opacity: .65;
    cursor: default;
}

.rc-btn-text,
.rc-btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Spinner ── */
.rc-spinner {
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rcSpin .7s linear infinite;
    flex-shrink: 0;
}

@keyframes rcSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Result message ── */
.rc-form-result {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

.rc-form-result.rc-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.rc-form-result.rc-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* ── Validation error state ── */
.rc-input.rc-field-error {
    border-color: var(--rc-danger);
}

.rc-input.rc-field-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .15);
}

/* =====================================================================
   BOTONES DE COMPARTIR — Redes Sociales
   ===================================================================== */

.rc-share-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 6px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--rc-border);
    border-radius: 10px;
}

.rc-share-label {
    font-family: var(--rc-font);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--rc-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.rc-share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

/* Base del botón de compartir */
.rc-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 8px;
    font-family: var(--rc-font);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.2s ease;
    line-height: 1;
    white-space: nowrap;
    border: 1.5px solid transparent;
}

.rc-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

/* WhatsApp */
.rc-share-btn.rc-share-wa {
    background: #25D366;
    color: #fff !important;
    border-color: #22c55e;
}

.rc-share-btn.rc-share-wa:hover {
    background: #1ebe5a;
}

/* Email */
.rc-share-btn.rc-share-email {
    background: #f1f5f9;
    color: #475569 !important;
    border-color: #e2e8f0;
}

.rc-share-btn.rc-share-email:hover {
    background: #e2e8f0;
    color: #0b4268 !important;
}

/* Facebook */
.rc-share-btn.rc-share-fb {
    background: #1877F2;
    color: #fff !important;
    border-color: #1565d8;
}

.rc-share-btn.rc-share-fb:hover {
    background: #0f6fe0;
}

/* Twitter / X */
.rc-share-btn.rc-share-tw {
    background: #000;
    color: #fff !important;
    border-color: #333;
}

.rc-share-btn.rc-share-tw:hover {
    background: #222;
}

/* LinkedIn */
.rc-share-btn.rc-share-li {
    background: #0A66C2;
    color: #fff !important;
    border-color: #0959ab;
}

.rc-share-btn.rc-share-li:hover {
    background: #0859aa;
}

.rc-share-btn svg {
    flex-shrink: 0;
}



@media (max-width: 600px) {
    .rc-modal-box {
        max-height: 98vh;
        border-radius: 12px 12px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
    }

    .rc-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .rc-form-grid {
        grid-template-columns: 1fr;
    }

    .rc-col-half {
        grid-column: 1 / -1;
    }

    .rc-form-actions {
        flex-direction: column-reverse;
    }

    .rc-btn-cancel,
    .rc-btn-submit {
        width: 100%;
        justify-content: center;
    }

    .rc-product-name {
        font-size: 13px;
    }
}

/* =====================================================================
   CARRITO MULTI-PRODUCTO
   ===================================================================== */

.rc-cart-section {
    background: var(--rc-bg);
    border-bottom: 1px solid var(--rc-border);
    padding: 16px 24px;
    flex-shrink: 0;
}

.rc-cart-header {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    color: var(--rc-muted);
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: 12px;
}

.rc-cart-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
    pointer-events: auto;
    position: relative;
}

.rc-cart-items::-webkit-scrollbar {
    width: 4px;
}

.rc-cart-items::-webkit-scrollbar-track {
    background: transparent;
}

.rc-cart-items::-webkit-scrollbar-thumb {
    background: var(--rc-border);
    border-radius: 4px;
}

.rc-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--rc-border);
    border-radius: 10px;
    padding: 10px 12px;
    transition: var(--rc-transition);
}

.rc-cart-item:hover {
    border-color: var(--rc-primary);
    box-shadow: 0 2px 8px rgba(11, 66, 104, .08);
}

.rc-ci-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid var(--rc-border);
}

.rc-ci-no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rc-bg);
    color: var(--rc-muted);
}

.rc-ci-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rc-ci-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--rc-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rc-ci-sku {
    font-size: 11px;
    color: var(--rc-primary);
    font-weight: 600;
}

.rc-ci-attrs {
    font-size: 11px;
    color: var(--rc-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Controles de cantidad inline por item */
.rc-ci-qty {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--rc-border);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

#rc-modal-overlay .rc-ci-qty .rc-qty-btn {
    background: transparent !important;
    border: none !important;
    padding: 0 10px !important;
    cursor: pointer !important;
    color: var(--rc-primary) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    min-width: 34px !important;
    min-height: 34px !important;
    transition: var(--rc-transition) !important;
}

#rc-modal-overlay .rc-ci-qty .rc-qty-btn:hover {
    background: color-mix(in srgb, var(--rc-primary) 12%, transparent) !important;
    color: var(--rc-primary) !important;
}

.rc-item-qty-input {
    width: 48px !important;
    min-width: 48px !important;
    height: 34px !important;
    text-align: center !important;
    background: #fff !important;
    border: none !important;
    border-left: 1px solid var(--rc-border) !important;
    border-right: 1px solid var(--rc-border) !important;
    border-radius: 0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--rc-text) !important;
    padding: 0 4px !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: text !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 10 !important;
    -moz-appearance: textfield !important;
    -webkit-appearance: none !important;
}

.rc-item-qty-input:focus {
    background: #f0f9ff !important;
    border-left-color: var(--rc-primary) !important;
    border-right-color: var(--rc-primary) !important;
    outline: none !important;
}

.rc-item-qty-input::-webkit-outer-spin-button,
.rc-item-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* Botón eliminar item */
.rc-item-remove {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--rc-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--rc-transition);
    flex-shrink: 0;
}

.rc-item-remove:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Mensaje de carrito vac&#237;o */
.rc-cart-empty {
    text-align: center;
    padding: 12px;
    font-size: 13px;
    color: var(--rc-muted);
    font-style: italic;
}

/* Leyenda instructiva del carrito */
p.rc-cart-tip {
    margin: 12px 0 16px;
    padding: 10px 14px;
    font-size: 12.5px;
    color: #3a5a7a;
    line-height: 1.65;
    text-align: left;
    background: #eef5fb;
    border: 1px solid #c3daea;
    border-left: 4px solid var(--rc-primary);
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

/* Badge flotante eliminado — estilos removidos para evitar conflictos con otros plugins */