/* ═══════════════════════════════════════════════════════════════
   MODAL EXCLUSIVO NEW ARRIVALS (am = arrivals-modal)
   ═══════════════════════════════════════════════════════════════ */

:root {
    --am-overlay: rgba(23, 16, 11, 0.65);
    --am-panel-bg: #f5efe4;
    --am-surface: #fffdf9;
    --am-line: #e0d2ba;
    --am-ink: #2f231b;
    --am-muted: #6c5b4f;
    --am-brand: #936647;
    --am-gold: #c39a5f;
    --am-accent: #1d6f78;
}

body.is-am-modal-open {
    overflow: hidden;
}

/* ─── Modal Container ─── */
.am-modal[hidden] {
    display: none;
}

.am-modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: grid;
    place-items: center;
    padding: 0.5rem;
    animation: am-fade-in 0.22s ease;
}

.am-modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--am-overlay);
    backdrop-filter: blur(3px);
}

.am-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(1100px, calc(100vw - 1rem));
    max-height: calc(100vh - 1rem);
    border: 1px solid rgba(147, 102, 71, 0.32);
    border-radius: 22px;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 4% 8%,
            rgba(195, 154, 95, 0.1) 0%,
            transparent 42%
        ),
        radial-gradient(
            circle at 94% 6%,
            rgba(29, 111, 120, 0.08) 0%,
            transparent 44%
        ),
        var(--am-panel-bg);
    box-shadow: 0 24px 58px rgba(23, 16, 11, 0.45);
}

/* ─── Barra superior ─── */
.am-modal__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.72rem 1rem;
    border-bottom: 1px solid rgba(147, 102, 71, 0.2);
    background: rgba(245, 237, 224, 0.9);
    backdrop-filter: blur(4px);
}

.am-modal__crumb {
    margin: 0;
    font-family: "Montserrat", sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #6a4d22;
    text-transform: uppercase;
}

.am-modal__crumb i {
    color: var(--am-gold);
    margin-right: 6px;
}

.am-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #dfcba8;
    background: #f8f0df;
    color: #6c5223;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.am-icon-btn:hover {
    background: #efe1ca;
    transform: scale(1.05);
}

/* ─── Contenido ─── */
.am-modal__content {
    max-height: calc(100vh - 62px);
    overflow: auto;
    padding: 0.9rem;
}

/* ─── Layout 2 columnas ─── */
.am-detail {
    display: grid;
    grid-template-columns: minmax(300px, 460px) minmax(0, 1fr);
    gap: 1rem;
}

/* ─── Columna Izquierda: Galería ─── */
.am-gallery {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* Imagen principal */
.am-gallery-main {
    position: relative;
    aspect-ratio: 4 / 5;
    max-height: 520px;
    border-radius: 16px;
    border: 1px solid var(--am-line);
    overflow: hidden;
    background: #f0e8db;
    box-shadow: 0 12px 28px rgba(47, 35, 27, 0.14);
}

.am-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
    cursor: zoom-in;
}

.am-gallery-main:hover img {
    transform: scale(1.03);
}

/* Flechas de navegación (visibles al hover) */
.am-gal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition:
        opacity 0.25s ease,
        background 0.2s ease,
        transform 0.15s ease;
    backdrop-filter: blur(3px);
}

.am-gallery-main:hover .am-gal-nav,
.am-gallery-main:focus-within .am-gal-nav {
    opacity: 1;
}

.am-gal-nav:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.08);
}

.am-gal-nav--prev {
    left: 12px;
}
.am-gal-nav--next {
    right: 12px;
}

/* Dots de navegación */
.am-image-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    gap: 6px;
}

.am-dot {
    width: 26px;
    height: 4px;
    border-radius: 2px;
    border: 0;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    padding: 0;
    transition:
        background 0.25s ease,
        width 0.25s ease;
}

.am-dot.is-active {
    background: var(--am-gold);
    width: 34px;
}

/* Tira de thumbnails */
.am-thumb-strip {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--am-brand-soft) transparent;
}

.am-thumb-strip::-webkit-scrollbar {
    height: 4px;
}
.am-thumb-strip::-webkit-scrollbar-track {
    background: transparent;
}
.am-thumb-strip::-webkit-scrollbar-thumb {
    background: #bd9a7f;
    border-radius: 4px;
}

.am-thumb-item {
    flex: 0 0 64px;
    height: 64px;
    border-radius: 10px;
    border: 2px solid transparent;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: #e8dccb;
    transition:
        border-color 0.2s ease,
        transform 0.2s ease;
}

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

.am-thumb-item.is-active {
    border-color: var(--am-gold);
    transform: scale(1.05);
}

.am-thumb-item:hover {
    border-color: rgba(195, 154, 95, 0.6);
    transform: scale(1.03);
}

/* ─── Columna Derecha: Info del producto ─── */
.am-info {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.2rem 0;
}

.am-info__category {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--am-brand);
}

.am-info__title {
    margin: 0;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(1.5rem, 2.8vw, 2.2rem);
    color: var(--am-ink);
    line-height: 1.12;
}

.am-info__price {
    margin: 0;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #f6ecd9;
    border: 1px solid #e4d1ab;
    color: #6e5120;
    font-size: 1rem;
    font-weight: 800;
    padding: 0.35rem 0.8rem;
    align-self: flex-start;
}

.am-price--old {
    text-decoration: line-through;
    color: #9a8a7a;
    font-weight: 600;
    margin-right: 0.3rem;
    font-size: 0.85rem;
}

.am-price--discount {
    color: #c0392b;
}

.am-info__desc {
    margin: 0;
    color: var(--am-muted);
    font-size: 0.93rem;
    line-height: 1.6;
}

/* ─── Sección de detalles (material + colores) ─── */
.am-details {
    margin-top: 0.3rem;
    padding-top: 0.7rem;
    border-top: 1px solid #e8dccb;
}

.am-details__title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9a7d5a;
    margin: 0 0 0.55rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.am-details__title i {
    color: var(--am-gold);
    font-size: 0.85em;
}

.am-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem 0.8rem;
}

.am-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.am-detail-label {
    font-size: 0.67rem;
    font-weight: 600;
    color: #9a8470;
    display: flex;
    align-items: center;
    gap: 5px;
}

.am-detail-label i {
    font-size: 0.72rem;
    color: var(--am-gold);
    width: 14px;
    text-align: center;
}

.am-detail-value {
    font-size: 0.84rem;
    font-weight: 600;
    color: #473426;
}

.am-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 1px;
}

.am-color-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #5c4a38;
    background: #f7f0e6;
    border: 1px solid #e1d0b8;
    border-radius: 6px;
    padding: 3px 9px 3px 5px;
}

.am-color-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.14);
    flex-shrink: 0;
}

/* ─── Acciones ─── */
.am-actions {
    margin-top: auto;
    padding-top: 0.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.am-btn {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    text-decoration: none;
    cursor: pointer;
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition:
        transform 0.15s ease,
        filter 0.2s ease;
}

.am-btn:hover {
    transform: translateY(-1px);
    filter: brightness(0.97);
}

.am-btn--ghost {
    background: #f5ecdd;
    border-color: #deceb2;
    color: #6d5528;
}

.am-btn--gold {
    background: linear-gradient(135deg, #f7e0b9 0%, #e8c58e 100%);
    border-color: #cb9d5f;
    color: #3f2a10;
}

/* ─── Otros productos (navegación inferior) ─── */
.am-other-products {
    margin-top: 0.5rem;
    padding-top: 0.6rem;
    border-top: 1px solid #e8dccb;
}

.am-other-products__title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9a7d5a;
    margin: 0 0 0.55rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.am-other-products__title i {
    color: var(--am-gold);
    font-size: 0.85em;
}

.am-other-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(140px, 170px);
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: #bd9a7f transparent;
}

.am-other-row::-webkit-scrollbar {
    height: 4px;
}
.am-other-row::-webkit-scrollbar-track {
    background: transparent;
}
.am-other-row::-webkit-scrollbar-thumb {
    background: #bd9a7f;
    border-radius: 4px;
}

.am-other-card {
    border: 1px solid #e2d3bb;
    border-radius: 14px;
    background: #fff;
    color: #33291d;
    cursor: pointer;
    text-align: left;
    padding: 0;
    overflow: hidden;
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}

.am-other-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(47, 35, 27, 0.12);
    border-color: var(--am-gold);
}

.am-other-card.is-active {
    border-color: var(--am-gold);
    box-shadow: 0 0 0 2px rgba(195, 154, 95, 0.2);
}

.am-other-card img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
}

.am-other-card__body {
    padding: 0.45rem 0.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.am-other-card__body strong {
    display: block;
    font-size: 0.75rem;
    color: #2f231b;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.am-other-card__body small {
    font-size: 0.7rem;
    color: #8a6a3a;
    font-weight: 700;
}

/* ─── Estados ─── */
.am-status {
    margin: 0;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    border: 1px dashed #dcc8a3;
    background: #fbf3e5;
    color: #6c5223;
    font-size: 0.84rem;
    line-height: 1.5;
}

.am-status.is-info {
    border-color: #c4dce0;
    background: #eaf6f8;
    color: #265f66;
}

.am-status.is-danger {
    border-color: #efc8c3;
    background: #faece9;
    color: #8e3f35;
}

/* ─── Zoom overlay ─── */
.am-zoom-overlay {
    position: fixed;
    inset: 0;
    z-index: 1600;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.am-zoom-overlay img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

.am-zoom-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.am-zoom-close:hover {
    background: rgba(0, 0, 0, 0.85);
}

/* ─── Animaciones ─── */
@keyframes am-fade-in {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.995);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ─── Responsive ─── */
@media (max-width: 880px) {
    .am-detail {
        grid-template-columns: 1fr;
    }

    .am-gallery-main {
        max-width: 500px;
        margin: 0 auto;
        aspect-ratio: 4 / 5;
    }

    .am-info__title {
        font-size: clamp(1.3rem, 5vw, 1.8rem);
    }

    .am-other-row {
        grid-auto-columns: minmax(120px, 150px);
    }
}

@media (max-width: 580px) {
    .am-modal {
        padding: 0.2rem;
    }

    .am-modal__dialog {
        border-radius: 16px;
        width: calc(100vw - 0.4rem);
        max-height: calc(100vh - 0.4rem);
    }

    .am-modal__bar,
    .am-modal__content {
        padding: 0.6rem;
    }

    .am-gallery-main {
        aspect-ratio: 1 / 1;
        max-height: 380px;
    }

    .am-details-grid {
        grid-template-columns: 1fr;
    }

    .am-other-row {
        grid-auto-columns: minmax(100px, 130px);
    }
}
