/* ============================================
   AUTHORITY SECTION — "¿Por qué Fungiverse?"
   Inspirado en "Why Thorne?" de thorne.com
   ============================================ */

.fv-authority {
    padding: clamp(60px, 8vw, 120px) 0;
    background: linear-gradient(180deg, #0a0a0a 0%, #111 50%, #0a0a0a 100%);
    position: relative;
    overflow: hidden;
}

.fv-authority::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(232, 77, 68, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.fv-authority__header {
    text-align: center;
    margin-bottom: clamp(40px, 5vw, 64px);
    position: relative;
    z-index: 1;
}

.fv-authority__eyebrow {
    display: inline-block;
    font-family: var(--fv-font-body, 'Inter', sans-serif);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--fv-color-accent, #e84d44);
    border: 1px solid rgba(232, 77, 68, 0.3);
    border-radius: 100px;
    padding: 6px 18px;
    margin-bottom: 16px;
}

.fv-authority__title {
    font-family: var(--fv-font-heading, 'Cubano', sans-serif);
    font-size: clamp(1.75rem, 3.5vw, 2.75rem);
    color: #fff;
    margin: 0 0 12px 0;
    line-height: 1.15;
}

.fv-authority__subtitle {
    font-family: var(--fv-font-body, 'Inter', sans-serif);
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* Grid de 4 cards */
.fv-authority__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    position: relative;
    z-index: 1;
}

/* Card base */
.fv-authority__card {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: clamp(28px, 3vw, 40px) clamp(20px, 2vw, 28px);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    min-height: 220px;
    display: flex;
    flex-direction: column;
}

/* Cuando está expandida, la card crece con el contenido */
.fv-authority__card.is-expanded {
    min-height: 0;
    overflow: visible;
    cursor: default;
}

.fv-authority__card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(232, 77, 68, 0.05) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: inherit;
}

.fv-authority__card:hover {
    border-color: rgba(232, 77, 68, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.fv-authority__card:hover::before {
    opacity: 1;
}

/* Card front */
.fv-authority__card-front {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    transition: opacity 0.3s ease;
}

.fv-authority__card-icon {
    font-size: 2rem;
    color: var(--fv-color-accent, #e84d44);
    margin-bottom: 16px;
    line-height: 1;
}

.fv-authority__card-title {
    font-family: var(--fv-font-heading, 'Cubano', sans-serif);
    font-size: clamp(1.1rem, 1.8vw, 1.35rem);
    color: #fff;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.fv-authority__card-tagline {
    font-family: var(--fv-font-body, 'Inter', sans-serif);
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.45);
    margin: 0 0 auto 0;
    line-height: 1.5;
}

.fv-authority__card-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    font-family: var(--fv-font-body, 'Inter', sans-serif);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--fv-color-accent, #e84d44);
    letter-spacing: 0.02em;
    transition: gap 0.3s ease;
}

.fv-authority__card:hover .fv-authority__card-more {
    gap: 10px;
}

/* Card detail (expandido) — hidden por defecto */
.fv-authority__card-detail {
    display: none;
    flex-direction: column;
    padding: clamp(24px, 3vw, 36px);
    background: linear-gradient(145deg, rgba(30, 12, 12, 0.97) 0%, rgba(15, 15, 15, 0.98) 100%);
    border-radius: inherit;
    opacity: 0;
    animation: fv-detail-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Cuando la card está expandida: el front se oculta y el detail ocupa el flujo */
.fv-authority__card.is-expanded {
    padding: 0;
    /* border mantiene color acento */
    border-color: rgba(232, 77, 68, 0.25);
}

.fv-authority__card.is-expanded .fv-authority__card-front {
    display: none;
}

.fv-authority__card.is-expanded .fv-authority__card-detail {
    display: flex;
}

@keyframes fv-detail-in {
    from {
        opacity: 0;
        transform: scale(0.97);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fv-authority__card-detail p {
    font-family: var(--fv-font-body, 'Inter', sans-serif);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.65;
    margin: 0 0 20px 0;
}

.fv-authority__card-close {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--fv-font-body, 'Inter', sans-serif);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fv-authority__card-close:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}


/* ============================================
   POP-UP — Primera compra 20% OFF
   ============================================ */

.fv-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.fv-popup-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.fv-popup-overlay.is-closing {
    opacity: 0;
    visibility: hidden;
}

.fv-popup {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: linear-gradient(160deg, #1a1a1a 0%, #0f0f0f 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: clamp(36px, 5vw, 48px) clamp(28px, 4vw, 40px);
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.fv-popup-overlay.is-visible .fv-popup {
    transform: scale(1) translateY(0);
}

/* Botón de cierre — BIEN VISIBLE */
.fv-popup__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.fv-popup__close:hover {
    background: rgba(232, 77, 68, 0.2);
    border-color: rgba(232, 77, 68, 0.4);
    transform: rotate(90deg);
}

.fv-popup__icon {
    font-size: 2.8rem;
    color: var(--fv-color-accent, #e84d44);
    margin-bottom: 12px;
    line-height: 1;
}

.fv-popup__eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 10px 0;
    padding: 7px 12px;
    border: 1px solid rgba(232, 77, 68, 0.3);
    border-radius: 999px;
    color: var(--fv-color-accent, #e84d44);
    font-family: var(--fv-font-body, 'Inter', sans-serif);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1;
    text-transform: uppercase;
}

.fv-popup__title {
    font-family: var(--fv-font-heading, 'Cubano', sans-serif);
    font-size: clamp(2.2rem, 5vw, 3rem);
    color: #fff;
    margin: 0;
    line-height: 1;
}

.fv-popup__subtitle {
    font-family: var(--fv-font-body, 'Inter', sans-serif);
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: rgba(255, 255, 255, 0.5);
    margin: 8px 0 22px 0;
    font-weight: 400;
}

.fv-popup__form {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.fv-popup__input {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #fff;
    font-family: var(--fv-font-body, 'Inter', sans-serif);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.fv-popup__input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.fv-popup__input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(232, 77, 68, 0.55);
    box-shadow: 0 0 0 3px rgba(232, 77, 68, 0.14);
}

.fv-popup__detail {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 18px;
    margin: 0 0 16px 0;
}

.fv-popup__detail p {
    font-family: var(--fv-font-body, 'Inter', sans-serif);
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin: 0;
}

.fv-popup__detail strong {
    color: #fff;
}

.fv-popup__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: var(--fv-color-accent, #e84d44);
    color: #fff;
    font-family: var(--fv-font-body, 'Inter', sans-serif);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    padding: 14px 32px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fv-popup__cta:hover:not(:disabled) {
    background: #d43d34;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(232, 77, 68, 0.3);
    color: #fff;
}

.fv-popup__cta:disabled {
    cursor: progress;
    opacity: 0.75;
}

.fv-popup__status {
    min-height: 20px;
    margin: 0 0 14px 0;
    color: rgba(255, 255, 255, 0.55);
    font-family: var(--fv-font-body, 'Inter', sans-serif);
    font-size: 0.86rem;
    line-height: 1.45;
}

.fv-popup__status--success {
    color: #66ae4c;
}

.fv-popup__status--error {
    color: #f07068;
}

.fv-popup__status--loading {
    color: rgba(255, 255, 255, 0.75);
}

.fv-popup__shop-link {
    display: inline-flex;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.58);
    font-family: var(--fv-font-body, 'Inter', sans-serif);
    font-size: 0.82rem;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: color 0.2s ease;
}

.fv-popup__shop-link:hover {
    color: #fff;
}

.fv-popup__dismiss {
    display: block;
    margin: 0 auto;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    font-family: var(--fv-font-body, 'Inter', sans-serif);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease;
}

.fv-popup__dismiss:hover {
    color: rgba(255, 255, 255, 0.6);
}


/* ============================================
   RESPONSIVE — Authority + Popup
   ============================================ */

@media (max-width: 1024px) {
    .fv-authority__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .fv-authority__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .fv-authority__card {
        min-height: auto;
    }

    .fv-popup {
        max-width: 340px;
        padding: 32px 24px;
    }
}
