/* Tienda (merchandising). Usa los colores del tema del sitio para verse bien en claro y oscuro. */
.merch {
    --merch-accent: #d9235f;
    --merch-accent-ink: #ffffff;
    --merch-radius: 18px;
    --merch-photo-bg: #f1ede6;
    padding-bottom: 96px;
    background: var(--site-theme-bg);
    color: var(--site-theme-text);
}

.merch-container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}

.merch-kicker {
    margin: 0 0 8px;
    color: var(--merch-accent);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

@keyframes merch-bump {
    50% { transform: scale(1.35); }
}

/* Botones */
.merch-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 22px;
    border: 1px solid var(--site-theme-border);
    border-radius: 999px;
    background: var(--site-theme-surface);
    color: var(--site-theme-text);
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}

.merch-button:hover { transform: translateY(-1px); }

.merch-button--primary {
    border-color: var(--merch-accent);
    background: var(--merch-accent);
    color: var(--merch-accent-ink);
}

.merch-link {
    border: 0;
    background: none;
    color: var(--site-theme-link);
    text-decoration: underline;
    cursor: pointer;
}

/* Portada */
.merch-hero {
    padding: 40px 0 28px;
    background:
        radial-gradient(circle at 12% 18%, rgba(217, 35, 95, 0.28), transparent 55%),
        radial-gradient(circle at 88% 10%, rgba(242, 189, 115, 0.25), transparent 50%),
        #17120d;
    color: #fff;
}

.merch-hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    gap: 32px;
}

.merch-hero__inner--solo { grid-template-columns: minmax(0, 1fr); }

.merch-hero .merch-kicker { color: #f2bd73; }

.merch-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(2.2rem, 6vw, 3.8rem);
    font-weight: 900;
    line-height: 1.02;
}

.merch-hero__lead {
    max-width: 520px;
    margin: 0 0 22px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.08rem;
}

.merch-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.merch-hero .merch-button:not(.merch-button--primary) {
    border-color: rgba(255, 255, 255, 0.35);
    background: transparent;
    color: #fff;
}

.merch-hero__visual {
    position: relative;
    height: 340px;
}

.merch-hero__visual a {
    position: absolute;
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 20px;
    background: #f3f1ed;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
    transition: transform 200ms ease;
}

.merch-hero__visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.merch-hero__visual img.is-cover {
    object-fit: contain;
    padding: 8%;
}

/* Una, dos o tres fotos: la primera grande y el resto asomando detrás. */
.merch-hero__visual--1 a { left: 18%; top: 0; width: 64%; transform: rotate(-3deg); }
.merch-hero__visual--2 a:nth-child(1),
.merch-hero__visual--3 a:nth-child(1) { left: 4%; top: 12px; z-index: 2; width: 54%; transform: rotate(-5deg); }
.merch-hero__visual--2 a:nth-child(2) { right: 4%; top: 0; width: 46%; transform: rotate(4deg); }
.merch-hero__visual--3 a:nth-child(2) { right: 4%; top: 0; width: 40%; transform: rotate(5deg); }
.merch-hero__visual--3 a:nth-child(3) { right: 18%; bottom: 0; z-index: 3; width: 34%; transform: rotate(-2deg); }

/* Entrega */
.merch-delivery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0 16px;
    padding: 0;
    list-style: none;
}

.merch-delivery li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid var(--site-theme-border);
    border-radius: var(--merch-radius);
    background: var(--site-theme-surface);
}

.merch-delivery i {
    color: var(--merch-accent);
    font-size: 1.5rem;
    line-height: 1;
}

.merch-delivery strong {
    display: block;
    margin-bottom: 2px;
}

.merch-delivery span {
    color: var(--site-theme-muted);
    font-size: 0.92rem;
}

.merch-delivery strong { color: var(--site-theme-text); }

.merch-delivery--compact {
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 10px 0 0;
}

.merch-delivery--compact li {
    padding: 10px 12px;
    border-radius: 12px;
}

.merch-beta {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--site-theme-warning-bg);
    color: var(--site-theme-warning);
    font-size: 0.92rem;
}

.merch-alert {
    margin: 12px 0;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--site-theme-danger-bg);
    color: var(--site-theme-danger);
    font-weight: 600;
}

.merch-alert--info {
    background: var(--site-theme-info-bg);
    color: var(--site-theme-info);
}

/* Catálogo */
.merch-catalog { margin-top: 20px; }

.merch-catalog__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.merch-catalog__head h2,
.merch-faq h2,
.merch-related h2 {
    margin: 0;
    font-size: clamp(1.4rem, 3.5vw, 1.9rem);
    font-weight: 900;
}

.merch-filters {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.merch-filters a {
    flex: 0 0 auto;
    padding: 8px 14px;
    border: 1px solid var(--site-theme-border);
    border-radius: 999px;
    color: var(--site-theme-text);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.merch-filters a[aria-current="page"] {
    border-color: var(--site-theme-text);
    background: var(--site-theme-text);
    color: var(--site-theme-bg);
}

.merch-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px 18px;
}

.merch-card {
    display: flex;
    flex-direction: column;
}

.merch-card__media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--merch-radius);
    background: var(--merch-photo-bg);
}

.merch-card__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.35s ease;
}

.merch-card__media img.is-cover {
    width: auto;
    height: 74%;
    margin-top: 12%;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
}

.merch-card:hover .merch-card__media img { transform: scale(1.04); }

.merch-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #17120d;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
}

.merch-card__body { padding: 12px 2px 0; }

.merch-badge--muted { background: #6b655c; }
.merch-card.is-sold-out .merch-card__media img { opacity: 0.55; filter: grayscale(0.6); }

.merch-card__low,
.merch-buy__low {
    color: var(--merch-accent);
    font-size: 0.8rem;
    font-weight: 800;
}

.merch-buy__low { margin: 0; font-size: 0.95rem; }

.merch-line__warn {
    display: block;
    margin-bottom: 6px;
    color: var(--site-theme-danger);
    font-size: 0.85rem;
    font-weight: 700;
}

.merch-card__category {
    margin: 0 0 2px;
    color: var(--site-theme-muted);
    font-size: 0.8rem;
}

.merch-card__title {
    margin: 0 0 2px;
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.25;
}

.merch-card__title a {
    color: var(--site-theme-text);
    text-decoration: none;
}

.merch-card__tagline {
    margin: 0 0 6px;
    color: var(--site-theme-muted);
    font-size: 0.88rem;
}

.merch-card__price {
    margin: 0;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

/* Ficha */
.merch-crumbs {
    margin: 18px 0;
    color: var(--site-theme-muted);
    font-size: 0.88rem;
}

.merch-crumbs a { color: var(--site-theme-muted); }

.merch-product {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.merch-product__media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border-radius: 24px;
    background: var(--merch-photo-bg);
    overflow: hidden;
}

.merch-product__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.merch-product__media img.is-cover {
    width: auto;
    height: 84%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
}

.merch-product__info h1 {
    margin: 0 0 6px;
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    font-weight: 900;
    line-height: 1.08;
}

.merch-product__tagline {
    margin: 0 0 14px;
    color: var(--site-theme-muted);
    font-size: 1.05rem;
}

.merch-product__price {
    margin: 0 0 22px;
    font-size: 1.7rem;
    font-weight: 900;
}

.merch-product__price small {
    color: var(--site-theme-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.merch-buy {
    display: grid;
    gap: 16px;
    margin-bottom: 22px;
}

.merch-sizes {
    margin: 0;
    padding: 0;
    border: 0;
}

.merch-sizes legend {
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 800;
}

.merch-sizes__hint {
    margin-left: 6px;
    color: var(--site-theme-muted);
    font-weight: 500;
}

.merch-sizes__options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.merch-sizes label { position: relative; display: inline-grid; justify-items: center; gap: 2px; }
.merch-sizes label small { color: var(--merch-accent); font-size: 0.72rem; font-weight: 700; }
.merch-sizes label.is-out span { opacity: 0.4; text-decoration: line-through; cursor: not-allowed; }

.merch-sizes input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.merch-sizes__options span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    height: 48px;
    padding: 0 12px;
    border: 2px solid var(--site-theme-border);
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
}

.merch-sizes__options input:checked + span {
    border-color: var(--site-theme-text);
    background: var(--site-theme-text);
    color: var(--site-theme-bg);
}

.merch-sizes__options input:focus-visible + span,
.merch-method input:focus-visible + span {
    outline: 3px solid var(--site-theme-focus);
    outline-offset: 2px;
}

.merch-buy__row {
    display: flex;
    gap: 10px;
}

.merch-qty select,
.merch-line__qty select,
.merch-fields input,
.merch-fields select {
    height: 48px;
    padding: 0 12px;
    border: 1px solid var(--site-theme-border);
    border-radius: 12px;
    background: var(--site-theme-surface);
    color: var(--site-theme-text);
    font: inherit;
}

.merch-buy__submit { flex: 1; }

.merch-buy__error {
    margin: 0;
    color: var(--site-theme-danger);
    font-weight: 700;
}

.merch-product__description { margin: 0 0 10px; }

.merch-product__details {
    margin: 0 0 18px;
    padding-left: 18px;
    color: var(--site-theme-muted);
}

.merch-product__more,
.merch-faq details {
    border-top: 1px solid var(--site-theme-border);
    padding: 14px 0;
}

.merch-product__more summary,
.merch-faq summary {
    font-weight: 800;
    cursor: pointer;
}

.merch-product__more p,
.merch-faq p {
    margin: 10px 0 0;
    color: var(--site-theme-muted);
}

.merch-size-table {
    width: 100%;
    margin-top: 8px;
    border-collapse: collapse;
    text-align: center;
}

.merch-size-table th,
.merch-size-table td {
    padding: 6px;
    border: 1px solid var(--site-theme-border);
}

.merch-related { margin-top: 56px; }
.merch-related h2 { margin-bottom: 18px; }

.merch-faq {
    max-width: 760px;
    margin-top: 56px;
}

.merch-faq h2 { margin-bottom: 10px; }

/* Carrito */
.merch-cart__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
}

.merch-cart__back,
.merch-cart__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--merch-accent);
    font-weight: 800;
    text-decoration: none;
}

.merch-cart__back:hover,
.merch-cart__more:hover { text-decoration: underline; }

.merch-cart__more { margin: -12px 0 24px; }

/* Quitar una línea del carrito */
.merch-line__remove { margin: 0; }

.merch-line__remove button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--site-theme-border);
    border-radius: 50%;
    background: transparent;
    color: var(--site-theme-muted);
    cursor: pointer;
}

.merch-line__remove button:hover,
.merch-line__remove button:focus-visible {
    border-color: var(--merch-accent);
    color: var(--merch-accent);
}

/* «−15 % en tu entrada» junto a la recogida en show */
.merch-method__deal {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--merch-accent);
    color: var(--merch-accent-ink);
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 800;
    white-space: nowrap;
}

.merch-cart h1,
.merch-done h1 {
    margin: 28px 0 18px;
    font-size: clamp(1.8rem, 4.5vw, 2.4rem);
    font-weight: 900;
}

.merch-cart__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

.merch-lines {
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
}

.merch-line {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr) auto auto;
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--site-theme-border);
}

.merch-line__media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    border-radius: 14px;
    background: var(--merch-photo-bg);
    overflow: hidden;
}

.merch-line__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.merch-line__media img.is-cover { width: auto; height: 86%; }

.merch-line__name {
    display: block;
    color: var(--site-theme-text);
    font-weight: 800;
    text-decoration: none;
}

.merch-line__meta {
    display: block;
    margin-bottom: 6px;
    color: var(--site-theme-muted);
    font-size: 0.88rem;
}

.merch-line__qty select { height: 38px; }

.merch-line__total {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.merch-checkout h2,
.merch-summary h2 {
    margin: 20px 0 12px;
    font-size: 1.2rem;
    font-weight: 900;
}

.merch-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.merch-fields label {
    display: grid;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 700;
}

.merch-fields input,
.merch-fields select { width: 100%; font-weight: 400; }

.merch-fields__wide,
.merch-fields label:has(select) { grid-column: 1 / -1; }

.merch-optional {
    color: var(--site-theme-muted);
    font-weight: 400;
}

.merch-fields[hidden],
.merch-fields label[hidden] { display: none; }

.merch-methods {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.merch-method { position: relative; }

.merch-method input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.merch-method span {
    display: grid;
    gap: 2px;
    padding: 14px 16px 14px 46px;
    border: 2px solid var(--site-theme-border);
    border-radius: 14px;
    background: var(--site-theme-surface);
    cursor: pointer;
}

.merch-method span::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 16px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--site-theme-muted);
    border-radius: 50%;
}

.merch-method input:checked + span {
    border-color: var(--merch-accent);
}

.merch-method input:checked + span::before {
    border: 6px solid var(--merch-accent);
}

.merch-method small { color: var(--site-theme-muted); }

.merch-method.is-disabled { opacity: 0.55; }

.merch-summary {
    padding: 20px;
    border: 1px solid var(--site-theme-border);
    border-radius: var(--merch-radius);
    background: var(--site-theme-surface);
}

.merch-summary h2 { margin-top: 0; }

.merch-summary dl { margin: 0 0 16px; }

.merch-summary dl div {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}

.merch-summary dt { font-weight: 600; }
.merch-summary dd { margin: 0; font-variant-numeric: tabular-nums; }

.merch-summary__total {
    margin-top: 6px;
    border-top: 1px solid var(--site-theme-border);
    font-size: 1.2rem;
    font-weight: 900;
}

.merch-summary__pay { width: 100%; }

/* Al llegar con «Comprar ya» (#pagar) que el header no tape el principio del formulario */
.merch-checkout {
    scroll-margin-top: calc(var(--site-header-height, 72px) + 16px);
}

/* «Añadir al carrito» debajo de «Comprar ya» en la ficha */
.merch-buy__add {
    width: 100%;
    margin-top: 10px;
}

/* Datos recordados: una línea «Enviar a…» que se despliega con «Cambiar» */
.merch-saved {
    margin-bottom: 18px;
    border: 1px solid var(--site-theme-border);
    border-radius: var(--merch-radius);
    background: var(--site-theme-surface);
}

.merch-saved > summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    cursor: pointer;
    list-style: none;
}

.merch-saved > summary::-webkit-details-marker { display: none; }

.merch-saved > summary > i {
    color: var(--merch-accent);
    font-size: 1.4rem;
}

.merch-saved > summary > span:first-of-type {
    display: grid;
    flex: 1;
    min-width: 0;
}

.merch-saved > summary small {
    overflow: hidden;
    color: var(--site-theme-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.merch-saved__change {
    color: var(--merch-accent);
    font-weight: 800;
}

.merch-saved[open] > summary { border-bottom: 1px solid var(--site-theme-border); }
.merch-saved[open] .merch-saved__change { visibility: hidden; }
.merch-saved[open] > :not(summary) { margin-right: 16px; margin-left: 16px; }
.merch-saved[open] > :last-child { margin-bottom: 16px; }

.merch-summary__secure {
    margin: 10px 0 14px;
    color: var(--site-theme-muted);
    font-size: 0.82rem;
    text-align: center;
}

.merch-empty,
.merch-done {
    text-align: center;
}

.merch-empty {
    padding: 48px 0;
}

.merch-empty i,
.merch-done__icon {
    color: var(--merch-accent);
    font-size: 3rem;
}

.merch-done {
    max-width: 620px;
    padding-top: 36px;
}

.merch-done__lead { color: var(--site-theme-muted); }

.merch-done__card {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid var(--site-theme-border);
    border-radius: var(--merch-radius);
    background: var(--site-theme-surface);
    text-align: left;
}

.merch-done__card ul { padding-left: 18px; }

.merch-done__code {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--site-theme-warning-bg);
}

/* Aviso al añadir al carrito */
.merch-toast {
    position: fixed;
    left: 50%;
    bottom: calc(96px + env(safe-area-inset-bottom));
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    max-width: calc(100% - 32px);
    white-space: nowrap;
    padding: 12px 14px 12px 18px;
    border-radius: 999px;
    background: #17120d;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    transform: translateX(-50%);
}

.merch-toast a {
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--merch-accent);
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

@media (max-width: 960px) {
    .merch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .merch-delivery:not(.merch-delivery--compact) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .merch-hero__inner,
    .merch-product,
    .merch-cart__layout { grid-template-columns: 1fr; }
    .merch-hero__visual { height: 260px; }
}

@media (max-width: 680px) {
    .merch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
    .merch-delivery:not(.merch-delivery--compact) { grid-template-columns: 1fr; }
    .merch-hero { padding-top: 28px; }
    .merch-hero__visual { height: 210px; }
    .merch-fields { grid-template-columns: 1fr; }
    .merch-line { grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: 10px; }
    .merch-line__media { width: 64px; height: 64px; }
}
