/*
 * krakryp/assets/css/promociones.css
 * Estilos de la sección pública "Promociones" (promociones.php).
 * Misma línea visual que Mercado (azul oscuro + dorado). Prefijo .pr-
 */

.pr-page {
    overflow-x: clip;
    --pr-gold: #DAA520;
    --pr-gold-light: #FFD700;
    --pr-gold-soft: #fdf6e3;
    --pr-ink: #2c3e50;
    --pr-ink-2: #34495e;
    --pr-muted: #6c7a89;
    --pr-line: #e6e9ec;
    --pr-bg: #f4f7f6;
    --pr-white: #ffffff;
    --pr-dark: #1f2d3a;
    --pr-up: #059669;
    --pr-down: #dc2626;
    --pr-radius: 16px;

    color: var(--pr-ink);
}

.pr-page h2 {
    font-weight: 700;
    font-size: clamp(1.5rem, 2.6vw, 2.1rem);
    line-height: 1.2;
    margin-bottom: .5rem;
}

.pr-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--pr-gold-light);
    margin-bottom: .75rem;
}

.pr-eyebrow--dark { color: var(--pr-gold); }

/* ---------- Cabecera ---------- */
.pr-hero {
    background: linear-gradient(135deg, var(--pr-dark) 0%, var(--pr-ink) 100%);
    color: var(--pr-white);
    padding: clamp(2.75rem, 7vw, 5rem) 0;
    position: relative;
    overflow: hidden;
}

.pr-hero::after {
    content: "";
    position: absolute;
    left: -140px;
    bottom: -160px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, .22), transparent 70%);
    pointer-events: none;
}

.pr-hero .container { position: relative; z-index: 1; }

.pr-hero-title {
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3rem);
    line-height: 1.12;
    margin-bottom: 1rem;
}

.pr-hero-lead {
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    max-width: 640px;
    color: rgba(255, 255, 255, .82);
    margin-bottom: 1.75rem;
}

.pr-counters {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pr-counters a {
    display: inline-block;
    padding: .5rem 1.1rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .06);
    color: var(--pr-white);
    font-weight: 600;
    font-size: .92rem;
    text-decoration: none;
    transition: border-color .2s, background-color .2s;
}

.pr-counters a:hover { border-color: var(--pr-gold-light); background: rgba(255, 255, 255, .1); color: var(--pr-white); }
.pr-counters strong { color: var(--pr-gold-light); }

/* ---------- Secciones ---------- */
.pr-section {
    padding: clamp(2.75rem, 6vw, 4.5rem) 0;
    scroll-margin-top: 20px;
}

.pr-section--alt { background: var(--pr-white); }

.pr-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.pr-section-head p { color: var(--pr-muted); margin: 0; }

/* Estado de los precios */
.pr-status {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .9rem;
    border-radius: 50px;
    background: var(--pr-white);
    border: 1px solid var(--pr-line);
    font-size: .85rem;
    font-weight: 600;
    color: var(--pr-muted);
}

.pr-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9aa5b1;
}

.pr-status[data-state="live"]  { color: var(--pr-up); }
.pr-status[data-state="live"] .pr-status-dot { background: var(--pr-up); animation: pr-pulse 1.8s infinite; }
.pr-status[data-state="stale"] { color: #b7791f; }
.pr-status[data-state="stale"] .pr-status-dot { background: #d69e2e; }
.pr-status[data-state="error"] { color: var(--pr-down); }
.pr-status[data-state="error"] .pr-status-dot { background: var(--pr-down); }

@keyframes pr-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(5, 150, 105, .45); }
    70%  { box-shadow: 0 0 0 7px rgba(5, 150, 105, 0); }
    100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

/* ---------- Criptomonedas promocionadas ---------- */
.pr-coin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.25rem;
}

.pr-coin {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1.4rem;
    border-radius: var(--pr-radius);
    background: var(--pr-white);
    border: 1px solid var(--pr-line);
    box-shadow: 0 2px 6px rgba(44, 62, 80, .04);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
}

.pr-coin:hover {
    transform: translateY(-4px);
    border-color: var(--pr-gold);
    box-shadow: 0 12px 26px rgba(44, 62, 80, .09);
}

.pr-coin-flag {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .6rem;
    margin-bottom: .9rem;
    border-radius: 50px;
    background: var(--pr-gold-soft);
    border: 1px solid rgba(218, 165, 32, .45);
    color: #8a6d0b;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.pr-coin-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.1rem;
    min-width: 0;
}

.pr-coin-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: contain;
    background: var(--pr-bg);
    flex-shrink: 0;
}

.pr-coin-meta { display: flex; flex-direction: column; min-width: 0; }
.pr-coin-symbol { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.pr-coin-name {
    font-size: .85rem;
    color: var(--pr-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pr-coin-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .25rem .6rem;
    margin-bottom: .9rem;
}

.pr-price {
    font-size: 1.55rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pr-change {
    font-size: .88rem;
    font-weight: 700;
    padding: .1rem .5rem;
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
}

.pr-change.is-up   { color: var(--pr-up);   background: rgba(5, 150, 105, .1); }
.pr-change.is-down { color: var(--pr-down); background: rgba(220, 38, 38, .1); }

.pr-coin-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    margin: 0 0 1.2rem;
    padding: .7rem .8rem;
    border-radius: 10px;
    background: var(--pr-bg);
}

.pr-coin-range dt { font-size: .74rem; font-weight: 600; color: var(--pr-muted); margin-bottom: .1rem; }
.pr-coin-range dd { margin: 0; font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.pr-coin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .55rem;
    margin-top: auto;
}

/* ---------- Botones ---------- */
.pr-btn {
    box-sizing: border-box;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .65rem 1.1rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: .93rem;
    text-decoration: none;
    border: 2px solid transparent;
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s, color .2s;
}

.pr-btn:hover { transform: translateY(-2px); }
.pr-btn:focus-visible { outline: 3px solid var(--pr-gold-light); outline-offset: 3px; }

.pr-btn--buy  { background: var(--pr-up); color: var(--pr-white); }
.pr-btn--buy:hover  { color: var(--pr-white); box-shadow: 0 6px 16px rgba(5, 150, 105, .3); }
.pr-btn--sell { background: var(--pr-white); color: var(--pr-down); border-color: rgba(220, 38, 38, .45); }
.pr-btn--sell:hover { color: var(--pr-white); background: var(--pr-down); border-color: var(--pr-down); }

.pr-btn--gold {
    padding: .8rem 1.6rem;
    background: linear-gradient(45deg, var(--pr-gold-light), var(--pr-gold));
    color: var(--pr-ink);
    flex-shrink: 0;
}

.pr-btn--gold:hover { color: var(--pr-ink); box-shadow: 0 8px 20px rgba(218, 165, 32, .35); }

.pr-btn--dark { padding: .8rem 1.6rem; background: var(--pr-ink); color: var(--pr-white); }
.pr-btn--dark:hover { color: var(--pr-gold-light); }

/* ---------- Anuncios patrocinados ---------- */
.pr-ad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.5rem;
}

.pr-ad {
    display: flex;
    flex-direction: column;
    border-radius: var(--pr-radius);
    overflow: hidden;
    background: var(--pr-white);
    border: 1px solid var(--pr-line);
    transition: transform .25s ease, box-shadow .25s ease;
}

.pr-ad:hover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(44, 62, 80, .09); }

.pr-ad-media {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--pr-bg);
}

.pr-ad-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pr-ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--pr-dark), var(--pr-ink));
    color: var(--pr-gold-light);
    font-size: 2.2rem;
}

.pr-ad-badge {
    position: absolute;
    top: .8rem;
    left: .8rem;
    padding: .25rem .65rem;
    border-radius: 50px;
    background: rgba(31, 45, 58, .85);
    color: var(--pr-gold-light);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.pr-ad-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.3rem 1.4rem 1.4rem;
}

.pr-ad-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: .45rem;
}

.pr-ad-body p {
    color: var(--pr-muted);
    font-size: .93rem;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pr-ad-link {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .6rem .9rem;
    border-radius: 10px;
    background: var(--pr-bg);
    color: var(--pr-ink);
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    transition: background-color .2s, color .2s;
}

.pr-ad-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-ad-link:hover { background: var(--pr-ink); color: var(--pr-gold-light); }

/* ---------- Sin promociones ---------- */
.pr-empty {
    max-width: 620px;
    margin: 0 auto;
    text-align: center;
    padding: clamp(2rem, 5vw, 3rem);
    border-radius: var(--pr-radius);
    background: var(--pr-white);
    border: 1px dashed #cfd6dd;
}

.pr-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--pr-gold-soft);
    color: var(--pr-gold);
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.pr-empty p { color: var(--pr-muted); margin-bottom: 1.5rem; }

/* ---------- Anúnciate ---------- */
.pr-cta { padding: 0 0 clamp(2.75rem, 6vw, 4.5rem); }
.pr-section--alt + .pr-cta { background: var(--pr-white); }

.pr-cta-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: clamp(1.5rem, 4vw, 2.25rem);
    border-radius: var(--pr-radius);
    background: linear-gradient(135deg, var(--pr-dark), var(--pr-ink));
    color: var(--pr-white);
}

.pr-cta-box h2 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
.pr-cta-box p { color: rgba(255, 255, 255, .78); margin: 0; max-width: 560px; }

/* ---------- Responsive ---------- */
@media (max-width: 575.98px) {
    .pr-cta-box { flex-direction: column; align-items: flex-start; }
    .pr-cta-box .pr-btn { width: 100%; }
    .pr-section-head { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .pr-coin, .pr-ad, .pr-btn { transition: none; }
    .pr-coin:hover, .pr-ad:hover, .pr-btn:hover { transform: none; }
    .pr-status[data-state="live"] .pr-status-dot { animation: none; }
}
