/* ===========================
   JOALEX – TARJETA DIGITAL
   Estilo: Dark + Red Cards
   =========================== */

:root {
    --bg:         #111111;
    --bg-header:  #181818;
    --red:        #E8354A;
    --red-dark:   #c42a3d;
    --red-glow:   rgba(232, 53, 74, 0.35);
    --white:      #FFFFFF;
    --gray:       rgba(255,255,255,0.55);
    --radius:     16px;
    --radius-btn: 30px;
    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: var(--white);
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height – iOS Safari fix */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
    line-height: 1.4;
}

/* ─── Background subtle glow ─── */
.bg-blur { display: none; }

/* ─── Card wrapper ─── */
.card-container {
    width: 100%;
    max-width: 420px;
    /* Reserve space for the fixed footer + iOS home bar */
    padding: 0 0 calc(110px + env(safe-area-inset-bottom, 0px));
    position: relative;
    z-index: 1;
}

/* ─── Header / Hero ─── */
.profile-header {
    background: var(--bg-header);
    text-align: center;
    padding: 20px 24px 16px;
    margin-bottom: 8px;
    animation: fadeInDown 0.7s ease-out;
    position: relative;
    overflow: hidden;
}

/* Subtle red radial glow behind photo */
.profile-header::before {
    content: '';
    position: absolute;
    top: 20px; left: 50%;
    transform: translateX(-50%);
    width: 220px; height: 220px;
    background: radial-gradient(circle, var(--red-glow) 0%, transparent 70%);
    pointer-events: none;
}

.profile-img-wrap {
    width: 150px;
    height: 150px;
    margin: 0 auto 10px;
    border-radius: 50%;
    border: 3px solid var(--red);
    box-shadow: 0 0 0 6px rgba(232,53,74,0.15), 0 12px 40px rgba(0,0,0,0.5);
    overflow: hidden;
    position: relative;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
    display: block;
}

.name {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
    color: var(--white);
}

.name span {
    color: var(--red);
}

.title {
    font-size: 0.82rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
}

/* ─── Grid ─── */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 10px 28px 0;
    animation: fadeInUp 0.7s ease-out 0.15s both;
}

/* ─── Each button ─── */
.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--white);
    background: var(--red);
    border-radius: var(--radius);
    aspect-ratio: 1 / 0.95;
    padding: 10px 6px 8px;
    gap: 6px;
    transition: var(--transition);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

/* Shine effect on top */
.action-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 45%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.12), transparent);
    border-radius: var(--radius) var(--radius) 0 0;
    pointer-events: none;
}

.action-item:active {
    transform: scale(0.92);
    background: var(--red-dark);
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

/* Icon */
.icon-box {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-box svg {
    width: 100%;
    height: 100%;
    stroke: var(--white);
    fill: none;
}

/* WhatsApp – fill icon */
.action-item.wa .icon-box svg {
    fill: var(--white);
    stroke: none;
}

/* Facebook / Instagram – fill icon */
.action-item .icon-box svg[fill="currentColor"] {
    fill: var(--white);
    stroke: none;
}

.action-item span {
    font-size: 0.68rem;
    font-weight: 600;
    text-align: center;
    color: var(--white);
    letter-spacing: 0.02em;
    line-height: 1.2;
}

/* ─── Footer ─── */
.footer-actions {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 420px;
    /* Respect iOS home bar / Dynamic Island safe area */
    padding: 16px 16px calc(28px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, var(--bg) 75%, transparent);
    display: flex;
    gap: 10px;
    z-index: 100;
}

.btn {
    flex: 1;
    height: 58px;
    border-radius: var(--radius-btn);
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    letter-spacing: 0.02em;
}

/* Save contact – white pill */
.btn-save {
    background: var(--white);
    color: #111;
    padding-left: 8px;
    box-shadow: 0 8px 24px rgba(255,255,255,0.12);
}

.btn-save:active { transform: scale(0.96); }

.footer-avatar {
    width: 40px;
    height: 40px;
    position: relative;
    border-radius: 50%;
    flex-shrink: 0;
}

.footer-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 40%;
}

.online-indicator {
    position: absolute;
    bottom: 1px; right: 1px;
    width: 10px; height: 10px;
    background: #25D366;
    border: 2px solid var(--white);
    border-radius: 50%;
}

/* Share – dark outlined pill */
.btn-share {
    background: rgba(255,255,255,0.07);
    color: var(--white);
    border: 1.5px solid rgba(255,255,255,0.15);
    max-width: 130px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-share:active { transform: scale(0.96); }

.icon-share svg {
    width: 20px;
    height: 20px;
    stroke: var(--white);
}

/* ─── Animations ─── */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-18px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

/* ─── Small phones (< 360px) ─── */
@media (max-width: 359px) {
    .actions-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 12px 16px 0;
    }

    .action-item {
        padding: 10px 4px 8px;
        gap: 6px;
    }

    .action-item span {
        font-size: 0.60rem;
    }

    .name {
        font-size: 1.45rem;
    }

    .profile-header {
        padding: 40px 16px 28px;
    }

    .btn {
        font-size: 0.82rem;
        height: 52px;
    }
}

/* ─── Desktop card frame ─── */
@media (min-width: 440px) {
    body {
        background: #0a0a0a;
        align-items: center;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 40px 0;
    }

    .card-container {
        border-radius: 40px;
        overflow: hidden;
        border: 1px solid rgba(255,255,255,0.08);
        box-shadow: 0 30px 80px rgba(0,0,0,0.7);
        padding-bottom: 0;
    }

    .profile-header {
        border-radius: 0;
    }

    .footer-actions {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        background: var(--bg);
        padding: 16px 16px 24px;
    }
}
