/**
 * Tarjeta digital — tokens Figma (Arena #ECEBD8, Verde #565132, iconos #CECCB7).
 */

:root {
    --mwm-vcard-bg: #ecebd8;
    --mwm-vcard-fg: #565132;
    --mwm-vcard-icon-bg: #ceccb7;
    --mwm-vcard-radius: 8px;
    --mwm-vcard-radius-pill: 96px;
    --mwm-vcard-space: 20px;
    --mwm-vcard-max: 420px;
}

.mwm-vcard-template-root {
    min-height: 40vh;
}

.mwm-vcard-body {
    margin: 0;
    min-height: 100vh;
    background: var(--mwm-vcard-bg);
    color: var(--mwm-vcard-fg);
    font-family: "Albert Sans", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.2;
    -webkit-font-smoothing: antialiased;
}

.mwm-vcard-body a {
    color: inherit;
    text-decoration: none;
}

.mwm-vcard {
    position: relative;
    max-width: var(--mwm-vcard-max);
    margin: 0 auto;
    padding: 48px var(--mwm-vcard-space) 120px;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Marca de agua decorativa */
.mwm-vcard__watermark {
    position: absolute;
    top: -20px;
    right: -32px;
    width: 180px;
    height: 220px;
    pointer-events: none;
    opacity: 0.35;
    z-index: 0;
}

.mwm-vcard__inner {
    position: relative;
    z-index: 1;
}

/* Cabecera logo + org */
.mwm-vcard__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.mwm-vcard__logo {
    flex-shrink: 0;
    max-height: 65px;
    width: auto;
    display: block;
}

.mwm-vcard__logo-placeholder {
    width: 102px;
    height: 32px;
    flex-shrink: 0;
}

.mwm-vcard__org {
    font-family: "Rethink Sans", system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
    margin: 0;
}

/* Eslogan */
.mwm-vcard__tagline {
    font-family: "Rethink Sans", system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin: 0 0 2.5rem;
    max-width: 16rem;
}

/* Nombre y cargo */
.mwm-vcard__name {
    font-family: "Rethink Sans", system-ui, sans-serif;
    font-weight: 700;
    font-size: 2rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
}

.mwm-vcard__title {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    margin: 0 0 1.75rem;
}

.mwm-vcard__photo {
    width: 100%;
    max-width: 200px;
    border-radius: var(--mwm-vcard-radius);
    margin: 0 0 1.5rem;
    display: block;
}

/* Acciones rápidas */
.mwm-vcard__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 2rem;
}

.mwm-vcard__action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--mwm-vcard-radius);
    box-sizing: border-box;
    text-align: center;
    font-size: 1rem;
    letter-spacing: -0.02em;
    border: 1px solid transparent;
}

.mwm-vcard__action--primary {
    background: var(--mwm-vcard-fg);
    color: var(--mwm-vcard-bg);
    border-color: var(--mwm-vcard-fg);
}

.mwm-vcard__action--primary .mwm-vcard__action-icon {
    color: var(--mwm-vcard-bg);
}

.mwm-vcard__action--outline {
    background: transparent;
    border: 1px solid var(--mwm-vcard-fg);
    color: var(--mwm-vcard-fg);
}

.mwm-vcard__action-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 7px;
    flex-shrink: 0;
}

.mwm-vcard__action-label {
    line-height: 1.2;
}

/* Filas de detalle */
.mwm-vcard__rows {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.mwm-vcard__row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.mwm-vcard__row-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--mwm-vcard-radius);
    background: var(--mwm-vcard-icon-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mwm-vcard__row-icon svg {
    width: 24px;
    height: 24px;
}

.mwm-vcard__row-icon--plain {
    background: transparent;
}

.mwm-vcard__row-body {
    flex: 1;
    min-width: 0;
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.mwm-vcard__row-label {
    font-weight: 400;
    margin: 0 0 4px;
}

.mwm-vcard__row-value {
    font-family: "Rethink Sans", system-ui, sans-serif;
    font-weight: 600;
    margin: 0;
    line-height: 1.35;
}

.mwm-vcard__row-values .mwm-vcard__row-value {
    margin-bottom: 0.25em;
}

.mwm-vcard__row-values .mwm-vcard__row-value:last-child {
    margin-bottom: 0;
}

.mwm-vcard__row-value a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Compartir */
.mwm-vcard__share-wrap {
    display: flex;
    justify-content: center;
    padding: 0 4px;
}

.mwm-vcard__share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    border-radius: var(--mwm-vcard-radius-pill);
    border: none;
    background: var(--mwm-vcard-fg);
    color: var(--mwm-vcard-bg);
    font-family: "Albert Sans", system-ui, sans-serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.02em;
    cursor: pointer;
    width: 100%;
    max-width: 320px;
    box-sizing: border-box;
}

.mwm-vcard__share svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.mwm-vcard__share:hover,
.mwm-vcard__share:focus-visible {
    filter: brightness(1.05);
    outline: 2px solid var(--mwm-vcard-fg);
    outline-offset: 2px;
}

/* Vista muy estrecha / reloj */
@media (max-width: 280px),
(max-height: 320px) {
    .mwm-vcard {
        padding-top: 24px;
        padding-bottom: 80px;
    }

    .mwm-vcard__tagline {
        display: none;
    }

    .mwm-vcard__name {
        font-size: 1.25rem;
    }

    .mwm-vcard__title {
        font-size: 0.875rem;
    }

    .mwm-vcard__actions {
        gap: 10px;
    }

    .mwm-vcard__action {
        width: 56px;
        height: 56px;
        font-size: 0.75rem;
    }

    .mwm-vcard__rows {
        gap: 1rem;
    }
}

@media (min-width: 480px) {
    .mwm-vcard__tagline {
        font-size: 1.5rem;
        max-width: none;
    }

    .mwm-vcard__name {
        font-size: 2rem;
    }
}

/* Barra fija: Añadir contacto + compartir QR (esquina inferior derecha) + modal */
.mwm-vcard-fab-bar {
    position: fixed;
    z-index: 99990;
    bottom: max(12px, env(safe-area-inset-bottom, 0));
    right: max(12px, env(safe-area-inset-right, 0));
    left: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
}

.mwm-vcard-fab-bar__contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    box-sizing: border-box;
    border-radius: var(--mwm-vcard-radius-pill);
    border: none;
    background: var(--mwm-vcard-fg);
    color: var(--mwm-vcard-bg);
    font-family: "Albert Sans", system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: -0.02em;
    text-decoration: none;
    line-height: 1.2;
    box-shadow: 0 2px 12px rgba(86, 81, 50, 0.25);
    -webkit-tap-highlight-color: transparent;
}

/* Sin efecto hover intencionado: el estado al pasar el cursor coincide con el base */
@media (hover: hover) {

    .mwm-vcard-fab-bar__contact:hover,
    .mwm-vcard-share-fab:hover {
        background: var(--mwm-vcard-fg);
        color: var(--mwm-vcard-bg);
        filter: none;
    }
}

.mwm-vcard-fab-bar__contact:focus-visible,
.mwm-vcard-fab-bar .mwm-vcard-share-fab:focus-visible {
    outline: 2px solid var(--mwm-vcard-fg);
    outline-offset: 2px;
}

.mwm-vcard-share-fab {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--mwm-vcard-fg);
    color: var(--mwm-vcard-bg);
    box-shadow: 0 2px 12px rgba(86, 81, 50, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

#mwm-vcard-qr-close:focus-visible {
    outline: 2px solid var(--mwm-vcard-fg);
    outline-offset: 2px;
}

body.mwm-vcard-qr-open #mwm-vcard-share-fab {
    visibility: hidden;
    pointer-events: none;
}

.mwm-vcard-share-fab__icon {
    display: flex;
    line-height: 0;
}

.mwm-vcard-qr-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    box-sizing: border-box;
}

.mwm-vcard-qr-modal[hidden] {
    display: none;
}

.mwm-vcard-qr-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(55, 52, 40, 0.42);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    cursor: pointer;
    z-index: 0;
}

#mwm-vcard-qr-close {
    position: fixed;
    z-index: 100001;
    bottom: max(12px, env(safe-area-inset-bottom, 0));
    right: max(12px, env(safe-area-inset-right, 0));
    left: auto;
    top: auto;
    margin: 0;
    flex-shrink: 0;
}

.mwm-vcard-qr-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 2rem max(20px, env(safe-area-inset-left, 0)) 5rem max(20px, env(safe-area-inset-right, 0));
    box-sizing: border-box;
    border-radius: 0;
    background: var(--mwm-vcard-bg);
    color: var(--mwm-vcard-fg);
    border: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
}

.mwm-vcard-qr-title {
    font-family: "Rethink Sans", system-ui, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
    text-align: center;
    max-width: 20rem;
}

.mwm-vcard-qr-hint {
    font-size: 0.875rem;
    line-height: 1.45;
    margin: 0 0 1.5rem;
    color: var(--mwm-vcard-fg);
    opacity: 0.88;
    text-align: center;
    max-width: 18rem;
}

.mwm-vcard-qr-img-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 14px 14px 10px;
    background: #fff;
    border: 1px solid var(--mwm-vcard-icon-bg);
    box-shadow: 0 1px 3px rgba(86, 81, 50, 0.06);
}

.mwm-vcard-qr-img {
    display: block;
    width: 220px;
    max-width: 100%;
    height: auto;
}