/* =========================================================
   AMIGO GARAGE - Tarjeta Digital
   Paleta: #e7e6e5 | #4a4a34 | #de4f21
   ========================================================= */

/* --- Variables & Reset --- */
:root {
    --cream:    #e7e6e5;
    --olive:    #4a4a34;
    --orange:   #de4f21;
    --orange-dark: #c03d17;
    --orange-light: #f26235;
    --white:    #ffffff;
    --card-radius: 28px;
    --header-radius: 28px;
    --body-radius: 28px;
    --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-card: 0 8px 40px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.16);
    --shadow-btn:  0 4px 18px rgba(222, 79, 33, 0.45);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100%;
    width: 100%;
    background: var(--cream);
    font-family: 'Barlow', sans-serif;
    color: var(--cream);
    -webkit-font-smoothing: antialiased;
}

/* Background subtle pattern */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 38px,
            rgba(255,255,255,0.025) 38px,
            rgba(255,255,255,0.025) 40px
        );
    pointer-events: none;
    z-index: 0;
}

/* =========================================================
   CARD WRAPPER
   ========================================================= */
.card-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    min-height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    /* Subtle card shadow on larger screens */
    box-shadow: var(--shadow-card);
}

/* =========================================================
   HEADER
   ========================================================= */
.card-header {
    position: relative;
    background: var(--cream);
    border-radius: 0 0 var(--header-radius) var(--header-radius);
    overflow: hidden;
    padding: 0;
    min-height: 160px;
    display: flex;
    align-items: stretch;
}

/* Textura de puerta de garage */
.header-texture {
    position: absolute;
    inset: 0;
    background-image: url('assets/img/textura.png');
    background-size: cover;
    background-position: center top;
    background-repeat: repeat-y;
    /* Fallback: líneas horizontales que simulan paneles de garage */
    background-color: #d8d6d3;
}

/* Si no carga la textura, aplicar el patrón CSS */
.header-texture::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            180deg,
            transparent 0px,
            transparent 28px,
            rgba(0,0,0,0.07) 28px,
            rgba(0,0,0,0.07) 30px
        ),
        repeating-linear-gradient(
            180deg,
            transparent 0px,
            transparent 58px,
            rgba(0,0,0,0.04) 58px,
            rgba(0,0,0,0.04) 62px
        );
    z-index: 0;
}

/* Contenido del header (logo + info) */
.header-content {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 24px 32px;
    gap: 10px;
}

.logo-img {
    width: auto;
    max-width: 300px;
    max-height: 300px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
    transition: transform var(--transition);
}

.logo-img:hover {
    transform: scale(1.02);
}

/* Barra de info debajo del logo (url + teléfono) */
.header-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    background: var(--orange);
    border-radius: 6px;
    padding: 6px 20px 7px;
    min-width: 220px;
    text-align: center;
}

.header-url {
    font-family: 'Barlow', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.92);
    letter-spacing: 0.3px;
    line-height: 1.4;
}

.header-phone {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--white);
    letter-spacing: 1px;
    line-height: 1.2;
}

/* =========================================================
   CARD BODY
   ========================================================= */
.card-body {
    position: relative;
    flex: 1;
    background: var(--olive);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    overflow: hidden;
    gap: 18px;
}

/* =========================================================
   BOTÓN PRIMARIO — GUARDAR CONTACTO
   ========================================================= */
.main-action {
    width: 100%;
    display: flex;
    justify-content: center;
}


.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--orange);
    color: var(--white);
    border: none;
    border-radius: 50px;
    padding: 14px 44px;
    font-family: 'Barlow', sans-serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    transition:
        background var(--transition),
        transform var(--transition),
        box-shadow var(--transition);
    width: 50%;
    max-width: 320px;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.18) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}

.btn-primary:hover {
    background: var(--orange-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(222, 79, 33, 0.55);
}

.btn-primary:hover::after {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 2px 10px rgba(222, 79, 33, 0.35);
}
.btn-icon-user-plus {
    width: 20px;
    height: 20px;
    stroke: var(--white);        /* Color blanco del botón */
    flex-shrink: 0;              /* No se comprime */
    display: inline-block;
}

/* Animación opcional al hacer hover */
.btn-primary:hover .btn-icon-user-plus {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Ícono dentro del botón primario */
/* =========================================
   ÍCONOS DENTRO DE BOTONES
   ========================================= */

/* 1. Íconos de imagen (PNG/JPG) */
.btn-icon {
    width: 20px;                   /* ✅ Uniforme con share-icon */
    height: 20px;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Vuelve blanco el ícono */
    display: block;                /* Evita espacios extra */
}

/* 2. Fallback SVG de usuario (CSS-only) */
.btn-icon-user {
    display: inline-block;
    width: 20px;
    height: 20px;
    position: relative;
    /* Sin background, el cuerpo se dibuja con ::after */
}

/* Cabeza del usuario */
.btn-icon-user::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--white);
    border-radius: 50%;
}

/* Cuerpo del usuario */
.btn-icon-user::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: var(--white);      /* ✅ Mismo color que la cabeza */
    border-radius: 6px 6px 0 0;
}

/* 3. Ícono de compartir (SVG inline) */
.share-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;                /* ✅ No se comprime */
    stroke: currentColor;          /* ✅ Hereda color del texto */
}

/* =========================================================
   TARJETA DE CONTACTO
   ========================================================= */
.contact-card {
    background: var(--white);
    color: #2a2a2a;;
    border-radius: 70px;
    width: 100%;
    position: relative; /* Contexto para posicionamiento absoluto */
    padding-bottom: 60px; /* Espacio para que el botón no tape contenido */
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    width: calc(90% - 20px);      /* 20px de margen a cada lado */
    margin: 50px auto;             /* Margen vertical + centrado */
    
    /* Altura basada en contenido, con límites */
    min-height: 150px;
    max-height: 70vh;              /* Máximo 60% del alto de la pantalla */
    overflow-y: auto;              /* Scroll si el contenido excede */
    
    padding: 20px;
    box-sizing: border-box;


}

.contact-row {
    color: #2a2a2a; 
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    text-decoration: none;
    transition: background var(--transition);
    cursor: default;
}

a.contact-row {
    cursor: pointer;
}

a.contact-row:hover {
    background: rgba(222, 79, 33, 0.05);
}

a.contact-row:active {
    background: rgba(222, 79, 33, 0.1);
}

/* Wrapper del ícono con borde cuadrado */
.contact-icon-wrap {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border: 2px solid #c8c8c8;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    overflow: hidden;
    transition: border-color var(--transition);
}

a.contact-row:hover .contact-icon-wrap {
    border-color: var(--orange);
}

.contact-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* Fallbacks CSS para íconos */
.contact-icon-fallback {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-text {
    font-family: 'Barlow', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #2a2a2a;
    line-height: 1.4;
    flex: 1;
}

.contact-divider {
    height: 1px;
    background: #ebebeb;
    margin: 0 20px;
}
.contact-text {
    white-space: pre-line;
}

/* =========================================================
   BOTÓN COMPARTIR
   ========================================================= */
/* ===== CONTENDOR DE POSICIÓN ===== */
.share-section {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;  /* Centrado con Flexbox */
    z-index: 50;
    pointer-events: none;
}
/* ===== BOTÓN VISUAL (Tus estilos originales) ===== */
.btn-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: var(--orange);
    color: var(--white);
    border: none;
    border-radius: 50px;
    padding: 20px 30px;
    font-family: 'Barlow', sans-serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    transition:
        background var(--transition),
        transform var(--transition),
        box-shadow var(--transition);
    width: 50%;
    max-width: 320px;
    pointer-events: auto;     /* ✅ Re-activa los clicks en el botón */
    margin: 0 auto;           /* ✅ Centra el botón dentro del contenedor */
}

/* ===== EFECTOS HOVER (Sin conflicto con el centrado) ===== */
.btn-share::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.18) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}

.btn-share:hover {
    background: var(--orange-dark);
    transform: translateY(-2px);  /* ✅ Este transform NO afecta el centrado */
    box-shadow: 0 8px 28px rgba(222, 79, 33, 0.55);
}

.btn-share:hover::after {
    opacity: 1;
}

.btn-share:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 2px 10px rgba(222, 79, 33, 0.35);
}

.share-icon {
    flex-shrink: 0;
    transition: transform var(--transition);
}

.btn-share:hover .share-icon {
    transform: rotate(15deg) scale(1.1);
}

/* =========================================================
   ANIMACIONES DE ENTRADA
   ========================================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    animation: fadeInDown 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.fade-in {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.2s;
}

/* =========================================================
   ESTADO: GUARDADO (feedback btn)
   ========================================================= */
.btn-primary.saved {
    background: #3a8a4a;
    box-shadow: 0 4px 18px rgba(58, 138, 74, 0.45);
}


.Textura {
    position: relative;
    width: 100%;          /* Clave: 100% del ancho del padre */
    height: 100%;         /* O un valor fijo, ej: 300px */
    display: block;
}

.Textura .textura {
    width: 100%;          /* Clave: 100% del ancho de .Textura */
    height: 100%;
    object-fit: cover;    /* Mantiene proporción sin deformar */
    display: block;       /* Elimina espacios extra de imágenes inline */
}

.textura-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.logo-img {
    max-width: 300px;
    height: auto;
}


/* =========================================================
   RESPONSIVE: desktop centrado
   ========================================================= */
@media (min-width: 480px) {
    body {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding: 32px 0 48px;
    }

    body::before {
        background:
            repeating-linear-gradient(
                0deg,
                transparent,
                transparent 38px,
                rgba(255,255,255,0.015) 38px,
                rgba(255,255,255,0.015) 40px
            );
    }

    .card-wrapper {
        min-height: auto;
        border-radius: var(--card-radius);
        overflow: hidden;
    }

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

@media (max-width: 479px) {
    .card-wrapper {
        box-shadow: none;
    }
}
