/* ── Mega Menu ──────────────────────────────────────────────
 * Idea: la etiqueta de cuero del jean (hero del sitio).
 * Acento = cuero; costuras punteadas como detalle recurrente.
 */
.agc-mega {
    --agc-ink: #1F1A17;
    --agc-muted: #8C8580;
    --agc-line: #EFE9E4;
    --agc-accent: var(--agc-mega-panel-hover, #CF8F64);
    --agc-accent-deep: color-mix(in srgb, var(--agc-accent) 72%, #000);
    --agc-leather: color-mix(in srgb, var(--agc-accent) 80%, #000);
    --agc-leather-deep: color-mix(in srgb, var(--agc-accent) 66%, #000);
    --agc-sale: #D7263D;
    --agc-ease: cubic-bezier(.2, .7, .2, 1);
    position: relative;
}

.agc-mega__bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--agc-mega-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* El li NO es relativo: el panel se centra respecto al nav, no al ítem. */
.agc-mega__item {
    position: static;
    margin: 0;
}

/* ── Links superiores ── */
.agc-mega__top {
    position: relative;
    display: block;
    padding: 12px 0;
    color: var(--agc-mega-color);
    font-size: var(--agc-mega-size);
    text-transform: var(--agc-mega-transform);
    letter-spacing: .03em;
    text-decoration: none;
    transition: color .2s ease;
}

/* Costura bajo el ítem abierto / actual */
.agc-mega__top::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    border-bottom: 1.5px dashed currentColor;
    clip-path: inset(0 100% 0 0);
    transition: clip-path .35s var(--agc-ease);
}

.agc-mega__top:hover,
.agc-mega__top:focus-visible,
.agc-mega__item.is-open > .agc-mega__top,
.agc-mega__item.is-current > .agc-mega__top {
    color: var(--agc-mega-hover);
}

.agc-mega__item.is-open > .agc-mega__top::after,
.agc-mega__item.is-current > .agc-mega__top::after {
    clip-path: inset(0 0 0 0);
}

.agc-mega__top:focus-visible {
    outline: 2px solid var(--agc-accent);
    outline-offset: 4px;
    border-radius: 2px;
}

/* ── Panel ── */
.agc-mega__panel {
    position: absolute;
    top: 100%;
    left: 50%;
    z-index: 9999;
    width: min(var(--agc-mega-width), calc(100vw - 32px));
    padding-top: 14px; /* puente para que el hover no se corte */
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 10px);
    transition: opacity .22s ease, transform .3s var(--agc-ease), visibility 0s linear .3s;
}

.agc-mega__item.is-open > .agc-mega__panel,
.agc-mega__item--has-panel:focus-within > .agc-mega__panel {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition: opacity .22s ease, transform .3s var(--agc-ease), visibility 0s;
}

.agc-mega__inner {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 44px;
    padding: 20px 44px 20px 20px;
    background: var(--agc-mega-panel-bg);
    color: var(--agc-mega-panel-color);
    border: 1px solid var(--agc-line);
    border-radius: 0 0 14px 14px;
    box-shadow: 0 24px 48px -20px rgba(31, 26, 23, .22);
    text-align: left;
}

.agc-mega__inner.has-image {
    grid-template-columns: 190px minmax(0, 1fr) minmax(200px, 26%);
}

/* ── Etiqueta de cuero (firma del panel) ── */
.agc-mega__label {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    min-height: 190px;
    padding: 22px 20px;
    background: var(--agc-leather);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    overflow: hidden;
    transition: background-color .25s ease;
}

/* costura */
.agc-mega__label::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1.5px dashed rgba(255, 255, 255, .55);
    border-radius: 5px;
    pointer-events: none;
}

.agc-mega__label:hover {
    background: var(--agc-leather-deep);
    color: #fff;
}

.agc-mega__label:focus-visible {
    outline: 2px solid var(--agc-ink);
    outline-offset: 3px;
}

.agc-mega__label-name {
    font-size: 30px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -.02em;
    text-transform: capitalize;
}


.agc-mega__label-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.agc-mega__label-cta span {
    transition: transform .25s var(--agc-ease);
}

.agc-mega__label:hover .agc-mega__label-cta span {
    transform: translateX(4px);
}

/* ── Listado de subcategorías ── */
.agc-mega__content {
    align-self: center;
    padding: 12px 0;
}

.agc-mega__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.agc-mega__list--cols {
    columns: var(--agc-mega-cols);
    column-gap: 40px;
}

.agc-mega__list li {
    margin: 0;
    break-inside: avoid;
}

.agc-mega__link {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 9px 0;
    color: var(--agc-ink);
    font-size: 15px;
    line-height: 1.3;
    text-decoration: none;
}

.agc-mega__link-text {
    position: relative;
    transition: color .2s ease;
}

/* costura que se dibuja al hover */
.agc-mega__link-text::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    border-bottom: 1.5px dashed currentColor;
    clip-path: inset(0 100% 0 0);
    transition: clip-path .3s var(--agc-ease);
}

.agc-mega__link:hover .agc-mega__link-text,
.agc-mega__link:focus-visible .agc-mega__link-text {
    color: var(--agc-accent-deep);
}

.agc-mega__link:hover .agc-mega__link-text::after,
.agc-mega__link:focus-visible .agc-mega__link-text::after {
    clip-path: inset(0 0 0 0);
}

.agc-mega__link:focus-visible {
    outline: none;
}


/* REBAJAS resaltado (igual que en mobile) */
.agc-mega__link[class*="agc-mega__link--rebaja"] .agc-mega__link-text,
.agc-mega__link[class*="agc-mega__link--rebaja"]:hover .agc-mega__link-text {
    color: var(--agc-sale);
    font-weight: 600;
}


/* Subcategorías con hijos: título + lista */
.agc-mega__groups {
    display: grid;
    grid-template-columns: repeat(var(--agc-mega-cols), minmax(0, 1fr));
    gap: 28px 40px;
}

.agc-mega__heading {
    display: block;
    margin-bottom: 6px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--agc-line);
    color: var(--agc-ink);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color .2s ease;
}

.agc-mega__heading:hover {
    color: var(--agc-accent-deep);
}

/* Entrada escalonada de los links */
.agc-mega__list--cols > li,
.agc-mega__group {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .25s ease, transform .3s var(--agc-ease);
}

.agc-mega__item.is-open .agc-mega__list--cols > li,
.agc-mega__item.is-open .agc-mega__group,
.agc-mega__item--has-panel:focus-within .agc-mega__list--cols > li,
.agc-mega__item--has-panel:focus-within .agc-mega__group {
    opacity: 1;
    transform: none;
    transition-delay: calc(60ms + var(--i, 0) * 22ms);
}

/* ── Banner opcional ── */
.agc-mega__banner {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    margin: 0 -24px 0 0;
}

.agc-mega__img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 200px;
    max-height: 300px;
    object-fit: cover;
    transition: transform .6s var(--agc-ease);
}

a.agc-mega__banner:hover .agc-mega__img {
    transform: scale(1.04);
}

/* Pantallas medianas: etiqueta más angosta */
@media (max-width: 1200px) {
    .agc-mega__inner,
    .agc-mega__inner.has-image {
        grid-template-columns: 160px minmax(0, 1fr);
        gap: 32px;
    }
    .agc-mega__banner {
        display: none;
    }
    .agc-mega__label-name {
        font-size: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .agc-mega *,
    .agc-mega *::before,
    .agc-mega *::after,
    .agc-mega__panel {
        transition: none !important;
    }
    .agc-mega__list--cols > li,
    .agc-mega__group {
        opacity: 1;
        transform: none;
    }
}
