/* ── Overlay ──────────────────────────────────────────────────────────────── */
.pcj-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: pcjFadeIn .18s ease;
}
.pcj-overlay[hidden] { display: none; }

@keyframes pcjFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Popup container ─────────────────────────────────────────────────────── */
.pcj-popup {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    width: 100%;
    max-width: 620px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 28px 32px 24px;
    position: relative;
    animation: pcjSlideUp .22s ease;
}

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

/* ── Cerrar ──────────────────────────────────────────────────────────────── */
.pcj-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 4px 8px;
    transition: color .15s;
    z-index: 1;
}
.pcj-close:hover { color: #333; }

/* ── Cabecera con imagen ─────────────────────────────────────────────────── */
.pcj-popup__product-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.pcj-popup__product-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.pcj-popup__title {
    margin: 0 0 2px;
    font-size: 20px;
    line-height: 1.2;
}

.pcj-popup__product-name {
    margin: 0;
    color: #666;
    font-size: 13px;
}

/* ── Lista de carrito dentro del popup ───────────────────────────────────── */
.pcj-cart-items {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
}

.pcj-cart-items h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.pcj-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}
.pcj-cart-item:last-child { border-bottom: none; }

.pcj-cart-item__img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.pcj-cart-item__name { flex: 1; color: #333; }

.pcj-cart-item__qty {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pcj-cart-item__qty input {
    width: 46px;
    text-align: center;
    padding: 3px 4px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
}

.pcj-cart-item__remove {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    line-height: 1;
    opacity: .7;
    transition: opacity .15s;
}
.pcj-cart-item__remove:hover { opacity: 1; }

/* ── Honeypot ────────────────────────────────────────────────────────────── */
.pcj-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

/* ── Grid de campos ──────────────────────────────────────────────────────── */
.pcj-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

@media (max-width: 520px) {
    .pcj-row { grid-template-columns: 1fr; }
    .pcj-popup { padding: 22px 18px 18px; }
}

.pcj-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.pcj-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.pcj-hint {
    font-weight: 400;
    color: #9ca3af;
    font-size: 11px;
}

.pcj-field--required label::after {
    content: ' *';
    color: #dc2626;
}

.pcj-popup .pcj-field input,
.pcj-popup .pcj-field textarea,
.pcj-popup .pcj-field select {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 11px;
    font-size: 14px;
    transition: border-color .15s, box-shadow .15s;
    background: #fff;
    color: #111;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.pcj-popup .pcj-field input[type="file"] {
    padding: 6px 10px;
    cursor: pointer;
}

.pcj-popup .pcj-field input:focus,
.pcj-popup .pcj-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.pcj-popup .pcj-field input.pcj-error,
.pcj-popup .pcj-field textarea.pcj-error {
    border-color: #dc2626;
}

.pcj-field textarea { resize: vertical; }

/* ── Aviso ───────────────────────────────────────────────────────────────── */
.pcj-notice {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 12px;
}
.pcj-notice--success { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.pcj-notice--error   { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── Botón submit + spinner ──────────────────────────────────────────────── */
.pcj-btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 7px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    letter-spacing: .3px;
    font-family: inherit;
}
.pcj-btn-submit:hover:not(:disabled)  { opacity: .88; }
.pcj-btn-submit:active:not(:disabled) { transform: scale(.98); }
.pcj-btn-submit:disabled              { opacity: .65; cursor: not-allowed; }

.pcj-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pcjSpin .7s linear infinite;
    flex-shrink: 0;
}
.pcj-spinner.pcj-spinner--active {
    display: inline-block;
}
@keyframes pcjSpin {
    to { transform: rotate(360deg); }
}

/* ── Botón "Solicitarlo" en producto / loop ──────────────────────────────── */
.pcj-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.pcj-btn-solicitar {
    cursor: pointer;
    color: #fff !important;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    padding: 10px 20px;
    border: none;
    transition: opacity .15s;
    display: inline-block;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.4;
}
.pcj-btn-solicitar:hover { opacity: .85; color: #fff !important; }

/* ── Botón "Agregar a lista de cotización" ───────────────────────────────── */
.pcj-btn-agregar-lista {
    cursor: pointer;
    background: transparent;
    border: 2px solid currentColor;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 16px;
    transition: background .15s, opacity .15s;
    display: inline-block;
    text-align: center;
    font-family: inherit;
}
.pcj-btn-agregar-lista:hover {
    background: rgba(0,0,0,.06);
}

/* ── Toast de confirmación ───────────────────────────────────────────────── */
.pcj-toast {
    position: fixed;
    bottom: 90px;
    right: 24px;
    background: #1e293b;
    color: #fff;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 99997;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    max-width: 300px;
    transition: opacity .4s ease;
    opacity: 1;
}
.pcj-toast--hide { opacity: 0; }

/* ── Botón WhatsApp ──────────────────────────────────────────────────────── */
.pcj-btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25d366;
    color: #fff !important;
    text-decoration: none !important;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: opacity .15s;
    width: fit-content;
}
.pcj-btn-whatsapp:hover { opacity: .85; }

.pcj-wa-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    flex-shrink: 0;
}

/* ── FAB carrito de cotización ───────────────────────────────────────────── */
.pcj-cart-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 54px;
    height: 54px;
    background: #1e40af;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    z-index: 99998;
    border: none;
    transition: transform .15s, box-shadow .15s;
    animation: pcjFadeIn .3s ease;
}
.pcj-cart-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,.3);
}

.pcj-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
