:root {
    --navy: #2d3250;
    --navy-rgb: 45, 50, 80;
    --navy2: #222640;
    --navy2-rgb: 34, 38, 64;
    --violet: #676f9d;
    --violet-rgb: 103, 111, 157;
    --peach: #f9b17a;
    --peach-rgb: 249, 177, 122;
    --coral: #ff7e67;
    --coral-rgb: 255, 126, 103;
    --teal: #7fb5b5;
    --teal-rgb: 127, 181, 181;
    --white: #ffffff;
    --beige: #F8F5F2;
    --dark-modal: #0F0F0F;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Poppins', sans-serif;
    --radius: 14px;
    --nav-h: 64px;
}

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

body {
    min-height: 100vh;
    background: var(--navy);
    font-family: var(--font-sans);
    color: var(--white);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* ── Ambient BG ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 60% 50% at 10% 15%, rgba(103, 111, 157, .3) 0%, transparent 60%),
        radial-gradient(ellipse 45% 40% at 90% 85%, rgba(255, 126, 103, .18) 0%, transparent 55%),
        radial-gradient(ellipse 35% 30% at 80% 5%, rgba(127, 181, 181, .18) 0%, transparent 50%);
}

/* ── TOP NAVBAR ── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    height: var(--nav-h);
    background: rgba(22, 25, 45, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    display: flex;
    align-items: center;
    padding: 0 1.75rem;
    gap: 1.25rem;
}

.nav-logo {
    height: 26px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: .9;
    flex-shrink: 0;
}

.nav-divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, .1);
    flex-shrink: 0;
}

.nav-tabs {
    display: flex;
    gap: 0.25rem;
    flex: 1;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1rem;
    border-radius: 9px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, .4);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .18s ease;
    white-space: nowrap;
}

.nav-tab i {
    font-size: 0.85rem;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .75);
}

.nav-tab.active {
    background: rgba(255, 126, 103, .12);
    color: var(--coral);
    font-weight: 600;
}

/* ── Storage status button ── */
.nav-storage-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 0.35rem 0.85rem 0.35rem 0.6rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    color: #fff;
    font-size: 0.72rem;
    font-family: var(--font-sans);
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-storage-btn:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.15);
}

.nav-storage-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    flex-shrink: 0;
    transition: background 0.3s, box-shadow 0.3s;
}

.nav-storage-label {
    opacity: 0.55;
    transition: opacity 0.3s;
}
.nav-storage-btn:hover .nav-storage-label { opacity: 0.85; }

@media (max-width: 640px) {
    .navbar { padding: 0 1rem; gap: 0.75rem; }
    .nav-tab span { display: none; }
    .nav-tab { padding: 0.5rem 0.75rem; }
    .nav-storage-label { display: none; }
    .nav-storage-btn { padding: 0.4rem 0.6rem; }
}

/* ── MAIN CONTENT AREA ── */
.content {
    position: relative;
    z-index: 1;
    padding: 2.5rem 3rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

#page-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* ── INPUT BAR (full width horizontal) ── */
.input-bar {
    width: 100%;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius);
    padding: 1.25rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-bar-title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 600;
}

.input-bar-title em {
    font-style: italic;
    background: linear-gradient(135deg, var(--peach), var(--coral));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* single input row */
.input-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.input-label-group {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    flex-shrink: 0;
}

.field-label {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--peach);
}

.field-hint {
    font-size: .7rem;
    color: rgba(255, 255, 255, .35);
}

.field-input {
    flex: 1;
    min-width: 220px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 10px;
    padding: .85rem 1.2rem;
    font-family: var(--font-sans);
    font-size: .95rem;
    color: var(--white);
    outline: none;
    transition: border-color .25s, box-shadow .25s, background .25s;
}

.field-input::placeholder {
    color: rgba(255, 255, 255, .28);
}

select.field-input option {
    background: #2a2a3a;
    color: #fff;
}

.field-input:focus {
    border-color: var(--peach);
    background: rgba(255, 255, 255, .11);
    box-shadow: 0 0 0 3px rgba(249, 177, 122, .16);
}

.field-input.error {
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(255, 126, 103, .2);
}

/* Date input styling */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.5;
    cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.gen-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .85rem 2rem;
    background: linear-gradient(135deg, var(--peach), var(--coral));
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    transition: transform .25s cubic-bezier(.2, 1, .2, 1), opacity .25s;
}

.gen-btn:hover {
    box-shadow: none;
    opacity: 0.88;
}

/* pack: two input rows */
.pack-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: end;
}

/* ── RESULTS GRID ── */
.results-area {
    width: 100%;
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
    transition: opacity .4s ease, transform .4s cubic-bezier(.2, 1, .2, 1);
}

/* album: 4 equal columns */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    align-items: start;
}

/* album: 3 equal columns */
.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* invite: 2 columns */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* pack: invite section | album section */
.pack-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

.pack-section-title {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding-bottom: 1rem;
    margin-bottom: .25rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.pack-section-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1rem;
}

/* ── CARD ── */
.card {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    height: fit-content;
    min-width: 0;
}

.card-label {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--peach);
    margin-bottom: 1.25rem;
}

/* ── LINK DISPLAY ── */
.link-display {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 10px;
    padding: .6rem 1rem;
    font-size: .83rem;
    color: rgba(255, 255, 255, .7);
    word-break: break-all;
    margin-bottom: .6rem;
}

.link-actions {
    display: flex;
    gap: .6rem;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    transition: all .22s ease;
    text-decoration: none;
}

.icon-btn:hover {
    background: rgba(249, 177, 122, .2);
    border-color: var(--peach);
    color: var(--peach);
}

.icon-btn.copied {
    background: rgba(127, 181, 181, .2);
    border-color: var(--teal);
    color: var(--teal);
}

/* ── QR CARD ── */
.qr-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.qr-wrap {
    background: #fff;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .22);
    width: 268px;
    /* 240px qr + 28px padding */
    height: 268px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.qr-wrap canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    height: auto !important;
    width: auto !important;
}

.qr-actions {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    justify-content: center;
}

.qr-btn {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem 1.1rem;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    color: rgba(255, 255, 255, .75);
    font-family: var(--font-sans);
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .22s;
}

.qr-btn:hover {
    background: rgba(127, 181, 181, .18);
    border-color: var(--teal);
    color: var(--teal);
}

/* ── UPLOAD CARD ── */
.upload-select-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .8rem;
    background: rgba(255, 255, 255, .06);
    border: 1.5px dashed rgba(255, 255, 255, .22);
    border-radius: 10px;
    color: rgba(255, 255, 255, .65);
    font-family: var(--font-sans);
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .22s ease;
    margin-bottom: .75rem;
}

.upload-select-btn:hover {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .45);
    color: #fff;
}

.upload-action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .7rem;
    background: rgba(249, 177, 122, .12);
    border: 1px solid rgba(249, 177, 122, .3);
    border-radius: 10px;
    color: var(--peach);
    font-family: var(--font-sans);
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .22s;
    margin-bottom: .75rem;
}

.upload-action-btn:hover {
    background: rgba(249, 177, 122, .2);
}

.chosen-label {
    font-size: .8rem;
    color: rgba(255, 255, 255, .5);
    text-align: center;
    margin-bottom: .6rem;
    display: none;
}

.upload-progress-wrap {
    display: none;
    margin-top: .75rem;
}

.progress-track {
    background: rgba(255, 255, 255, .1);
    border-radius: 50px;
    height: 5px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--peach), var(--coral));
    border-radius: 50px;
    transition: width .3s ease;
}

.progress-status {
    font-size: .76rem;
    color: rgba(255, 255, 255, .45);
    text-align: center;
    margin-top: .5rem;
}

/* ── FOOTER ── */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding-bottom: 2rem;
    font-size: .72rem;
    color: rgba(255, 255, 255, .22);
    letter-spacing: .04em;
    margin-top: auto;
    padding-top: 2rem;
}

/* Hide main content while locked (Deprecated by server-side) */
body.locked .navbar,
body.locked .content,
body.locked .footer {
    display: none !important;
}

/* ── SLIDESHOW CARD ── */
.ss-link-display {
    background: rgba(127, 181, 181, .08);
    border: 1px solid rgba(127, 181, 181, .2);
    border-radius: 10px;
    padding: .6rem 1rem;
    font-size: .78rem;
    color: rgba(255, 255, 255, .6);
    word-break: break-all;
    margin-bottom: .6rem;
}

.ss-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: .6rem;
}

.ss-badge i {
    font-size: .75rem;
}

@media (max-width: 900px) {
    .content {
        padding: 1.5rem 1.2rem 3rem;
    }

    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    .pack-grid {
        grid-template-columns: 1fr;
    }

    .pack-section-inner {
        grid-template-columns: 1fr;
    }

    .pack-inputs {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .navbar {
        padding: 0 1rem;
        gap: 1rem;
    }

    .nav-tab span {
        display: none;
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .gen-btn {
        justify-content: center;
    }
}

#nav-btn-download {
    margin-left: auto;
    color: var(--teal);
}

/* Modal refine */
.hidden {
    display: none !important;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

#download-modal .pin-card {
    animation: modalFadeIn 0.3s cubic-bezier(0.2, 1, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 18, 35, 0.95);
    backdrop-filter: blur(25px);
}

.dl-section-progress {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── DATE TAGS GRID (Responsive) ── */
.date-tags-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.date-sep {
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    padding-left: 1.5rem;
}

/* ── TOGGLE SWITCH ── */
.switch-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    user-select: none;
    height: 100%;
}

.toggle-switch {
    width: 36px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    position: relative;
    transition: background 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.toggle-switch {
    background: var(--teal);
    border-color: var(--teal);
}

input:checked+.toggle-switch::before {
    transform: translateX(16px);
}

.switch-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s;
}

input:checked~.switch-label {
    color: var(--teal);
}

@media (max-width: 800px) {
    .date-tags-grid {
        grid-template-columns: 1fr !important;
        gap: 1.2rem !important;
    }

    .date-tags-grid>div,
    .date-sep {
        border-left: none !important;
        padding-left: 0 !important;
    }
}

/* ── MIS ÁLBUMES ── */
.my-albums-section {
    margin-bottom: 2rem;
}

.my-albums-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

#invitations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    padding-bottom: 0.5rem;
}

#albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    padding-bottom: 0.5rem;
}


.album-card {
    width: 100%;
    background: rgba(34, 38, 64, 0.5);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
    display: flex;
    flex-direction: column;
}

.album-card:hover {
    border-color: rgba(103,111,157,.45);
    transform: translateY(-2px);
}

.album-card-thumb {
    width: 100%;
    height: 124px;
    background: rgba(255,255,255,.04);
    overflow: hidden;
    flex-shrink: 0;
}

.album-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.album-card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.12);
    font-size: 1.6rem;
}

.album-card-info {
    padding: 0.6rem 0.7rem 0.4rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.album-card-name {
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(255,255,255,.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-card-id {
    font-size: 0.6rem;
    font-family: monospace;
    color: rgba(255,255,255,.3);
}

/* ── Botones principales (Editar / Ver) ── */
.album-card-actions {
    display: flex;
    gap: 0.4rem;
    padding: 0 0.7rem 0.7rem;
}

.album-card-btn {
    flex: 1;
    padding: 0.5rem 0.3rem;
    font-size: 0.72rem;
    font-family: var(--font-sans);
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.05);
    color: rgba(255,255,255,.6);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-decoration: none;
    line-height: 1;
}

.album-card-btn:hover {
    text-decoration: none;
}

.album-card-btn.edit-btn:hover {
    background: rgba(249,177,122,.15);
    color: var(--peach);
    border-color: rgba(249,177,122,.4);
}

.album-card-btn.view-btn:hover {
    background: rgba(127,181,181,.15);
    color: var(--teal);
    border-color: rgba(127,181,181,.4);
}

/* ── Iconos secundarios ── */
.album-card-icons {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0.5rem 0.7rem 0.65rem;
    border-top: 1px solid rgba(255,255,255,.05);
    margin-top: 0.5rem;
    gap: 0.2rem;
}

.album-icon-btn {
    flex: 1;
    height: auto;
    min-height: 44px;
    border-radius: 7px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,.3);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.18rem;
    font-size: 0.8rem;
    transition: color 0.15s, background 0.15s;
    text-decoration: none;
}

.album-icon-btn:hover {
    color: rgba(255,255,255,.85);
    background: rgba(255,255,255,.06);
    text-decoration: none;
}

.album-icon-btn.db-btn:hover    { color: var(--teal); }
.album-icon-btn.copy-btn:hover  { color: var(--violet); }
.album-icon-btn.pass-btn:hover  { color: var(--coral); }
.album-icon-btn.qr-dl-btn:hover { color: var(--peach); }
.album-icon-btn.pdf-dl-btn:hover { color: var(--peach); }
.album-icon-btn.zip-dl-btn:hover { color: var(--teal); }

.album-icon-btn.copied { color: var(--teal); }

.album-icon-btn span {
    font-size: 0.52rem;
    font-family: var(--font-sans);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: inherit;
    opacity: 0.65;
    line-height: 1;
}

/* ── Category filter dropdown ── */
.cat-filter-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    max-width: 240px;
    border-radius: 10px;
}

.cat-filter-icon {
    position: absolute;
    left: 0.75rem;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.35);
    pointer-events: none;
    z-index: 1;
}

.cat-filter-chevron {
    position: absolute;
    right: 0.75rem;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.3);
    pointer-events: none;
    z-index: 1;
}

.cat-filter-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 0.55rem 2rem 0.55rem 2rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.6);
    font-size: 0.75rem;
    font-family: var(--font-sans);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    min-width: 160px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.cat-filter-select:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
}

.cat-filter-select:focus {
    outline: none;
    border-color: rgba(127,181,181,0.5);
    color: var(--teal);
}

@media (max-width: 600px) {
    .cat-filter-wrap { max-width: 100%; width: 100%; }
    .cat-filter-select { width: 100%; }
}

@media (max-width: 600px) {
    #cat-filter-bar {
        gap: 0.4rem;
        margin-bottom: 0.75rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.25rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    #cat-filter-bar::-webkit-scrollbar { display: none; }
    .cat-filter-pill { font-size: 0.72rem; padding: 0.3rem 0.75rem; }
    #albums-grid { grid-template-columns: 1fr; gap: 0.75rem; }
    #album-search-bar { width: 100%; }

}

/* ── Botones de acción de álbumes ── */
.album-reload-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.album-reload-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.album-search-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.cat-filter-inline { flex-shrink: 0; display: flex; }
.cat-filter-inline .cat-filter-wrap { width: 100%; }
.cat-filter-inline .cat-filter-select { height: 100%; box-sizing: border-box; }

.album-actions-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 600px) {
    .album-search-row { flex-wrap: wrap; }
    .cat-filter-inline { width: 100%; }
    .cat-filter-inline .cat-filter-wrap { width: 100%; max-width: 100%; }
    .cat-filter-inline .cat-filter-select { width: 100%; }
    .album-actions-row .album-action-btn { flex: 1; justify-content: center; }
}

.album-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.65);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.album-action-btn i { font-size: 0.75rem; }
.album-action-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.album-action-btn--primary {
    background: linear-gradient(135deg, var(--coral), var(--peach));
    border: none;
    color: #fff;
    font-weight: 600;
}
.album-action-btn--primary:hover {
    opacity: 0.88;
    color: #fff;
}

/* mantener compatibilidad con toolbar-btn antiguo */
.album-toolbar-btn {
    width: 38px; height: 38px; flex-shrink: 0;
    border-radius: 10px; border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.55);
    font-size: 0.82rem; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.album-toolbar-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.album-toolbar-btn--primary { background: linear-gradient(135deg, var(--coral), var(--peach)); border: none; color: #fff; }
.album-toolbar-btn--primary:hover { opacity: 0.88; color: #fff; }

/* ── Download progress bar on card ── */
.album-card-progress {
    height: 3px;
    background: rgba(255,255,255,.07);
    overflow: hidden;
}

.album-card-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--peach), var(--coral));
    transition: width 0.4s ease;
}

/* Paginación */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 0 0.5rem;
}

.page-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(34,38,64,0.6);
    color: rgba(255,255,255,0.6);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.page-btn:hover:not([disabled]) {
    background: rgba(249,177,122,0.1);
    border-color: rgba(249,177,122,0.3);
    color: var(--peach);
}
.page-btn[disabled] {
    opacity: 0.25;
    cursor: default;
}

.page-info {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.35);
    min-width: 90px;
    text-align: center;
}

/* Skeleton loading */
.albums-skeleton {
    display: contents;
}

.album-skeleton-card {
    width: 100%;
    border-radius: var(--radius);
    background: linear-gradient(90deg,
        rgba(255,255,255,.04) 25%,
        rgba(255,255,255,.07) 50%,
        rgba(255,255,255,.04) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.albums-empty {
    padding: 1.5rem;
    text-align: center;
    color: rgba(255,255,255,.25);
    font-size: 0.78rem;
    border: 1px dashed rgba(255,255,255,.07);
    border-radius: var(--radius);
}

.edit-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.album-edit-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.07);
}

/* Prevent iOS auto-zoom on input focus (triggered when font-size < 16px) */
@media (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}