/* ==========================================================
   RESET Y VARIABLES BASE (UNIVERSAL / NEUTRO)
   ========================================================== */
:root {
    /* Variables de acento dinámicas (sobrescritas por themes/*.css) */
    --primary-color: #38bdf8;
    --primary-gradient: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    --accent-secondary: #7dd3fc;
    --accent-glow: rgba(56, 189, 248, 0.25);
    --btn-border: rgba(56, 189, 248, 0.35);
    --btn-shadow: rgba(56, 189, 248, 0.45);

    /* Textos y neutros */
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --card-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden; /* Cero scroll en móvil y desktop */
    background-color: #080808;
}

body {
    height: 100vh;
    height: 100dvh; /* Altura dinámica real considerando barras de navegación móviles */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

/* ==========================================================
   CONTENEDOR TARJETA (SIN SCROLL / FULL SCREEN FIT)
   ========================================================== */
.card-container {
    width: 100%;
    max-width: 430px;
    height: 100%;
    max-height: 100dvh;
    background-color: #121212;
    border-radius: 0; /* En móvil completo abarca toda la pantalla */
    padding: clamp(14px, 2.5dvh, 24px) 18px clamp(12px, 2dvh, 20px);
    box-shadow: 0 0 25px var(--accent-glow);
    border: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Distribuye cabecera, botones y servicios uniformemente */
    align-items: center;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

/* En pantallas grandes (PC/Tablet) conserva estética de mockup redondeado */
@media (min-width: 480px) and (min-height: 700px) {
    .card-container {
        height: auto;
        min-height: min(92dvh, 840px);
        max-height: 94dvh;
        border-radius: 36px;
        border: 2px solid var(--btn-border);
        padding: 24px 22px 20px;
    }
}

/* IMAGEN DE FONDO ABSOLUTA */
.card-bg-layer {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    z-index: 0 !important;
    display: none;
}

/* CAPA OSCURA DE CONTRASTE */
.card-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1 !important;
    pointer-events: none;
}

/* CAPAS FRONTALES */
.card-header,
.save-contact-container,
.links-section,
.services-grid,
.card-footer {
    position: relative !important;
    z-index: 2 !important;
    width: 100%;
}

/* ==========================================================
   1. CABECERA Y LOGO DINÁMICOS
   ========================================================== */
.card-header {
    text-align: center;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.logo-wrapper {
    width: clamp(75px, 12dvh, 105px);
    height: clamp(75px, 12dvh, 105px);
    margin: 0 auto clamp(6px, 1dvh, 12px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: visible;
}

.logo-wrapper img {
    position: relative;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.85));
}

.business-prefix {
    font-size: clamp(10px, 1.4dvh, 12px);
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.business-name {
    font-size: clamp(20px, 3dvh, 25px);
    font-weight: 800;
    color: #ffffff;
    line-height: 1.15;
    margin-bottom: 2px;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.business-category {
    font-size: clamp(9px, 1.2dvh, 11px);
    font-weight: 600;
    letter-spacing: 1.2px;
    color: var(--accent-secondary);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.business-tagline {
    font-size: clamp(10px, 1.3dvh, 11px);
    color: #cccccc;
    font-weight: 300;
}

/* ==========================================================
   BOTÓN GUARDAR CONTACTO / COPIAR TELÉFONO
   ========================================================== */
.save-contact-container {
    margin: clamp(4px, 1dvh, 10px) 0;
}

.save-contact-btn {
    width: 100%;
    padding: clamp(9px, 1.5dvh, 13px) 16px;
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-size: clamp(12px, 1.6dvh, 13px);
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--btn-shadow);
    transition: transform 0.15s ease, filter 0.2s ease;
}

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

/* ==========================================================
   2. BOTONES INTERACTIVOS (CTAs COMPACTOS)
   ========================================================== */
.links-section {
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.1dvh, 10px);
    margin: clamp(4px, 1dvh, 10px) 0;
}

.action-btn {
    display: flex;
    align-items: center;
    text-decoration: none;
    background: rgba(18, 18, 18, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50px;
    padding: clamp(6px, 1dvh, 9px) 14px;
    border: 1px solid var(--btn-border);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.action-btn:active {
    transform: scale(0.98);
}

.btn-icon {
    width: clamp(34px, 4.8dvh, 40px);
    height: clamp(34px, 4.8dvh, 40px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    font-size: clamp(15px, 2.2dvh, 18px);
    flex-shrink: 0;
}

.btn-text {
    flex-grow: 1;
    margin-left: 12px;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.btn-title {
    font-size: clamp(13px, 1.8dvh, 14px);
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
}

.btn-subtitle {
    font-size: clamp(8px, 1.1dvh, 9.5px);
    font-weight: 600;
    color: #a3a3a3;
    letter-spacing: 0.4px;
}

.btn-arrow {
    color: var(--primary-color);
    font-size: 11px;
    margin-right: 2px;
}

/* ==========================================================
   3. SERVICIOS (4 COLUMNAS AUTO-AJUSTABLES)
   ========================================================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding-top: clamp(6px, 1dvh, 12px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: clamp(4px, 0.8dvh, 8px);
}

.service-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3px;
}

.service-item i {
    font-size: clamp(14px, 2dvh, 17px);
    color: var(--primary-color);
    text-shadow: 0 0 8px var(--accent-glow);
}

.service-item span {
    font-size: clamp(7.5px, 1dvh, 8.5px);
    font-weight: 700;
    color: #cccccc;
    letter-spacing: 0.3px;
}

/* ==========================================================
   4. PIE DE PÁGINA (FIRMA)
   ========================================================== */
.card-footer {
    text-align: center;
    margin-top: 0;
}

.signature-text {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(18px, 2.5dvh, 22px);
    color: var(--accent-secondary);
    position: relative;
    display: inline-block;
}

.signature-text::before,
.signature-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 20px;
    height: 1px;
    background-color: #333333;
}

.signature-text::before {
    right: 100%;
    margin-right: 10px;
}

.signature-text::after {
    left: 100%;
    margin-left: 10px;
}