/**
 * EFC Smart Commerce — Hojas de Estilos Aisladas
 *
 * REGLA ESTRICTA DE ENCAPSULACIÓN:
 * Todos los selectores de este archivo deben comenzar obligatoriamente
 * con el prefijo .efc-commerce-*
 *
 * Prohibido modificar selectores HTML globales (body, h1, h2, button, p)
 * o clases preexistentes del framework Tailwind CSS.
 *
 * @package   EnvigadoFC_Theme
 * @subpackage EFC_Smart_Commerce
 * @version   1.0.0
 */

:root {
    --efc-c-orange:       #F58220;
    --efc-c-orange-hover: #E8551B;
    --efc-c-charcoal:     #171717;
    --efc-c-dark:         #0E0E0E;
    --efc-c-surface:      #1C1B1B;
    --efc-c-surface-hover:#262525;
    --efc-c-border:       #2A2929;
    --efc-c-border-light: #383737;
    --efc-c-gray:         #A1A1AA;
    --efc-c-light:        #F4F4F5;
    --efc-c-font-display: 'Bricolage Grotesque', sans-serif;
    --efc-c-font-body:    'Hanken Grotesk', sans-serif;
    --efc-c-font-mono:    'JetBrains Mono', monospace;
}

/* ==========================================================================
   Contenedor Base Encapsulado
   ========================================================================== */

.efc-commerce-container {
    position: relative;
    box-sizing: border-box;
    font-family: var(--efc-c-font-body);
    color: var(--efc-c-light);
}

.efc-commerce-container *,
.efc-commerce-container *::before,
.efc-commerce-container *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Botones de Acción Comercial EFC
   ========================================================================== */

.efc-commerce-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-family: var(--efc-c-font-display);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    border-radius: 9999px;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    cursor: pointer;
    border: none;
    line-height: 1;
}

.efc-commerce-btn--primary {
    background-color: var(--efc-c-orange);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(245, 130, 32, 0.35);
}

.efc-commerce-btn--primary:hover {
    background-color: var(--efc-c-orange-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 130, 32, 0.5);
}

.efc-commerce-btn--secondary {
    background-color: var(--efc-c-surface);
    color: var(--efc-c-light);
    border: 1px solid var(--efc-c-border);
}

.efc-commerce-btn--secondary:hover {
    background-color: var(--efc-c-surface-hover);
    border-color: var(--efc-c-orange);
    color: #ffffff;
}

/* ==========================================================================
   Badges y Etiquetas Oficiales
   ========================================================================== */

.efc-commerce-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-family: var(--efc-c-font-mono);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1;
}

.efc-commerce-badge--official {
    background-color: rgba(245, 130, 32, 0.15);
    color: var(--efc-c-orange);
    border: 1px solid rgba(245, 130, 32, 0.3);
}

/* ==========================================================================
   Tipografía de Precios
   ========================================================================== */

.efc-commerce-price {
    font-family: var(--efc-c-font-mono);
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--efc-c-light);
    letter-spacing: -0.02em;
}

.efc-commerce-price--highlight {
    color: var(--efc-c-orange);
}

/* ==========================================================================
   Smart Product Pill (Pastilla Flotante No Invasiva)
   ========================================================================== */

.efc-commerce-pill {
    position: fixed;
    bottom: 95px;
    right: 24px;
    z-index: 99990;
    max-width: 360px;
    width: calc(100% - 32px);
    background-color: var(--efc-c-surface);
    border: 1px solid var(--efc-c-border-light);
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    box-sizing: border-box;
}

.efc-commerce-pill--hidden {
    transform: translateY(24px) scale(0.96);
    opacity: 0;
    pointer-events: none;
}

.efc-commerce-pill--visible {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.efc-commerce-pill__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    border-radius: 16px;
    transition: background-color 0.2s ease;
}

.efc-commerce-pill__link:hover {
    background-color: var(--efc-c-surface-hover);
}

.efc-commerce-pill__thumb-wrap {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    background-color: var(--efc-c-dark);
    border: 1px solid var(--efc-c-border);
}

.efc-commerce-pill__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.efc-commerce-pill__content {
    flex: 1;
    min-width: 0;
}

.efc-commerce-pill__badge {
    margin-bottom: 4px;
}

.efc-commerce-pill__title {
    margin: 0 0 4px 0;
    font-family: var(--efc-c-font-display);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--efc-c-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 18px; /* Espacio para el botón cerrar */
}

.efc-commerce-pill__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.efc-commerce-pill__cta {
    padding: 0.35rem 0.75rem;
    font-size: 0.6875rem;
}

.efc-commerce-pill__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--efc-c-gray);
    cursor: pointer;
    border-radius: 50%;
    transition: color 0.15s ease, background-color 0.15s ease;
    padding: 0;
    z-index: 10;
}

.efc-commerce-pill__close:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Ajustes Responsive para Pantallas Pequeñas */
@media (max-width: 640px) {
    .efc-commerce-pill {
        bottom: 85px;
        right: 16px;
        left: 16px;
        width: auto;
        max-width: none;
    }
}
