/* =================================================================
   MAQUETAS: iPhone con IVP Invest + ventana de navegador
   Todo lo que hay dentro de la pantalla se mide en --u (1/375 del ancho),
   así la maqueta se puede usar a cualquier tamaño.
   ================================================================ */

.iphone {
    --w: 300px;
    position: relative;
    width: var(--w);
    flex: none;
    border-radius: calc(var(--w) * .178);
    filter: drop-shadow(0 calc(var(--w) * .1) calc(var(--w) * .13) rgba(4, 8, 30, .38));
}

.iphone__frame {
    position: relative;
    padding: calc(var(--w) * .033);
    border-radius: inherit;
    background: #050506;
    box-shadow:
        inset 0 0 0 calc(var(--w) * .0055) #5a5c63,
        inset 0 0 0 calc(var(--w) * .012) #c3c5cb,
        inset 0 0 0 calc(var(--w) * .016) #45464c,
        inset 0 0 calc(var(--w) * .02) calc(var(--w) * .012) rgba(255, 255, 255, .35);
}
/* Brillo del cristal */
.iphone__frame::after {
    content: "";
    position: absolute;
    inset: calc(var(--w) * .033);
    border-radius: calc(var(--w) * .145);
    background: linear-gradient(118deg, rgba(255, 255, 255, .13) 0, rgba(255, 255, 255, .03) 26%, transparent 40%);
    pointer-events: none;
    z-index: 9;
}

.iphone__key {
    position: absolute;
    width: calc(var(--w) * .012);
    border-radius: 2px;
    background: linear-gradient(90deg, #5d5f65, #a4a6ac 50%, #4a4b50);
}
.iphone__key--action { left: calc(var(--w) * -.008); top: 15%; height: 4%; }
.iphone__key--up { left: calc(var(--w) * -.008); top: 22%; height: 7.5%; }
.iphone__key--down { left: calc(var(--w) * -.008); top: 31.5%; height: 7.5%; }
.iphone__key--power { right: calc(var(--w) * -.008); top: 25%; height: 12%; }

.iphone__screen {
    --u: calc(100cqw / 375);
    container-type: inline-size;
    position: relative;
    aspect-ratio: 375 / 812;
    overflow: hidden;
    border-radius: calc(var(--w) * .145);
    background: #000;
    color: #fff;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    line-height: 1;
    -webkit-user-select: none;
    user-select: none;
    isolation: isolate;
}
.iphone__screen > * { --u: calc(100cqw / 375); }

.ios-status {
    position: absolute;
    inset: 0 0 auto;
    height: calc(52 * var(--u));
    padding: calc(5 * var(--u)) calc(27 * var(--u)) 0 calc(38 * var(--u));
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 6;
}
.ios-status b { font-size: calc(16 * var(--u)); font-weight: 600; letter-spacing: -.01em; }
.ios-status__icons { display: flex; align-items: center; gap: calc(5 * var(--u)); }
.ios-status__icons svg { height: calc(12 * var(--u)); width: auto; max-width: none; }
.ios-status__icons svg:nth-child(2) { height: calc(17 * var(--u)); }

.iphone__island {
    position: absolute;
    top: calc(11 * var(--u));
    left: 50%;
    width: calc(112 * var(--u));
    height: calc(32 * var(--u));
    margin-left: calc(-56 * var(--u));
    border-radius: 99px;
    background: #000;
    
    z-index: 8;
}
.iphone__island::after {
    content: "";
    position: absolute;
    right: calc(9 * var(--u));
    top: calc(10 * var(--u));
    width: calc(12 * var(--u));
    height: calc(12 * var(--u));
    border-radius: 50%;
    background: radial-gradient(circle at 38% 38%, #2b3e78 0, #0d1330 45%, #05060c 70%);
}

/* ---------- Barra superior de la app ---------- */
.app-head {
    position: absolute;
    inset: calc(52 * var(--u)) 0 auto;
    height: calc(43 * var(--u));
    padding: 0 calc(10 * var(--u)) 0 calc(11 * var(--u));
    display: flex;
    align-items: center;
    background: #000;
    z-index: 3;
}
.app-head__logo {
    width: calc(25 * var(--u));
    height: calc(25 * var(--u));
    display: grid;
    place-items: center;
    border-radius: calc(5 * var(--u));
    background: #0b1028;
}
.app-head__logo svg { width: calc(18 * var(--u)); }
.app-head b { flex: 1; padding-left: calc(6 * var(--u)); font-size: calc(14 * var(--u)); font-weight: 700; letter-spacing: -.02em; }
.app-head__search, .app-head__bell { position: relative; width: calc(38 * var(--u)); display: grid; place-items: center; }
.app-head__search svg, .app-head__bell svg { width: calc(16 * var(--u)); }
.app-head__bell { color: #a3a3a8; }
.app-head__bell em {
    position: absolute;
    top: calc(-9 * var(--u));
    right: calc(3 * var(--u));
    width: calc(14 * var(--u));
    height: calc(14 * var(--u));
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ff5a5f;
    color: #fff;
    font: 700 calc(9 * var(--u))/1 Inter, Arial, sans-serif;
    letter-spacing: 0;
}
.app-head__bell em[hidden] { display: none; }
.app-head__plus {
    width: calc(33 * var(--u));
    height: calc(33 * var(--u));
    margin-left: calc(5 * var(--u));
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    color: #000;
}
.app-head__plus svg { width: calc(15 * var(--u)); }

/* ---------- Contenido ---------- */
.app-body {
    position: absolute;
    inset: calc(95 * var(--u)) 0 calc(73 * var(--u));
    overflow: hidden;
    container-type: size;
}
.app-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-width: none;
    height: auto;
    opacity: 0;
    transform: translateX(8%);
    transition: opacity .35s ease, transform .5s cubic-bezier(.22, 1, .36, 1);
    pointer-events: none;
}
.app-screen.is-active { opacity: 1; transform: none; }
/* La pantalla activa se desplaza sola, como si alguien hiciera scroll */
.app-screen.is-active { animation: app-pan 5s 1.1s cubic-bezier(.65, 0, .35, 1) infinite alternate; }
@keyframes app-pan {
    0%, 15% { translate: 0 0; }
    85%, 100% { translate: 0 calc(100cqh - 100%); }
}

/* ---------- Pestañas ---------- */
.app-tabs {
    position: absolute;
    inset: auto 0 0;
    height: calc(73 * var(--u));
    padding-bottom: calc(19 * var(--u));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: #000;
    border-top: 1px solid #161618;
    z-index: 4;
}
.app-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: calc(5 * var(--u));
    margin: 0;
    padding: calc(4 * var(--u)) 0 0;
    border: 0;
    background: none;
    color: #8a8a90;
    font: 600 calc(9.5 * var(--u))/1 Inter, -apple-system, "Segoe UI", Arial, sans-serif;
    letter-spacing: -.01em;
    transition: color .2s ease;
    -webkit-tap-highlight-color: transparent;
}
.app-tab svg { width: calc(20 * var(--u)); transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.app-tab.is-active { color: #fff; }
button.app-tab { cursor: pointer; }
button.app-tab:hover { color: #fff; }
button.app-tab:active svg { transform: scale(.82); }
.iphone :focus-visible { outline: 2px solid #4aa3ff; outline-offset: -3px; border-radius: calc(10 * var(--u)); }

/* Toque simulado */
.app-tap::after, .app-hot.app-tap::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(46 * var(--u));
    height: calc(46 * var(--u));
    margin: calc(-23 * var(--u)) 0 0 calc(-23 * var(--u));
    border-radius: 50%;
    background: rgba(255, 255, 255, .32);
    animation: app-tap .6s ease-out both;
    pointer-events: none;
}
@keyframes app-tap { 0% { transform: scale(.3); opacity: 0; } 35% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }

/* ---------- Menú «Más» ---------- */
.app-sheet {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(0, 0, 0, .6);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility 0s linear .4s;
}
.app-sheet.is-open { opacity: 1; visibility: visible; transition: opacity .3s ease; }
.app-sheet__panel {
    position: absolute;
    inset: auto 0 0;
    padding: calc(8 * var(--u)) 0 calc(22 * var(--u));
    border-radius: calc(22 * var(--u)) calc(22 * var(--u)) 0 0;
    background: #111;
    transform: translateY(100%);
    transition: transform .45s cubic-bezier(.22, 1, .36, 1);
}
.app-sheet.is-open .app-sheet__panel { transform: none; }
.app-sheet__panel img { width: 100%; max-width: none; height: auto; }
.app-hot {
    position: absolute;
    padding: 0;
    border: 0;
    border-radius: calc(16 * var(--u));
    background: transparent;
    cursor: pointer;
    overflow: visible;
    transition: background .2s ease;
}
.app-hot:hover { background: rgba(255, 255, 255, .07); }
.app-hot--close { right: calc(10 * var(--u)); top: calc(18 * var(--u)); width: calc(40 * var(--u)); height: calc(40 * var(--u)); }
.app-hot--cal, .app-hot--res, .app-hot--emp { top: calc(188 * var(--u)); width: calc(114 * var(--u)); height: calc(68 * var(--u)); }
.app-hot--cal { left: calc(9 * var(--u)); }
.app-hot--res { left: calc(130 * var(--u)); }
.app-hot--emp { left: calc(250 * var(--u)); }

.iphone__home {
    position: absolute;
    bottom: calc(8 * var(--u));
    left: 50%;
    width: calc(134 * var(--u));
    height: calc(5 * var(--u));
    margin-left: calc(-67 * var(--u));
    border-radius: 9px;
    background: #fff;
    z-index: 7;
    pointer-events: none;
}

/* =================================================================
   VENTANA DE NAVEGADOR
   ================================================================ */
.win {
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(8, 12, 34, .08), 0 40px 80px -30px rgba(4, 8, 40, .55);
}
.win__bar {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    background: #f4f5f8;
}
.win__bar i { width: 9px; height: 9px; border-radius: 50%; background: #d3d6de; }
.win__bar span {
    margin-left: 10px;
    padding: 4px 12px;
    border-radius: 6px;
    background: #fff;
    color: #6a7080;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}
.win img { width: 100%; height: auto; }

@media (prefers-reduced-motion: reduce) {
    .app-screen.is-active { animation: none; }
    .app-screen, .app-sheet__panel { transition: none; }
}
