/**
 * Prido Cotizador - Estilos Públicos
 * Botón "Cotizar" en fichas de producto (desktop + mobile)
 *
 * @package Prido_Cotizador
 */

/* =====================================================================
   WRAPPER
   ===================================================================== */
.prido-cotizar-wrap {
    position: relative;
    margin-top: 12px;
    width: 100%;
}

.prido-cotizar-wrap--mobile {
    margin-top: 16px;
    margin-bottom: 16px;
}

/* =====================================================================
   BOTÓN PRINCIPAL (enlace activo / usuario logueado)
   ===================================================================== */
.prido-cotizar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 24px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none;
    color: #ffffff;
    background: linear-gradient(135deg, #E8721C 0%, #d4640f 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(232, 114, 28, 0.25);
    line-height: 1.2;
    text-align: center;
    box-sizing: border-box;
}

.prido-cotizar-btn:hover {
    background: linear-gradient(135deg, #d4640f 0%, #c05a0d 100%);
    box-shadow: 0 4px 16px rgba(232, 114, 28, 0.35);
    transform: translateY(-1px);
    color: #ffffff;
    text-decoration: none;
}

.prido-cotizar-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(232, 114, 28, 0.2);
}

@keyframes prido-pulse-interval {
    0% {
        box-shadow: 0 0 0 0 rgba(232, 114, 28, 0.7);
    }
    15% {
        box-shadow: 0 0 0 12px rgba(232, 114, 28, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(232, 114, 28, 0);
    }
}

/* Efecto level pulso solo en boton activo y pagina de producto principal */
.prido-cotizar-wrap:not(.prido-cotizar-wrap--grilla) .prido-cotizar-btn--active {
    animation: prido-pulse-interval 3s infinite;
}

.prido-cotizar-wrap:not(.prido-cotizar-wrap--grilla) .prido-cotizar-btn--active:hover {
    animation: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(232, 114, 28, 0.35);
}

.prido-cotizar-btn svg {
    flex-shrink: 0;
}

/* =====================================================================
   BOTÓN DESHABILITADO (visitante o cliente sin rol empresa) — Hito 17
   ===================================================================== */
.prido-cotizar-btn--disabled {
    background: linear-gradient(135deg, #b0b0b0 0%, #9a9a9a 100%) !important;
    cursor: not-allowed;
    box-shadow: none !important;
    opacity: 0.7;
}

.prido-cotizar-btn--disabled:hover {
    transform: none !important;
    box-shadow: none !important;
    background: linear-gradient(135deg, #b0b0b0 0%, #9a9a9a 100%) !important;
}

/* =====================================================================
   TOOLTIP EDUCATIVO (Hito 17: enlace clicable a registro)
   ===================================================================== */
.prido-cotizar-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #333333;
    color: #ffffff;
    font-size: 12px;
    line-height: 1.4;
    padding: 8px 14px;
    border-radius: 6px;
    white-space: normal;
    max-width: 300px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Enlace dentro del tooltip */
.prido-cotizar-tooltip a {
    color: #F9A825;
    text-decoration: underline;
    font-weight: 600;
    pointer-events: auto;
}

.prido-cotizar-tooltip a:hover {
    color: #FFD54F;
}

/* Flecha del tooltip */
.prido-cotizar-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333333;
}

/* Mostrar tooltip en hover/focus del botón deshabilitado */
.prido-cotizar-wrap:hover .prido-cotizar-tooltip,
.prido-cotizar-btn--disabled:focus + .prido-cotizar-tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 768px) {
    .prido-cotizar-wrap--desktop {
        display: none;
    }

    .prido-cotizar-btn {
        padding: 12px 20px;
        font-size: 13px;
    }

    .prido-cotizar-tooltip {
        white-space: normal;
        min-width: 200px;
        text-align: center;
    }
}

@media (min-width: 769px) {
    .prido-cotizar-wrap--mobile {
        display: none;
    }
}

/* =====================================================================
   GRILLA DE PRODUCTOS — Botón compacto (Hito 42)
   ===================================================================== */
.prido-cotizar-wrap--grilla {
    position: relative;
    margin: 8px 0 4px;
    width: 100%;
    text-align: center;
}

.prido-cotizar-btn--grilla {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    padding: 8px 14px !important;
    font-size: 11px !important;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    text-decoration: none !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #E8721C 0%, #d4640f 100%) !important;
    border: none !important;
    border-radius: 5px !important;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 6px rgba(232, 114, 28, 0.2);
    line-height: 1.2;
    box-sizing: border-box;
    min-width: 0 !important;
    margin: 0 !important;
}

.prido-cotizar-btn--grilla:hover {
    background: linear-gradient(135deg, #d4640f 0%, #c05a0d 100%) !important;
    box-shadow: 0 3px 12px rgba(232, 114, 28, 0.3);
    transform: translateY(-1px);
    color: #ffffff !important;
    text-decoration: none !important;
}

.prido-cotizar-btn--grilla:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(232, 114, 28, 0.15);
}

.prido-cotizar-btn--grilla.prido-cotizar-btn--disabled {
    background: linear-gradient(135deg, #b0b0b0 0%, #9a9a9a 100%) !important;
    cursor: not-allowed;
    box-shadow: none !important;
    opacity: 0.65;
}

.prido-cotizar-btn--grilla.prido-cotizar-btn--disabled:hover {
    transform: none !important;
    box-shadow: none !important;
    background: linear-gradient(135deg, #b0b0b0 0%, #9a9a9a 100%) !important;
}

.prido-cotizar-btn--grilla svg {
    flex-shrink: 0;
}

/* Tooltip reposicionado para tarjetas de grilla */
.prido-cotizar-wrap--grilla .prido-cotizar-tooltip {
    bottom: calc(100% + 6px);
    font-size: 11px;
    padding: 6px 10px;
    max-width: 240px;
    min-width: 180px;
    white-space: normal;
}

.prido-cotizar-wrap--grilla .prido-cotizar-tooltip::after {
    border-width: 5px;
}

/* Responsive grilla */
@media (max-width: 768px) {
    .prido-cotizar-btn--grilla {
        padding: 7px 10px !important;
        font-size: 10px !important;
        gap: 4px;
    }

    .prido-cotizar-btn--grilla svg {
        width: 12px;
        height: 12px;
    }

    .prido-cotizar-wrap--grilla .prido-cotizar-tooltip {
        max-width: 200px;
        min-width: 160px;
        font-size: 10px;
    }
}
