/* ── TennisShop Shopify — Product Grid Widget ──────────────────────────── */

.elementor-widget-tsg_shopify_product_grid {
    --tsg-sp-blue:      #001489;
    --tsg-sp-orange:    #e66415;
    --tsg-sp-ink:       #141414;
    --tsg-sp-muted:     #64748b;
    --tsg-sp-border:    #e5e7eb;
    --tsg-sp-surface:   #ffffff;
    --tsg-sp-radius:    10px;
    --tsg-sp-font:      "Montserrat", "Gotham", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Ancho amplio: rompe el contenedor boxed de Elementor y ocupa ~75% del
 * viewport, centrado (en pantallas medianas/pequeñas vuelve al 100%). */
.tsg-sp-archive--full {
    width: 75vw;
    margin-left: calc(50% - 37.5vw);
    box-sizing: border-box;
}
@media (max-width: 1100px) {
    .tsg-sp-archive--full {
        width: 100vw;
        margin-left: calc(50% - 50vw);
        padding-left: clamp(14px, 3vw, 32px);
        padding-right: clamp(14px, 3vw, 32px);
    }
}

/* Listón de presentación (hero) — SIEMPRE a todo el ancho de la pantalla,
 * aunque el archive esté contenido al 75%. */
.tsg-sp-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 28px;
}
.tsg-sp-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(0,20,137,.82) 0%, rgba(0,20,137,.55) 45%, rgba(230,100,21,.45) 100%);
}
.tsg-sp-hero__inner {
    position: relative;
    text-align: center;
    padding: 44px 20px;
}
.tsg-sp-hero__title {
    font-family: "Barlow Condensed", var(--tsg-sp-font);
    font-style: italic;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .01em;
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    color: #fff;
    margin: 0 0 6px;
    text-shadow: 0 2px 14px rgba(0,0,0,.35);
}
.tsg-sp-hero__subtitle {
    font-family: var(--tsg-sp-font);
    font-size: clamp(.95rem, 2vw, 1.15rem);
    color: rgba(255,255,255,.92);
    margin: 0;
    text-shadow: 0 1px 8px rgba(0,0,0,.35);
}
.tsg-sp-hero__maps {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 16px;
    padding: 10px 22px;
    background: var(--tsg-sp-orange);
    color: #fff !important;
    border-radius: 999px;
    font-family: var(--tsg-sp-font);
    font-weight: 800;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    text-decoration: none !important;
    box-shadow: 0 6px 18px rgba(0,0,0,.28);
    transition: transform .15s ease, background .15s ease;
}
.tsg-sp-hero__maps:hover { transform: translateY(-2px); background: #f07a30; }

/* Listón Cashea — a todo el ancho, amarillo de marca Cashea */
.tsg-sp-cashea {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-top: -29px; /* -28px + 1px de solape para tragar cualquier hairline por redondeo subpixel */
    margin-bottom: 26px;
    background: #f8f32b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px clamp(14px, 4vw, 40px);
    flex-wrap: wrap;
}
.tsg-sp-cashea img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: block;
}
.tsg-sp-cashea__brand {
    font-family: "Barlow Condensed", var(--tsg-sp-font);
    font-style: italic;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .02em;
    font-size: 1.15rem;
    color: #111;
    line-height: 1;
}
.tsg-sp-cashea__text {
    font-family: var(--tsg-sp-font);
    font-weight: 600;
    font-size: .85rem;
    color: #333;
}

/* Toolbar — misma línea gráfica de la barra de filtros del calendario:
 * barra blanca redondeada con sombra suave, pills con chevron propio y
 * foco naranja. */
.tsg-sp-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    background: var(--tsg-sp-surface);
    border-radius: 18px;
    padding: 12px 16px;
    box-shadow: 0 4px 14px rgba(15,23,42,.05);
}
.tsg-sp-search {
    flex: 1 1 230px;
    min-width: 0;
    height: 38px;
    padding: 0 18px 0 44px !important; /* la lupa vive a la izquierda — que no se solape con el placeholder */
    box-sizing: border-box;
    border: 1.5px solid var(--tsg-sp-border);
    border-radius: 999px;
    font-family: var(--tsg-sp-font);
    font-size: 13px;
    font-weight: 600;
    color: var(--tsg-sp-ink);
    background: #fff url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='%2364748b' stroke-width='2.4'/%3E%3Cpath d='M16.5 16.5L21 21' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 14px center;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.tsg-sp-search:focus {
    outline: none;
    border-color: var(--tsg-sp-orange);
    box-shadow: 0 0 0 3px rgba(230,100,21,.15);
}
.tsg-sp-filter-collection,
.tsg-sp-filter-discipline {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 1 210px;
    height: 38px;
    padding: 0 38px 0 18px;
    border: 1.5px solid var(--tsg-sp-border);
    border-radius: 999px;
    font-family: var(--tsg-sp-font);
    font-size: 13px;
    font-weight: 600;
    color: var(--tsg-sp-ink);
    background: #fff url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23001489' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease;
    line-height: 1;
}
.tsg-sp-filter-collection:hover,
.tsg-sp-filter-collection:focus,
.tsg-sp-filter-discipline:hover,
.tsg-sp-filter-discipline:focus {
    border-color: var(--tsg-sp-orange);
    box-shadow: 0 0 0 3px rgba(230,100,21,.15);
    outline: none;
}

/* Cargar más */
.tsg-sp-loadmore-wrap { text-align: center; margin-top: 22px; }
.tsg-sp-loadmore {
    padding: 11px 28px;
    background: transparent;
    color: var(--tsg-sp-blue);
    border: 1.5px solid var(--tsg-sp-blue);
    border-radius: 999px;
    font-family: var(--tsg-sp-font);
    font-weight: 700;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.tsg-sp-loadmore:hover { background: var(--tsg-sp-blue); color: #fff; }
.tsg-sp-loadmore:disabled { opacity: .5; cursor: default; }

/* Grid */
.tsg-sp-grid {
    display: grid;
    gap: 16px;
}
.tsg-sp-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.tsg-sp-grid--cols-5 { grid-template-columns: repeat(5, 1fr); }
.tsg-sp-grid--cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 1300px) {
    .tsg-sp-grid--cols-6 { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 1100px) {
    .tsg-sp-grid--cols-6,
    .tsg-sp-grid--cols-5 { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
    .tsg-sp-grid--cols-6,
    .tsg-sp-grid--cols-5 { grid-template-columns: repeat(3, 1fr); }
    .tsg-sp-grid--cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
    .tsg-sp-grid--cols-4,
    .tsg-sp-grid--cols-5,
    .tsg-sp-grid--cols-6 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ── Ajustes móviles de la tienda ── */
@media (max-width: 900px) {
    /* El header del sitio (transparente/superpuesto) tapaba el cintillo:
     * empujamos el contenido del hero hacia abajo para que "Nuestra Tienda"
     * arranque debajo del header. */
    .tsg-sp-hero { min-height: 300px; padding-top: 88px; box-sizing: border-box; }
}
@media (max-width: 640px) {
    .tsg-sp-hero__inner { padding: 20px 16px 30px; }
    .tsg-sp-cashea { gap: 8px; padding: 8px 14px; }
    .tsg-sp-cashea__brand { font-size: 1rem; }
    .tsg-sp-cashea__text { font-size: .74rem; }
    .tsg-sp-card__body { padding: 9px 10px 11px; gap: 3px; }
    /* Barlow Condensed 900 se ve óptica­mente grande: en teléfono el nombre
     * va bien pequeño y compacto (con !important para ganar a cualquier
     * regla previa cacheada o del kit de Elementor). */
    .tsg-sp-card__title {
        font-size: 11px !important;
        line-height: 1.15 !important;
        letter-spacing: 0 !important;
    }
    .tsg-sp-card__cat { font-size: 8px; letter-spacing: .5px; }
    .tsg-sp-price { font-size: 12px !important; }
    .tsg-sp-price__now { font-size: 13px !important; }
    .tsg-sp-price__was { font-size: 10px !important; }
    .tsg-sp-stock, .tsg-sp-cachealo { font-size: .6rem; padding: 2px 7px; }
    .tsg-sp-cachealo { padding-left: 3px; }
    .tsg-sp-cachealo img { width: 13px; height: 13px; }
    /* Precio en promoción: apilado — el naranja arriba, el tachado abajo
     * más pequeño (en fila se desbordaba de la card). */
    .tsg-sp-price--sale { flex-direction: column; align-items: flex-start; gap: 0; }
    .tsg-sp-price__was { font-size: .66rem; line-height: 1.2; }

    /* Comprar + Agregar uno al lado del otro no entraban en 2 columnas de
     * teléfono — el texto quedaba cortado. Se apilan, cada uno a todo el
     * ancho de la tarjeta. */
    .tsg-sp-actions { flex-direction: column; gap: 6px; }
    .tsg-sp-actions .tsg-sp-btn { width: 100%; padding: 8px 10px; font-size: .74rem; }
}

/* Controles de vista: columnas (4/5/6) + grilla/línea — estilo "page dots"
 * del calendario. */
.tsg-sp-viewtools {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-left: auto;
}
.tsg-sp-gridswitch, .tsg-sp-viewswitch {
    display: flex;
    gap: 5px;
    align-items: center;
}
.tsg-sp-gridswitch__btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid var(--tsg-sp-border);
    color: var(--tsg-sp-muted);
    font-family: var(--tsg-sp-font);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all .15s ease;
    line-height: 1;
    padding: 0;
}
.tsg-sp-gridswitch__btn:hover { border-color: var(--tsg-sp-blue); color: var(--tsg-sp-blue); }
.tsg-sp-gridswitch__btn.is-active {
    background: var(--tsg-sp-blue);
    border-color: var(--tsg-sp-blue);
    color: #fff;
}
.tsg-sp-viewswitch {
    border-left: 1.5px solid var(--tsg-sp-border);
    padding-left: 14px;
}
.tsg-sp-viewswitch__btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: transparent;
    border: 1.5px solid var(--tsg-sp-border);
    color: var(--tsg-sp-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s ease;
    padding: 0;
}
.tsg-sp-viewswitch__btn:hover { border-color: var(--tsg-sp-orange); color: var(--tsg-sp-orange); }
.tsg-sp-viewswitch__btn.is-active {
    background: var(--tsg-sp-orange);
    border-color: var(--tsg-sp-orange);
    color: #fff;
}
@media (max-width: 900px) {
    .tsg-sp-gridswitch { display: none; } /* en móvil manda el responsive */
}

/* ── Vista en LÍNEA (lista) ── */
.tsg-sp-grid--listview { display: flex; flex-direction: column; }
.tsg-sp-grid--listview .tsg-sp-card {
    flex-direction: row;
    align-items: stretch;
}
.tsg-sp-grid--listview .tsg-sp-card__img-wrap {
    flex: 0 0 132px;
    aspect-ratio: 1 / 1;
    align-self: center;
    margin: 10px 0 10px 10px;
    border-radius: 12px;
    overflow: hidden;
}
.tsg-sp-grid--listview .tsg-sp-card__body {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 18px;
    padding: 14px 18px;
}
.tsg-sp-grid--listview .tsg-sp-card__cat { flex: 0 0 100%; }
.tsg-sp-grid--listview .tsg-sp-card__title {
    flex: 1 1 280px;
    margin: 0;
    font-size: 1.2rem;
}
.tsg-sp-grid--listview .tsg-sp-price { flex: 0 0 auto; }
.tsg-sp-grid--listview .tsg-sp-card__flags { flex: 0 0 auto; margin-bottom: 0; }
.tsg-sp-grid--listview .tsg-sp-actions {
    flex: 0 0 auto;
    margin-top: 0;
    margin-left: auto;
    min-width: 190px;
}
@media (max-width: 640px) {
    .tsg-sp-grid--listview .tsg-sp-card__img-wrap { flex-basis: 96px; }
    .tsg-sp-grid--listview .tsg-sp-card__title { font-size: 1rem; }
    .tsg-sp-grid--listview .tsg-sp-actions { min-width: 0; flex: 1 1 100%; }
}

/* Loading & empty */
.tsg-sp-loading,
.tsg-sp-empty,
.tsg-sp-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem 1rem;
    color: var(--tsg-sp-muted);
    font-family: var(--tsg-sp-font);
    font-size: .9rem;
}

/* Card — misma línea gráfica que las tarjetas de clases del calendario:
 * superficie blanca, radio 16, sombra suave, hover que "levanta", fade-in. */
.tsg-sp-card {
    display: flex;
    flex-direction: column;
    background: var(--tsg-sp-surface);
    border: 1px solid transparent;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(15,23,42,.05);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    animation: tsg-sp-fade-in .35s ease both;
}
@keyframes tsg-sp-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
.tsg-sp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 42px rgba(15,23,42,.12);
    border-color: rgba(0,20,137,.08);
}

/* Image */
.tsg-sp-card__img-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f1f5f9;
}
.tsg-sp-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s ease;
}
.tsg-sp-card:hover .tsg-sp-card__img-wrap img {
    transform: scale(1.04);
}

/* Galería: imágenes apiladas que rotan con desvanecimiento */
.tsg-sp-card__img-wrap--gallery { cursor: pointer; }
.tsg-sp-card__img-wrap--gallery .tsg-sp-gallery-img {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .45s ease, transform .25s ease;
}
.tsg-sp-card__img-wrap--gallery .tsg-sp-gallery-img.is-active {
    opacity: 1;
}
.tsg-sp-card__img-wrap .tsg-sp-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tsg-sp-muted);
    font-size: 2.5rem;
}

/* Body — jerarquía tipográfica calcada del calendario: dato pequeño en
 * naranja 800 uppercase (el precio, como la hora de la clase) y el nombre
 * como título display azul en Barlow itálica. Tamaños compactos. */
.tsg-sp-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 9px 12px 11px;
    gap: 2px;
}
/* Jerarquía calcada de la card de clase del calendario:
 * etiqueta pequeña naranja (categoría, como la disciplina) → título display
 * azul Barlow itálica (como el nombre de la clase) → precio protagonista. */
.tsg-sp-card__cat {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .9px;
    text-transform: uppercase;
    color: var(--tsg-sp-orange);
    order: 1;
}
.tsg-sp-card__cat--empty { color: var(--tsg-sp-muted); }
.tsg-sp-card__title {
    font-family: "Barlow Condensed", var(--tsg-sp-font);
    font-style: italic;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.3px;
    /* !important: el Kit global de Elementor trae ".elementor-kit-14 h3 {
       font-size:28px}" — como <h3> es la etiqueta real del título, esa regla
       (2 clases) le gana a esta (1 clase) si no se fuerza. */
    font-size: .68rem !important;
    line-height: 1.2;
    color: var(--tsg-sp-blue);
    margin: 1px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    order: 2;
}
/* A más columnas, letra más pequeña para que el nombre siga leyéndose */
.tsg-sp-grid--cols-5 .tsg-sp-card__title { font-size: .64rem !important; }
.tsg-sp-grid--cols-6 .tsg-sp-card__title { font-size: .6rem !important; }
.tsg-sp-grid--cols-5 .tsg-sp-price { font-size: .9rem; }
.tsg-sp-grid--cols-6 .tsg-sp-price { font-size: .84rem; }
.tsg-sp-price {
    font-family: var(--tsg-sp-font);
    font-weight: 800;
    font-size: .98rem;
    color: var(--tsg-sp-blue);
    margin: 0 0 2px;
    order: 3;
}
.tsg-sp-price--sale {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.tsg-sp-price__from {
    font-weight: 600;
    font-size: .7em;
    color: var(--tsg-sp-muted);
    text-transform: none;
}
/* Promoción: el precio rebajado protagonista (más grande, naranja) y el
 * precio real tachado en gris. */
.tsg-sp-price__now {
    color: var(--tsg-sp-orange);
    font-size: 1.12rem;
}
.tsg-sp-price__was {
    font-weight: 600;
    font-size: .74rem;
    color: var(--tsg-sp-muted);
    text-decoration: line-through;
}

/* Disponibilidad + Cachéalo */
.tsg-sp-card__flags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    order: 4;
    margin-bottom: 2px;
}
.tsg-sp-stock {
    font-family: var(--tsg-sp-font);
    font-weight: 700;
    font-size: .66rem;
    letter-spacing: .03em;
    padding: 3px 9px;
    border-radius: 999px;
    line-height: 1.35;
}
.tsg-sp-stock--ok  { background: #dcfce7; color: #15803d; }
.tsg-sp-stock--low { background: #fee2e2; color: #b91c1c; }
.tsg-sp-stock--out { background: #f1f5f9; color: #64748b; }

/* Cachéalo: solo el circulito con el logo (antes era una píldora con texto
 * que alargaba la tarjeta). El tooltip NO vive adentro del círculo — la
 * tarjeta (.tsg-sp-card) tiene overflow:hidden por las esquinas redondeadas
 * y se lo comía por un lado sin importar el z-index; ahora lo crea/posiciona
 * initCacheaTooltip() en document.body, igual que el modal y el carrito. */
.tsg-sp-cachea-badge {
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f8f32b !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}
.tsg-sp-cachea-badge:hover,
.tsg-sp-cachea-badge:focus {
    background: #f8f32b !important;
}
.tsg-sp-cachea-badge img {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: block;
}

#tsg-cachea-tip {
    position: fixed;
    z-index: 10001;
    max-width: 170px;
    background: #f8f32b;
    color: #111;
    font-family: "Montserrat", "Gotham", -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: .68rem;
    line-height: 1.35;
    padding: 8px 10px;
    border-radius: 10px;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .12s ease, transform .12s ease;
    transform: translateY(4px);
    box-shadow: 0 8px 20px rgba(0,0,0,.25);
}
#tsg-cachea-tip.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
#tsg-cachea-tip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: var(--tip-arrow-left, 50%);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #f8f32b;
}

.tsg-sp-actions { order: 5; }

/* Insignia de oferta */
.tsg-sp-card--sale { border-color: var(--tsg-sp-orange); }
.tsg-sp-badge-sale {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--tsg-sp-orange);
    color: #fff;
    font-family: var(--tsg-sp-font);
    font-weight: 800;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 4px 10px;
    border-radius: 999px;
}

/* Button — píldora compacta */
.tsg-sp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: auto;
    padding: 7px 12px;
    background: var(--tsg-sp-blue);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-family: var(--tsg-sp-font);
    font-weight: 700;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    text-decoration: none;
    cursor: pointer;
    transition: opacity .15s ease, background .15s ease;
}
.tsg-sp-btn:hover {
    opacity: .88;
    color: #fff;
    text-decoration: none;
}
@media (max-width: 640px) {
    .tsg-sp-btn { padding: 8px 10px; font-size: .72rem; }
}
/* !important en --wa/--add: la página tiene un CSS heredado de Elementor
 * (.elementor-2080 .elementor-element-302a070 .tsg-sp-btn { background-color:
 * #001489 }, resabio del viejo botón "Ver producto" sólido azul) con más
 * especificidad que estas clases — sin !important pinta el botón Agregar
 * azul sobre azul (texto invisible). */
.tsg-sp-btn--wa {
    background: #1da851 !important;
}
.tsg-sp-btn--wa svg { width: 15px; height: 15px; flex: 0 0 auto; }
.tsg-sp-btn--add {
    background: transparent !important;
    color: var(--tsg-sp-blue) !important;
    border: 1.5px solid var(--tsg-sp-blue);
}
.tsg-sp-btn--add:hover { background: var(--tsg-sp-blue) !important; color: #fff !important; opacity: 1; }
.tsg-cart-add__ok { color: inherit; }

/* Producto agotado: único botón, azul sólido de marca (no verde de
 * WhatsApp — a propósito, para no dar la falsa idea de "comprar ya"). */
.tsg-sp-btn--notify {
    background: var(--tsg-sp-blue) !important;
    color: #fff !important;
}
.tsg-sp-btn--notify:hover { opacity: .88; }
.tsg-sp-btn--notify svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* Fila de acciones: Comprar (WhatsApp) + Agregar (carrito). min-width:0 es
 * necesario porque por defecto un flex item no encoge más allá del ancho de
 * su contenido ("+ Agregar" sin envolver) — sin esto, en 5/6 columnas el
 * botón se salía de la tarjeta hacia la derecha. */
.tsg-sp-actions {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-top: auto;
}
.tsg-sp-actions .tsg-sp-btn {
    flex: 1;
    margin-top: 0;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* En 5/6 columnas la tarjeta queda angosta y los 2 botones lado a lado no
 * alcanzan a mostrar su texto (con min-width:0 el texto llegaba a
 * desaparecer del todo) — se apilan uno sobre el otro, a todo el ancho. */
@media (min-width: 641px) {
    .tsg-sp-grid--cols-5 .tsg-sp-actions,
    .tsg-sp-grid--cols-6 .tsg-sp-actions {
        flex-direction: column;
        gap: 6px;
    }
    .tsg-sp-grid--cols-5 .tsg-sp-btn,
    .tsg-sp-grid--cols-6 .tsg-sp-btn {
        width: 100%;
        padding: 7px 8px;
        font-size: .68rem;
    }
}

/* ── Carrito flotante ──
 * El FAB y el panel viven en document.body, FUERA del contenedor del widget
 * donde se definen las custom properties --tsg-sp-*  — usar var() aquí no
 * resuelve nada (queda "unset"/transparente) por eso se usan hex directos.
 * También: [hidden] por sí solo NO basta para ocultar el botón porque
 * nuestra propia regla `display:flex` (más específica que el UA stylesheet)
 * le gana — hace falta forzar display:none con !important quí. */
.tsg-cart-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9998;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #001489;
    border: none;
    box-shadow: 0 8px 24px rgba(0,20,137,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .15s ease;
}
.tsg-cart-fab[hidden] { display: none !important; }
.tsg-cart-fab:hover { background: #001489; transform: translateY(-2px) scale(1.04); }
.tsg-cart-fab__icon { color: #fff; }
.tsg-cart-fab__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e66415;
    color: #001489;
    font-family: "Montserrat", "Gotham", -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 800;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #fff;
}

.tsg-cart-drawer { position: fixed; inset: 0; z-index: 9999; }
.tsg-cart-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,.45);
    opacity: 0;
    transition: opacity .2s ease;
}
.tsg-cart-drawer__panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(380px, 100vw);
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: -12px 0 32px rgba(15,23,42,.18);
    transform: translateX(100%);
    transition: transform .22s ease;
}
.tsg-cart-drawer.is-open .tsg-cart-drawer__backdrop { opacity: 1; }
.tsg-cart-drawer.is-open .tsg-cart-drawer__panel { transform: translateX(0); }
.tsg-cart-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #e5e7eb;
    font-family: "Montserrat", "Gotham", -apple-system, BlinkMacSystemFont, sans-serif;
    color: #001489;
    font-size: 1.05rem;
}
.tsg-cart-drawer__close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
}
.tsg-cart-drawer__items { flex: 1; overflow-y: auto; padding: 8px 20px; }
.tsg-cart-drawer__empty {
    color: #64748b;
    font-family: "Montserrat", "Gotham", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: .88rem;
    text-align: center;
    margin-top: 30px;
}
.tsg-cart-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid #e5e7eb; }
.tsg-cart-item__img {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    background: #f1f5f9;
    display: block;
}
.tsg-cart-item__img--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.tsg-cart-item__info { flex: 1; min-width: 0; }
.tsg-cart-item__title {
    font-family: "Montserrat", "Gotham", -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: .92rem;
    line-height: 1.3;
    color: #141414;
    margin-bottom: 8px;
}
.tsg-cart-item__row { display: flex; align-items: center; gap: 10px; }
.tsg-cart-item__qty {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "Montserrat", "Gotham", -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: .85rem;
}
.tsg-cart-item__step {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #001489;
    cursor: pointer;
    line-height: 1;
    font-weight: 800;
}
.tsg-cart-item__step:hover { border-color: #001489; }
.tsg-cart-item__sub {
    margin-left: auto;
    font-family: "Montserrat", "Gotham", -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 800;
    font-size: .85rem;
    color: #001489;
}
.tsg-cart-item__remove {
    background: none;
    border: none;
    color: #64748b;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
}
.tsg-cart-item__remove:hover { color: #e66415; }
.tsg-cart-drawer__foot {
    padding: 16px 20px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tsg-cart-drawer__total {
    font-family: "Montserrat", "Gotham", -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 800;
    font-size: 1rem;
    color: #141414;
}
.tsg-cart-drawer__wa { width: 100%; padding: 12px; font-size: .8rem; }
.tsg-cart-drawer__clear {
    background: none;
    border: none;
    color: #64748b;
    font-family: "Montserrat", "Gotham", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: .78rem;
    text-decoration: underline;
    cursor: pointer;
    align-self: center;
}
.tsg-cart-item__variant {
    display: block;
    font-weight: 600;
    font-size: .76rem;
    color: #64748b;
    margin-top: 1px;
}

/* ── Chips de variante (talla/color) — se usan dentro del modal ── */
.tsg-sp-variant-group { margin-bottom: 12px; }
.tsg-sp-variant-group:last-child { margin-bottom: 0; }
.tsg-sp-variant-group__label {
    display: block;
    font-family: "Montserrat", "Gotham", -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 800;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #001489;
    margin-bottom: 6px;
}
.tsg-sp-variant-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tsg-sp-variant-chip {
    min-width: 40px;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #141414;
    font-family: "Montserrat", "Gotham", -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: .8rem;
    cursor: pointer;
    transition: all .12s ease;
}
.tsg-sp-variant-chip:hover { border-color: #001489; }
.tsg-sp-variant-chip.is-selected {
    background: #001489;
    border-color: #001489;
    color: #fff;
}
.tsg-sp-variant-chip.is-oos {
    color: #b8bcc4;
    background: #f8f9fb;
    text-decoration: line-through;
    cursor: not-allowed;
}
.tsg-sp-variant-chip.is-oos:hover { border-color: #e5e7eb; }
.tsg-sp-variant-chip:disabled { pointer-events: none; }

/* ── Modal de selección de talla/color ── */
.tsg-variant-modal { position: fixed; inset: 0; z-index: 10000; }
.tsg-variant-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,.55);
    opacity: 0;
    transition: opacity .2s ease;
}
.tsg-variant-modal__panel {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(420px, 92vw);
    max-height: 86vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    transform: translate(-50%, -46%);
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
.tsg-variant-modal.is-open .tsg-variant-modal__backdrop { opacity: 1; }
.tsg-variant-modal.is-open .tsg-variant-modal__panel { opacity: 1; transform: translate(-50%, -50%); }
.tsg-variant-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
}
.tsg-variant-modal__title {
    font-family: "Barlow Condensed", Arial, sans-serif;
    font-style: italic;
    font-weight: 900;
    text-transform: uppercase;
    color: #001489;
    font-size: 1.05rem;
    line-height: 1.15;
}
.tsg-variant-modal__close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    flex: 0 0 auto;
}
.tsg-variant-modal__body { padding: 16px 18px; }
.tsg-variant-modal__preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.tsg-variant-modal__img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    background: #f1f5f9;
    flex: 0 0 auto;
}
.tsg-variant-modal__price {
    font-family: "Montserrat", "Gotham", -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: #001489;
    margin: 0 0 4px;
}
.tsg-variant-modal__hint { font-size: .76rem; color: #64748b; }
.tsg-variant-modal__foot { padding: 14px 18px 18px; border-top: 1px solid #e5e7eb; }
.tsg-variant-modal__confirm { width: 100%; padding: 12px; font-size: .82rem; }
.tsg-variant-modal__confirm:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 480px) {
    .tsg-variant-modal__panel { width: 100vw; max-height: 100vh; height: 100%; border-radius: 0; top: 0; left: 0; transform: none; }
    .tsg-variant-modal.is-open .tsg-variant-modal__panel { transform: none; }
}
@media (max-width: 480px) {
    .tsg-cart-drawer__panel { width: 100vw; }
    .tsg-cart-fab { right: 14px; bottom: 14px; width: 50px; height: 50px; }
}
