/**
 * Galería con filtros + lightbox (páginas Flota y Luxury VIP)
 * El color de acento se puede cambiar por sección con --amg-accent
 */

.amg-section {
    --amg-accent: #F46C11;
    background: linear-gradient(135deg, #0f0f17 0%, #0a0a0f 100%);
    border: 1px solid #1f1f28;
    border-radius: 20px;
    padding: 40px 30px;
    margin-bottom: 60px;
    scroll-margin-top: 20px;
}

.amg-head {
    text-align: center;
    margin-bottom: 28px;
}

.amg-head h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #f3f4f6;
    letter-spacing: -1px;
    margin-bottom: 10px;
}

.amg-head p {
    color: #9ca3af;
    font-size: 1.02rem;
    max-width: 640px;
    margin: 0 auto;
}

/* Filtros */
.amg-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.amg-filters button {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid #2a2a35;
    color: #9ca3af;
    border-radius: 50px;
    padding: 8px 18px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.amg-filters button:hover {
    color: #e8e8ea;
    border-color: var(--amg-accent);
}

.amg-filters button.is-active {
    background: var(--amg-accent);
    border-color: var(--amg-accent);
    color: #fff;
}

.amg-filters .amg-count {
    opacity: 0.7;
    font-size: 0.8em;
    margin-left: 4px;
}

/* Rejilla */
.amg-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.amg-item {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid #1f1f28;
    background: #0f0f17;
    cursor: zoom-in;
}

.amg-item[hidden] {
    display: none;
}

.amg-item--tall {
    grid-row: span 2;
    aspect-ratio: auto;
}

.amg-item--video {
    cursor: pointer;
}

.amg-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.amg-item:hover .amg-thumb,
.amg-item:focus-visible .amg-thumb {
    transform: scale(1.05);
}

.amg-item:focus-visible {
    outline: 2px solid var(--amg-accent);
    outline-offset: 2px;
}

.amg-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 40px 14px 12px;
    background: linear-gradient(to top, rgba(10, 10, 15, 0.92) 0%, transparent 100%);
    color: #f3f4f6;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.35;
}

.amg-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(10, 10, 15, 0.65);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.amg-item:hover .amg-icon,
.amg-item:focus-visible .amg-icon {
    opacity: 1;
}

.amg-item--video .amg-icon {
    top: 50%;
    left: 50%;
    right: auto;
    width: 64px;
    height: 64px;
    transform: translate(-50%, -50%);
    background: var(--amg-accent);
    font-size: 1.4rem;
    opacity: 0.95;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.amg-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(10, 10, 15, 0.7);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 50px;
}

/* Lightbox */
.amg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(5, 5, 8, 0.96);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.amg-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.amg-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    flex-shrink: 0;
}

.amg-counter {
    color: #e8e8ea;
    font-size: 0.95rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    padding: 6px 14px;
}

.amg-main {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 0 16px;
}

.amg-stage {
    margin: 0;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.amg-stage img,
.amg-stage video {
    display: block;
    max-width: 100%;
    max-height: calc(100% - 44px);
    width: auto;
    height: auto;
    border-radius: 10px;
    background: #000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.amg-stage figcaption {
    color: #e8e8ea;
    font-size: 0.95rem;
    text-align: center;
    margin-top: 12px;
    max-width: 680px;
    padding: 0 10px;
}

.amg-btn {
    flex-shrink: 0;
    border: 1px solid #2a2a35;
    background: rgba(15, 15, 23, 0.85);
    color: #e8e8ea;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.amg-btn:hover:not([disabled]),
.amg-btn:focus-visible {
    background: #F46C11;
    border-color: #F46C11;
    color: #fff;
}

.amg-btn[disabled] {
    opacity: 0.25;
    cursor: default;
}

/* Tira de miniaturas: siempre se ve qué foto es y cuántas quedan */
.amg-strip {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 14px 18px 18px;
    justify-content: safe center;
    scrollbar-width: thin;
}

.amg-strip-item {
    position: relative;
    flex: 0 0 auto;
    width: 56px;
    height: 70px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: #0f0f17;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.amg-strip-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.amg-strip-item.is-video::after {
    content: '\25B6';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.amg-strip-item:hover {
    opacity: 0.85;
}

.amg-strip-item.is-active {
    opacity: 1;
    border-color: #F46C11;
}

.amg-lightbox.is-single .amg-prev,
.amg-lightbox.is-single .amg-next,
.amg-lightbox.is-single .amg-strip {
    display: none;
}

@media (max-width: 992px) {
    .amg-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .amg-section {
        padding: 28px 14px;
    }

    .amg-head h2 {
        font-size: 1.8rem;
    }

    .amg-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .amg-caption {
        font-size: 0.78rem;
        padding: 30px 10px 9px;
    }

    .amg-icon {
        opacity: 1;
    }

    /* En móvil las flechas van superpuestas a los lados de la foto */
    .amg-main {
        position: relative;
        padding: 0 8px;
    }

    .amg-prev,
    .amg-next {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 42px;
        height: 42px;
        z-index: 1;
    }

    .amg-prev {
        left: 10px;
    }

    .amg-next {
        right: 10px;
    }

    .amg-stage figcaption {
        font-size: 0.85rem;
    }

    .amg-strip-item {
        width: 46px;
        height: 58px;
    }
}
