/* Álbum de fotos — diseño libro real */
.album-teaser {
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(74, 127, 212, 0.2), rgba(244, 114, 182, 0.2));
    border: 1px solid rgba(244, 114, 182, 0.3);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    animation: fadeInUp 1s ease 0.5s both;
}

.album-teaser p {
    color: var(--rosado-claro);
    font-style: italic;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.album-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.6rem;
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--blanco);
    background: linear-gradient(135deg, var(--azul), var(--rosado));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(244, 114, 182, 0.35);
    transition: all 0.3s ease;
}

.album-open-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 30px rgba(244, 114, 182, 0.5);
}

.album-section {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(15, 23, 41, 0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    animation: fadeIn 0.4s ease;
    overflow: hidden;
}

.album-container {
    position: relative;
    width: 100%;
    max-width: 820px;
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1rem 2rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.album-close {
    position: fixed;
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(30, 30, 60, 0.85);
    color: var(--blanco);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 230;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.album-close:hover,
.album-close:active {
    background: rgba(219, 39, 119, 0.85);
    transform: scale(1.1);
}

.album-close-mobile {
    display: none !important;
}

.album-header {
    text-align: center;
    width: 100%;
}

.album-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    background: linear-gradient(135deg, var(--azul-claro), var(--rosado));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.album-header p {
    color: var(--rosado-claro);
    font-size: 0.9rem;
}

.album-hint {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    font-style: italic;
    text-align: center;
}

.album-stage {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    perspective: 1400px;
}

.album-book-3d {
    flex: 1;
    display: flex;
    align-items: stretch;
    min-height: 420px;
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.45));
    transform: rotateX(2deg);
    overflow: visible;
}

.album-book-cover {
    width: 14px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #2B5A9E, #4A7FD4 40%, #DB2777);
    border-radius: 3px 0 0 3px;
    box-shadow: inset -2px 0 6px rgba(0, 0, 0, 0.3);
}

.album-book-cover-right {
    border-radius: 0 3px 3px 0;
    box-shadow: inset 2px 0 6px rgba(0, 0, 0, 0.3);
}

.album-spread {
    flex: 1;
    display: flex;
    position: relative;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    overflow: visible;
    width: 100%;
}

.album-spread.mobile-mode {
    flex-direction: row;
    justify-content: center;
    min-height: auto;
}

.album-spread.mobile-mode .album-spine {
    display: none;
}

.album-sheet-single {
    width: 100%;
    max-width: 100%;
    border-radius: 6px !important;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    flex: 1 1 100%;
}

.album-spread.turning-next {
    transform: rotateY(-6deg);
    opacity: 0.4;
}

.album-spread.turning-prev {
    transform: rotateY(6deg);
    opacity: 0.4;
}

.album-spine {
    width: 8px;
    flex-shrink: 0;
    background: linear-gradient(90deg,
        rgba(0, 0, 0, 0.12),
        rgba(43, 90, 158, 0.25) 30%,
        rgba(219, 39, 119, 0.2) 70%,
        rgba(0, 0, 0, 0.12));
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.15);
}

.album-sheet {
    flex: 1;
    position: relative;
    padding: 1.1rem 1rem 2.2rem;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 28px,
            rgba(74, 127, 212, 0.04) 28px,
            rgba(74, 127, 212, 0.04) 29px
        ),
        linear-gradient(160deg, #FFFCF8 0%, #F8F2EA 50%, #F5EDE8 100%);
    overflow: visible;
}

.album-sheet-left {
    border-radius: 4px 0 0 4px;
    box-shadow: inset -8px 0 16px rgba(0, 0, 0, 0.06);
}

.album-sheet-right {
    border-radius: 0 4px 4px 0;
    box-shadow: inset 8px 0 16px rgba(0, 0, 0, 0.06);
}

.album-sheet::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(244, 114, 182, 0.04), transparent 60%);
    pointer-events: none;
}

.album-sheet-num {
    position: absolute;
    bottom: 0.6rem;
    font-family: 'Playfair Display', serif;
    font-size: 0.7rem;
    color: rgba(43, 90, 158, 0.45);
    font-style: italic;
}

.album-sheet-left .album-sheet-num { left: 1rem; }
.album-sheet-right .album-sheet-num { right: 1rem; }

.album-sheet-title-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 340px;
    text-align: center;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.album-sheet-title-page h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: #2B5A9E;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.album-sheet-title-page p {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.95rem;
    color: #DB2777;
    opacity: 0.8;
}

.album-sheet-title-page .title-hearts {
    font-size: 2rem;
    margin: 1rem 0;
    letter-spacing: 0.5rem;
}

.album-sheet-title-page .title-deco {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--azul), var(--rosado));
    margin: 0.75rem auto;
    opacity: 0.5;
}

.album-page-label {
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-size: 0.72rem;
    color: rgba(219, 39, 119, 0.55);
    font-style: italic;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.album-slots {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.album-mount {
    position: relative;
    aspect-ratio: 4/3;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.album-mount:hover {
    transform: scale(1.02);
    z-index: 2;
}

.album-mount-frame {
    position: absolute;
    inset: 0;
    background: #FAF7F2;
    border: 1px solid rgba(43, 90, 158, 0.12);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.8),
        0 3px 10px rgba(0, 0, 0, 0.08);
}

.album-mount-corner {
    position: absolute;
    width: 18px;
    height: 18px;
    z-index: 3;
    pointer-events: none;
}

.album-mount-corner::before,
.album-mount-corner::after {
    content: '';
    position: absolute;
    background: #C4A882;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.album-mount-corner.tl { top: 6px; left: 6px; }
.album-mount-corner.tr { top: 6px; right: 6px; }
.album-mount-corner.bl { bottom: 6px; left: 6px; }
.album-mount-corner.br { bottom: 6px; right: 6px; }

.album-mount-corner.tl::before { top: 0; left: 0; width: 14px; height: 3px; }
.album-mount-corner.tl::after { top: 0; left: 0; width: 3px; height: 14px; }
.album-mount-corner.tr::before { top: 0; right: 0; width: 14px; height: 3px; }
.album-mount-corner.tr::after { top: 0; right: 0; width: 3px; height: 14px; }
.album-mount-corner.bl::before { bottom: 0; left: 0; width: 14px; height: 3px; }
.album-mount-corner.bl::after { bottom: 0; left: 0; width: 3px; height: 14px; }
.album-mount-corner.br::before { bottom: 0; right: 0; width: 14px; height: 3px; }
.album-mount-corner.br::after { bottom: 0; right: 0; width: 3px; height: 14px; }

.album-mount-photo {
    position: absolute;
    inset: 10px;
    overflow: hidden;
    z-index: 1;
}

.album-mount-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(1.05);
}

.album-mount-empty {
    position: absolute;
    inset: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 2px dashed rgba(244, 114, 182, 0.4);
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 8px,
            rgba(74, 127, 212, 0.03) 8px,
            rgba(74, 127, 212, 0.03) 16px
        ),
        rgba(255, 255, 255, 0.5);
    z-index: 1;
    transition: all 0.3s ease;
}

.album-mount-empty:hover {
    border-color: var(--rosado);
    background-color: rgba(251, 207, 232, 0.15);
}

.album-mount-empty .empty-icon {
    font-size: 1.6rem;
    opacity: 0.6;
}

.album-mount-empty span {
    font-size: 0.7rem;
    color: #DB2777;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    line-height: 1.3;
    padding: 0 0.5rem;
}

.album-nav {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--azul), var(--rosado-oscuro));
    color: var(--blanco);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(74, 127, 212, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 3px;
}

.album-nav:hover:not(:disabled) {
    transform: scale(1.08);
}

.album-nav:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.album-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
}

.album-add-pages-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.4rem;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--azul-claro);
    background: rgba(255, 255, 255, 0.08);
    border: 1px dashed rgba(126, 179, 240, 0.5);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.album-add-pages-btn:hover {
    background: rgba(74, 127, 212, 0.2);
    border-color: var(--azul-claro);
    transform: scale(1.03);
}

.album-add-pages-btn.pulse-hint {
    animation: albumBtnPulse 2s ease-in-out infinite;
    border-color: var(--rosado);
    color: var(--rosado-claro);
}

@keyframes albumBtnPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(244, 114, 182, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(244, 114, 182, 0); }
}

.album-capacity {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    font-style: italic;
}

.album-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.3rem;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #7EB3F0, #F472B6);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(244, 114, 182, 0.3);
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    text-align: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.album-upload-btn:hover {
    transform: scale(1.03);
}

.album-upload-btn.uploading {
    opacity: 0.7;
    pointer-events: none;
}

.album-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 300px;
}

.album-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.album-dot.active {
    background: var(--rosado);
    border-color: var(--rosado-claro);
    transform: scale(1.25);
    box-shadow: 0 0 10px rgba(244, 114, 182, 0.5);
}

.album-dot.has-photos {
    background: rgba(74, 127, 212, 0.5);
}

.album-dot.has-photos.active {
    background: var(--rosado);
}

.album-lightbox {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 41, 0.92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    padding: 1.5rem;
    animation: fadeIn 0.3s ease;
}

.album-lightbox img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 8px solid #FAF7F2;
    outline: 1px solid rgba(196, 168, 130, 0.5);
}

.album-lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(30, 30, 60, 0.75);
    color: var(--blanco);
    font-size: 1.3rem;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.album-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--azul), var(--rosado-oscuro));
    color: var(--blanco);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.4s ease;
}

@media (max-width: 900px) {
    .album-book-3d {
        min-height: auto;
        height: auto;
        transform: none;
    }

    .album-book-cover {
        width: 8px;
    }

    .album-spread:not(.mobile-mode) {
        flex-direction: column;
    }

    .album-spread.mobile-mode .album-sheet-single {
        min-height: 320px;
    }

    .album-spread.turning-next,
    .album-spread.turning-prev {
        transform: none;
        opacity: 0.6;
    }

    .album-spine {
        width: 100%;
        height: 6px;
    }

    .album-spread:not(.mobile-mode) .album-sheet {
        min-height: 200px;
        padding: 1rem 0.85rem 1.8rem;
    }

    .album-spread:not(.mobile-mode) .album-sheet-left {
        border-radius: 4px 4px 0 0;
        box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.05);
    }

    .album-spread:not(.mobile-mode) .album-sheet-right {
        border-radius: 0 0 4px 4px;
        box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.05);
    }

    .album-sheet-title-page {
        min-height: 280px;
    }

    .album-stage {
        gap: 0.4rem;
        align-items: flex-start;
    }

    .album-nav {
        width: 38px;
        height: 38px;
        font-size: 1.6rem;
        margin-top: 140px;
    }

    .album-mount {
        aspect-ratio: 5/4;
    }

    .album-close-mobile {
        display: inline-flex !important;
    }

    .album-container {
        padding-top: 1rem;
    }

    .album-upload-btn {
        justify-content: center;
        width: 100%;
        max-width: 320px;
    }
}

@media (max-width: 480px) {
    .album-container {
        max-width: 100%;
        padding-top: 2.5rem;
    }

    .album-slots {
        gap: 0.75rem;
    }

    .album-teaser {
        margin-top: 1.5rem;
        padding: 1rem;
    }

    .album-open-btn {
        font-size: 0.9rem;
        padding: 0.75rem 1.3rem;
    }

    .album-hint {
        font-size: 0.72rem;
        padding: 0 0.5rem;
    }
}
