/* weproducttabs — full visual rewrite (Phase 8) to match the Claude Design mockup.
   No external carousel library: the "carousel" is a CSS scroll-snap grid driven by native
   horizontal scroll + a few buttons (views/js/weproducttabs.js). Everything here is scoped
   under .we-product-tabs-set so it can't leak onto / collide with the real category listing
   (#product_list, .flexslider_carousel chrome, etc.) or any other module's markup.

   Palette (exact values from the design spec, do not approximate):
   brand blue rgb(28,146,219) · near-black #1d1e20 · body grey #3f4247 / #6b7280 ·
   muted grey (old price) #9ca3af · border grey #e4eaf1 · inactive-pill grey #f5f5f5 ·
   teal (discount) #009499 · green (in stock) #1d9649 · placeholder bg #e9f2fb.

   Font: the mockup references Archivo/Roboto, neither is loaded anywhere in this theme
   (confirmed via grep; theme default is 'Helvetica Neue', Helvetica, Arial, sans-serif) —
   intentionally not loading a new webfont here, out of scope for a module. Only the
   weight/size/color values from the spec are preserved. */

.we-product-tabs-set {
    margin: 30px 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.we-product-tabs-set .wpt-title {
    margin: 0 0 15px;
    font-size: 22px;
    font-weight: 600;
    color: #1d1e20;
}

/* ---- Tabs row: scrollable pills (left) + shared carousel prev/next arrows (right) ---- */
.we-product-tabs-set .wpt-tabs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.we-product-tabs-set .wpt-tabs-scroll {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.we-product-tabs-set .wpt-tabs-scroll::-webkit-scrollbar { display: none; }
.we-product-tabs-set .wpt-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 2px 0;
    list-style: none;
    white-space: nowrap;
}
.we-product-tabs-set .wpt-tab-item { display: inline-block; margin: 0; }
.we-product-tabs-set .wpt-tab-btn {
    height: 38px;
    padding: 0 18px;
    border-radius: 9999px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    background: #f5f5f5;
    color: #3f4247;
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.we-product-tabs-set .wpt-tab-btn:hover { background: #ececec; }
.we-product-tabs-set .wpt-tab-btn.active {
    background: rgb(28, 146, 219);
    color: #fff;
}
.we-product-tabs-set .wpt-tab-btn.active:hover { background: rgb(28, 146, 219); }

.we-product-tabs-set .wpt-tabs-arrows {
    flex: 0 0 auto;
    display: none; /* desktop-only (>=1100px), see media query below */
    align-items: center;
    gap: 10px;
}
.we-product-tabs-set .wpt-arrow {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    border: 1px solid #e4eaf1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(28, 146, 219);
    cursor: pointer;
    padding: 0;
    transition: background .15s, color .15s;
}
.we-product-tabs-set .wpt-arrow:hover { background: #f5fafe; }
.we-product-tabs-set .wpt-arrow.is-disabled {
    color: #c4c9d0;
    cursor: default;
    background: #fff;
}
.we-product-tabs-set .wpt-arrow svg { display: block; }

@media (min-width: 1100px) {
    .we-product-tabs-set .wpt-tabs-arrows { display: flex; }
}

/* ---- Tab panes ---- */
.we-product-tabs-set .wpt-tab-content { position: relative; }
.we-product-tabs-set .wpt-tab-pane { display: none; }
.we-product-tabs-set .wpt-tab-pane.active { display: block; }

/* ---- Carousel: CSS scroll-snap grid, item width driven by the admin-configured
   WEPRODUCTTABS_ITEMS_DESKTOP/TABLET/MOBILE values (set inline per-instance as custom
   properties by set.tpl) so that setting stays meaningful instead of a hardcoded 3/4 split.
   --wpt-peek (a 0-1 fraction, from WEPRODUCTTABS_PEEK_PERCENT/100) optionally shrinks every
   column just enough that a sliver of the *next* card peeks in at the edge, hinting the
   carousel is scrollable. Derived so --wpt-peek:0 reduces to exactly the previous formula
   (N items, N-1 real gaps, no peek) — existing installs with the field left at 0 are
   pixel-identical to before this was added. */
.we-product-tabs-set .wpt-carousel {
    --wpt-items: var(--wpt-items-mobile, 2);
    --wpt-peek: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--wpt-items) - 1 + var(--wpt-peek)) * 20px) / (var(--wpt-items) + var(--wpt-peek)));
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding: 4px 0 8px;
    margin: 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.we-product-tabs-set .wpt-carousel::-webkit-scrollbar { display: none; }

@media (min-width: 768px) {
    .we-product-tabs-set .wpt-carousel { --wpt-items: var(--wpt-items-tablet, 3); }
}
@media (min-width: 1100px) {
    .we-product-tabs-set .wpt-carousel { --wpt-items: var(--wpt-items-desktop, 4); }
}

/* ---- Page-dots indicator (JS only renders these when there's >1 page) ---- */
.we-product-tabs-set .wpt-carousel-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
}
.we-product-tabs-set .wpt-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    border: none;
    padding: 0;
    background: #d6dde6;
    cursor: pointer;
    transition: width .2s, background .2s;
}
.we-product-tabs-set .wpt-dot.active {
    width: 22px;
    background: rgb(28, 146, 219);
}

/* ---- Card ---- */
.we-product-tabs-set .wpt-card {
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e4eaf1;
    overflow: hidden;
    transition: transform .15s, box-shadow .15s;
    text-decoration: none;
}
.we-product-tabs-set .wpt-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px -16px rgba(30, 157, 224, .32);
}

.we-product-tabs-set .wpt-card-top {
    padding: 12px 16px 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.we-product-tabs-set .wpt-card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.25;
    color: #1d1e20;
    text-decoration: none;
}
.we-product-tabs-set .wpt-card-title:hover,
.we-product-tabs-set .wpt-card-title:focus {
    color: #1d1e20;
    text-decoration: underline;
}
.we-product-tabs-set .wpt-card-brand {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #6b7280;
}
.we-product-tabs-set .wpt-card-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #3f4247;
}
.we-product-tabs-set .wpt-card-stock-dot {
    width: 7px;
    height: 7px;
    border-radius: 9999px;
    background: #1d9649;
    flex: 0 0 auto;
}
.we-product-tabs-set .wpt-card-stock-dot--pending,
.we-product-tabs-set .wpt-card-stock-dot--out { background: #9ca3af; }

.we-product-tabs-set .wpt-card-discount-row {
    height: 28px;
    display: flex;
    align-items: center;
}
.we-product-tabs-set .wpt-card-discount {
    font-weight: 600;
    font-size: 22px;
    color: #009499;
}

.we-product-tabs-set .wpt-card-image {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    background: #fff;
}
.we-product-tabs-set .wpt-card-image img {
    max-width: 78%;
    max-height: 78%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.we-product-tabs-set .wpt-card-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #e9f2fb;
    color: rgb(28, 146, 219);
}

.we-product-tabs-set .wpt-card-bottom {
    margin-top: auto;
    padding: 14px 16px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
}
.we-product-tabs-set .wpt-card-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.we-product-tabs-set .wpt-card-price-old {
    font-size: 13px;
    line-height: 1.2;
    color: #9ca3af;
    text-decoration: line-through;
}
.we-product-tabs-set .wpt-card-price-final {
    font-weight: 500;
    font-size: 22px;
    /* The theme inherits a site-wide `line-height: 14px` from way up the DOM (a global reset) —
       since it's an absolute px value it inherits literally, not recalculated per font-size, so
       this 22px price text was squeezed into a 14px line box. That made the price's visual
       baseline sit noticeably off from the flex-end-aligned CTA button next to it (image-656),
       even though their boxes were correctly bottom-aligned. Explicit line-height fixes it. */
    line-height: 1.2;
    color: #1d1e20;
}

/* CTA pill — restyles the real .btn-warning/.btn-default/.btn-info buttons/links copied
   verbatim (same classes, same conditions) from product-price-cta.tpl's button block, without
   touching their functional classes (ajax_add_to_cart_button, rel="ajax_id_product_..."). */
.we-product-tabs-set .wpt-card-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 20px;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: none;
    margin: 0;
}
/* "Comprar" — solid amber, same color this site's .btn.btn-warning already resolves to
   (themes/dentalcost/css/bootstrap.css:3231-3233), just pill-shaped here. */
.we-product-tabs-set .wpt-card-cta.btn-warning {
    background: #ffb400;
    border: 1px solid #ffb400;
    color: #fff;
}
.we-product-tabs-set .wpt-card-cta.btn-warning:hover,
.we-product-tabs-set .wpt-card-cta.btn-warning:focus {
    background: #ffc740;
    border-color: #ffc740;
    color: #fff;
}
/* "Consultar" / "Ver más" — outline, brand blue on white. */
.we-product-tabs-set .wpt-card-cta.btn-default,
.we-product-tabs-set .wpt-card-cta.btn-info {
    background: #fff;
    border: 1px solid rgb(28, 146, 219);
    color: rgb(28, 146, 219);
}
.we-product-tabs-set .wpt-card-cta.btn-default:hover,
.we-product-tabs-set .wpt-card-cta.btn-default:focus,
.we-product-tabs-set .wpt-card-cta.btn-info:hover,
.we-product-tabs-set .wpt-card-cta.btn-info:focus {
    background: rgb(28, 146, 219);
    color: #fff;
}
