/* ===== PRODUCT DETAIL PAGE ===== */
.product-page { padding: 16px 0 32px; }

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    flex-wrap: wrap;
    min-width: 0;
}
.breadcrumb a { color: var(--text-secondary); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .separator { color: var(--text-muted); }
.breadcrumb .current { color: var(--text); font-weight: 500; }

@media (max-width: 767px) {
    .breadcrumb {
        gap: 6px;
        font-size: 13px;
        flex-wrap: nowrap;
        overflow: hidden;
    }

    .breadcrumb .current {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Layout - mobile first single column */
.product-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* ===== GALLERY ===== */
.product-gallery-col {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow);
}

.tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 12px;
    margin-bottom: 16px;
    position: relative;
}

.tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    transition: all 0.2s;
}

.tab.active {
    background: var(--primary-bg);
    color: var(--primary);
    border: 1px solid var(--primary-light);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.tab:not(.active):hover { color: var(--text); background: var(--bg); }
.tab { transition: all 0.25s var(--ease-out); }

.oferta-tag {
    margin-left: auto;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
}

.mobile-product-summary {
    display: none;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.gallery {
    position: relative;
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(16, 185, 129, 0.06), transparent 70%),
        linear-gradient(135deg, #f9fafb, #f3f4f6);
    border-radius: var(--radius);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.gallery-counter {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(17, 24, 39, 0.8);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    z-index: 3;
}

.gallery-main {
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    overflow: hidden;
}

.gallery-main.drag-ready {
    cursor: grabbing;
}

.gallery-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.gallery-main.dragging .gallery-track {
    transition: none;
}

.gallery-main.sequencing .gallery-track {
    transition-duration: 0.24s;
}

.gallery-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
    transition: filter 0.22s var(--ease-out), transform 0.22s var(--ease-out);
    will-change: filter, transform;
}

.gallery-main.dragging img {
    filter: drop-shadow(0 18px 28px rgba(15, 23, 42, 0.12));
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    color: var(--text);
    z-index: 3;
    transition: all 0.2s;
}

.gallery-arrow:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-lg);
}
.gallery-arrow { transition: all 0.25s var(--ease-out); }

.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }

.gallery-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 3;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: width 0.25s var(--ease-out), background 0.25s var(--ease-out), transform 0.25s var(--ease-out);
    cursor: pointer;
}
.dot.active {
    background: var(--primary);
    width: 22px;
    border-radius: 4px;
    transform: scaleY(1.15);
}

/* ===== Prominent thumbnails — single row with horizontal scroll & drag ===== */
.thumbnails-large {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 14px;
    padding: 10px;
    background: linear-gradient(180deg, var(--bg), #ffffff);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow-x: auto;
    overflow-y: hidden;
    cursor: grab;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
}

.thumbnails-large.dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.thumbnails-large::-webkit-scrollbar { height: 6px; }
.thumbnails-large::-webkit-scrollbar-track { margin: 0 8px; }

.thumbnails-large .thumb-card {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    aspect-ratio: 1;
    scroll-snap-align: start;
}

.thumbnails-large.has-overflow {
    /* Subtle mask hint that there's more content to the right */
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
}

.thumb-card {
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    position: relative;
    box-shadow: var(--shadow-xs);
}

.thumb-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.thumb-card.active {
    border-color: var(--primary);
    box-shadow: 0 6px 14px -3px rgba(16, 185, 129, 0.35), 0 0 0 3px rgba(16, 185, 129, 0.08);
    background: linear-gradient(180deg, #ffffff, var(--primary-bg));
}

.thumb-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
    transition: transform 0.3s var(--ease-out);
}

.thumb-card:hover img { transform: scale(1.05); }

.thumb-badge {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--white);
    font-size: 8px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px -1px rgba(16, 185, 129, 0.4);
}

/* ===== Offers header ===== */
.offers-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.offers-header .card-title { margin-bottom: 0; }

/* ===== DESCRIPTION TAB ===== */
.description-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}
.description-content h4 {
    color: var(--text);
    font-size: 15px;
    margin: 16px 0 8px;
}
.description-content ul { margin: 8px 0 8px 20px; }
.description-content li { list-style: disc; margin-bottom: 4px; }

/* ===== PRODUCT INFO ===== */
.product-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 10px;
}

.rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.stars {
    display: flex;
    gap: 2px;
    color: var(--star);
}

.rating-text {
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
}

.link-reviews {
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: underline;
}

/* Price card */
.price-card {
    background:
        radial-gradient(ellipse 80% 60% at 100% 0%, rgba(16, 185, 129, 0.10), transparent 70%),
        linear-gradient(135deg, var(--white) 30%, var(--primary-bg) 100%);
    border: 1px solid var(--primary-light);
    container-type: inline-size;
}

.price-row {
    display: grid;
    grid-template-columns: max-content minmax(220px, 1fr) max-content;
    align-items: center;
    column-gap: 18px;
    row-gap: 10px;
    margin-bottom: 16px;
}

.price-main {
    display: flex;
    align-items: baseline;
    gap: 4px;
    min-width: max-content;
}

.currency {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.price-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.price-cents {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.price-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(108px, max-content));
    align-items: center;
    column-gap: 14px;
    row-gap: 4px;
    min-width: 0;
}

.deal-source {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: start;
    column-gap: 6px;
    row-gap: 2px;
    min-width: 104px;
}

.deal-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.discount-badge {
    background: var(--primary-light);
    color: var(--green-text);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    display: inline-block;
    width: fit-content;
}

.price-old,
.history-reference {
    grid-column: 1 / -1;
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.price-old {
    text-decoration: line-through;
}

.history-badge {
    background: #dbeafe;
    color: var(--blue);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    display: inline-block;
    width: fit-content;
}

.savings {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    background: var(--green-tag);
    color: var(--green-text);
    padding: 8px 14px;
    border-radius: 24px;
}

.savings-label {
    font-size: 11px;
    font-weight: 600;
}

.savings-amount {
    font-size: 14px;
    font-weight: 700;
}

.price-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

.stat-item {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--white);
    padding: 8px;
    border-radius: 10px;
}

.stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon-blue { background: #dbeafe; color: var(--blue); }
.stat-icon-green { background: var(--primary-light); color: var(--primary); }
.stat-icon-pink { background: #fce7f3; color: var(--pink); }

.stat-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chart card */
.chart-card {
    border: 1px solid var(--primary-light);
    background:
        radial-gradient(ellipse 70% 80% at 0% 0%, rgba(20, 184, 166, 0.08), transparent 68%),
        linear-gradient(180deg, #ffffff 0%, #fbfefc 100%);
}

/* Pulse ring on the last chart dot */
@keyframes chartPulse {
    0%   { r: 8px;  opacity: 0.7; }
    100% { r: 20px; opacity: 0;   }
}
#chartPulseRing {
    transform-box: fill-box;
    transform-origin: center;
    animation: chartPulse 2.2s ease-out infinite;
    pointer-events: none;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.chart-header .card-title { margin-bottom: 0; }

.range-tabs {
    display: flex;
    background: #f1f5f9;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 3px;
    gap: 3px;
}

.range-tab {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.range-tab.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 6px 14px -8px rgba(16, 185, 129, 0.9);
}

.chart-wrapper {
    position: relative;
    height: 200px;
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
    cursor: crosshair;
}

.chart {
    width: 100%;
    height: 100%;
    touch-action: manipulation;
}

.chart-price-line {
    transition: stroke-width 0.2s ease;
}

.chart-hit-zone {
    cursor: crosshair;
    pointer-events: all;
}

#chartHoverLine,
#chartActiveDot,
#chartActiveDotCore {
    transition: opacity 0.15s ease, cx 0.12s ease, cy 0.12s ease;
}

.chart-grid line { stroke: var(--border-light); stroke-width: 1; }
.chart-axis text { font-size: 10px; fill: var(--text-muted); }
.chart-area { fill: url(#chartGradient); opacity: 0.4; }
.chart-line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.chart-point {
    fill: var(--white);
    stroke: var(--primary);
    stroke-width: 2;
    cursor: pointer;
    transition: r 0.2s;
}
.chart-point:hover { r: 6; }

.chart-tooltip {
    position: absolute;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--primary-light);
    border-radius: 10px;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    box-shadow: 0 12px 24px -18px rgba(15, 23, 42, 0.32);
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%);
    transition: opacity 0.2s, transform 0.2s;
    white-space: nowrap;
    z-index: 5;
    backdrop-filter: blur(10px);
}

.chart-tooltip.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
}
.chart-tooltip .date {
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    display: block;
}

.chart-tooltip-price {
    display: block;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    margin-top: 2px;
}

.chart-tooltip-status {
    display: block;
    color: var(--green-text);
    font-size: 9px;
    font-weight: 700;
    margin-top: 1px;
}

/* Offers grid */
.offers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.offer-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    transition: all 0.3s var(--ease-out);
    position: relative;
}

.offer-card.best {
    border-color: var(--primary);
    background: linear-gradient(135deg, #ffffff, #ecfdf5);
    box-shadow: 0 4px 12px -4px rgba(16, 185, 129, 0.2);
}

.offer-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.offer-badge {
    background: var(--primary);
    color: var(--white);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 8px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.offer-card.best .offer-badge { background: var(--primary); }
.offer-card:not(.best) .offer-badge { background: var(--border); color: var(--text-secondary); }

.offer-seller {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.offer-price {
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 10px;
}

.offer-btn {
    width: 100%;
    background: var(--primary);
    color: var(--white);
    padding: 8px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.25s var(--ease-out);
    box-shadow: 0 2px 6px -1px rgba(16, 185, 129, 0.3);
}

.offer-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -3px rgba(16, 185, 129, 0.5);
}
.offer-btn:active { transform: translateY(0); }

@media (max-width: 767px) {
    .product-layout {
        grid-template-columns: minmax(0, 1.45fr) minmax(104px, 0.9fr);
        gap: 7px;
        align-items: stretch;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .product-gallery-col {
        grid-column: 1;
        grid-row: 1;
        display: flex;
        flex-direction: column;
        height: clamp(430px, 62vh, 500px);
        padding: 8px;
        min-width: 0;
        border: 1px solid var(--border-light);
        box-shadow: 0 10px 24px -22px rgba(15, 23, 42, 0.35);
    }

    .product-gallery-col .tabs {
        gap: 5px;
        padding-bottom: 7px;
        margin-bottom: 8px;
        border-bottom-color: var(--border-light);
    }

    .product-gallery-col .tab {
        padding: 5px 7px;
        font-size: 10px;
        border-radius: 14px;
        white-space: nowrap;
    }

    .product-gallery-col .oferta-tag {
        display: none;
    }

    .mobile-product-summary {
        display: block;
        padding: 0 2px 7px;
        margin: -1px 0 7px;
        border-bottom: 1px solid var(--border-light);
        min-width: 0;
        flex-shrink: 0;
    }

    .mobile-product-title {
        color: var(--text);
        font-size: clamp(12px, 3.25vw, 16px);
        font-weight: 800;
        line-height: 1.12;
        letter-spacing: 0;
        margin: 0 0 5px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .mobile-rating-row {
        display: flex;
        align-items: center;
        gap: 4px;
        min-width: 0;
        white-space: nowrap;
    }

    .mobile-stars {
        display: flex;
        gap: 1px;
        color: var(--star);
        flex-shrink: 0;
    }

    .mobile-stars svg {
        width: clamp(9px, 2.45vw, 12px);
        height: clamp(9px, 2.45vw, 12px);
    }

    .mobile-rating-text {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        color: var(--text);
        font-size: clamp(9px, 2.45vw, 11px);
        font-weight: 800;
    }

    .mobile-link-reviews {
        color: var(--text-secondary);
        font-size: clamp(8px, 2.25vw, 10px);
        text-decoration: underline;
        flex-shrink: 0;
    }

    .mobile-price-strip {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        margin-top: 6px;
        padding: 5px 7px;
        border: 1px solid rgba(209, 250, 229, 0.95);
        border-radius: 12px;
        background:
            radial-gradient(ellipse 90% 90% at 100% 0%, rgba(16, 185, 129, 0.12), transparent 70%),
            rgba(255, 255, 255, 0.78);
        min-width: 0;
    }

    .mobile-price-main {
        display: flex;
        align-items: baseline;
        gap: 2px;
        min-width: 0;
        white-space: nowrap;
    }

    .mobile-currency {
        font-size: clamp(8px, 2.1vw, 10px);
        font-weight: 800;
        color: var(--text);
    }

    .mobile-price-value {
        font-size: clamp(18px, 5.1vw, 24px);
        font-weight: 900;
        line-height: 1;
        color: var(--text);
    }

    .mobile-price-cents {
        font-size: clamp(8px, 2.25vw, 11px);
        font-weight: 800;
        color: var(--text);
    }

    .mobile-price-badges {
        display: flex;
        align-items: center;
        gap: 3px;
        flex-shrink: 0;
    }

    .mobile-discount-badge,
    .mobile-history-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 2px 6px;
        border-radius: 999px;
        font-size: clamp(8px, 2.15vw, 10px);
        font-weight: 800;
        line-height: 1.2;
    }

    .mobile-discount-badge {
        background: var(--primary-light);
        color: var(--green-text);
    }

    .mobile-history-badge {
        background: #dbeafe;
        color: var(--blue);
    }

    #tab-producto.tab-content.active {
        display: flex;
        flex: 1 1 auto;
        min-height: 0;
        flex-direction: column;
    }

    #tab-descripcion.tab-content.active {
        display: flex;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    #tab-descripcion .description-content {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 10px 10px 12px;
        border: 1px solid var(--border-light);
        border-radius: 12px;
        background: linear-gradient(180deg, #ffffff 0%, #fbfefc 100%);
        font-size: clamp(11px, 3vw, 13px);
        line-height: 1.55;
    }

    #tab-descripcion .description-content h4 {
        font-size: clamp(12px, 3.2vw, 14px);
        margin: 10px 0 6px;
    }

    #tab-descripcion .description-content h4:first-child {
        margin-top: 0;
    }

    #tab-descripcion .description-content ul {
        margin-left: 16px;
    }

    .gallery {
        flex: 1 1 auto;
        min-height: clamp(165px, 30vh, 260px);
        aspect-ratio: auto;
        margin-bottom: 8px;
        border-radius: 12px;
    }

    .gallery-slide {
        padding: 14px;
    }

    .gallery-counter {
        top: 10px;
        left: 10px;
        padding: 3px 10px;
        font-size: 11px;
    }

    .gallery-arrow {
        width: 32px;
        height: 32px;
    }

    .gallery-dots {
        bottom: 9px;
        gap: 5px;
    }

    .dot {
        width: 7px;
        height: 7px;
    }

    .dot.active {
        width: 20px;
    }

    .thumbnails-large {
        margin-top: 8px;
        padding: 6px;
        gap: 6px;
        border-radius: 12px;
        flex-shrink: 0;
    }

    .thumbnails-large .thumb-card {
        width: 52px;
        height: 52px;
        border-radius: 9px;
    }

    .thumb-card img {
        padding: 4px;
    }

    .thumb-badge {
        display: none;
    }

    .product-info-col {
        display: contents;
    }

    .product-info-col > .product-title,
    .product-info-col > .rating-row {
        display: none;
    }

    .price-card,
    .chart-card {
        grid-column: 1 / -1;
    }

    .offers-card {
        grid-column: 2;
        grid-row: 1;
        align-self: stretch;
        display: flex;
        flex-direction: column;
        height: clamp(430px, 62vh, 500px);
        padding: 8px;
        margin-bottom: 0;
        min-width: 0;
        max-width: 100%;
        border: 1px solid var(--border-light);
        border-radius: var(--radius-lg);
        box-shadow: 0 10px 24px -22px rgba(15, 23, 42, 0.35);
    }

    .offers-header {
        margin-bottom: 8px;
        justify-content: flex-start;
        gap: 6px;
        border-bottom: 1px solid var(--border-light);
        padding-bottom: 7px;
    }

    .offers-header::after {
        content: attr(data-count);
        width: 18px;
        height: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        background: var(--primary-light);
        color: var(--green-text);
        font-size: 10px;
        font-weight: 800;
        flex-shrink: 0;
    }

    .offers-card .card-title {
        font-size: 0;
        line-height: 1.15;
        gap: 4px;
        color: var(--text);
        min-width: 0;
    }

    .offers-card .card-title::after {
        content: "Ofertas";
        font-size: 11px;
        font-weight: 800;
        letter-spacing: -0.1px;
    }

    .offers-card .card-title svg {
        width: 12px;
        height: 12px;
        flex-shrink: 0;
    }

    .offers-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        flex: 1;
        align-content: start;
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: 2px;
    }

    .offer-card {
        padding: 8px;
        border-width: 1.5px;
        border-radius: 11px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        min-height: 0;
    }

    .offer-card:hover {
        transform: none;
    }

    .offer-badge {
        font-size: 8px;
        padding: 2px 6px;
        margin-bottom: 5px;
        border-radius: 999px;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        align-self: center;
    }

    .offer-seller {
        font-size: 9.5px;
        line-height: 1.15;
        margin-bottom: 2px;
        color: var(--text);
        font-weight: 800;
        text-transform: uppercase;
        overflow-wrap: anywhere;
        width: 100%;
    }

    .offer-price {
        font-size: 14px;
        margin-bottom: 6px;
        width: 100%;
    }

    .offer-btn {
        width: min(100%, 96px);
        padding: 6px;
        font-size: 10px;
        border-radius: 7px;
    }

    .related-col {
        grid-column: 1 / -1;
    }

    /* ===== MOBILE PRICE CARD — strict 2-row layout, no duplicates ===== */

    /* Hide the redundant top strip (price already shown in the card) */
    .mobile-price-strip { display: none !important; }

    .price-card {
        padding: 9px 10px;
        container-type: inline-size;
    }
    .price-card .card-title {
        font-size: 9.5px;
        margin-bottom: 6px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-muted);
        font-weight: 700;
    }

    /* ROW 1: precio | plataforma | histórico */
    .price-row {
        grid-template-columns: max-content minmax(0, 1fr);
        column-gap: 10px;
        margin-bottom: 7px;
        align-items: center;
    }
    .price-main  { min-width: 0; }
    .currency    { font-size: 10px; }
    .price-value { font-size: clamp(20px, 5.8vw, 26px); }
    .price-cents { font-size: 10px; }

    .price-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 6px;
        row-gap: 0;
    }
    .deal-source {
        grid-template-columns: max-content auto;
        column-gap: 4px;
        row-gap: 0;
        align-items: center;
        min-width: 0;
    }
    .deal-label {
        font-size: 7.5px;
        white-space: nowrap;
        letter-spacing: 0.3px;
    }
    .discount-badge,
    .history-badge {
        font-size: 9px;
        padding: 1px 6px;
        border-radius: 8px;
    }

    /* Hide old price and reference — not part of the 2-row spec */
    .price-old,
    .history-reference,
    .savings { display: none; }

    /* ROW 2: actualización | promedio | mínimo */
    .price-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
        padding-top: 7px;
        margin-top: 0;
    }
    .stat-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1px;
        padding: 4px 2px;
        min-width: 0;
        border-radius: 6px;
    }
    .stat-item > div:last-child { min-width: 0; max-width: 100%; }
    .stat-icon  { width: 16px; height: 16px; flex-shrink: 0; border-radius: 5px; }
    .stat-icon svg { width: 9px; height: 9px; }
    .stat-label {
        font-size: 6.5px;
        white-space: nowrap;
        letter-spacing: 0.2px;
        line-height: 1.1;
    }
    .stat-value {
        font-size: 8.5px;
        white-space: nowrap;
        line-height: 1.15;
        font-weight: 700;
    }
}

@media (max-width: 380px) {
    .product-page {
        padding-top: 12px;
    }

    .product-layout {
        grid-template-columns: minmax(0, 1.35fr) minmax(96px, 0.82fr);
        gap: 6px;
    }

    .product-gallery-col {
        padding: 7px;
    }

    .product-gallery-col .tabs {
        gap: 4px;
    }

    .product-gallery-col .tab {
        padding: 5px 6px;
        font-size: 9.5px;
    }

    .gallery-slide {
        padding: 12px;
    }

    .gallery-arrow {
        width: 30px;
        height: 30px;
    }

    .thumbnails-large .thumb-card {
        width: 48px;
        height: 48px;
    }

    .offers-card {
        padding: 7px;
    }

    .offers-card .card-title::after {
        font-size: 10px;
    }

    .offers-header::after {
        width: 17px;
        height: 17px;
        font-size: 9px;
    }

    .offer-card {
        padding: 7px 6px;
    }

    .offer-badge {
        font-size: 7.5px;
        padding: 2px 5px;
    }

    .offer-seller {
        font-size: 8.5px;
    }

    .offer-price {
        font-size: 13px;
    }

    .offer-btn {
        width: min(100%, 88px);
        font-size: 9.5px;
    }
}

@media (max-width: 330px) {
    .product-layout {
        grid-template-columns: minmax(0, 1.3fr) minmax(88px, 0.78fr);
        gap: 5px;
    }

    .product-gallery-col,
    .offers-card {
        border-radius: 12px;
    }

    .product-gallery-col .tab svg {
        display: none;
    }

    .gallery-counter {
        font-size: 10px;
        padding: 2px 8px;
    }

    .thumbnails-large {
        gap: 5px;
        padding: 5px;
    }

    .thumbnails-large .thumb-card {
        width: 44px;
        height: 44px;
    }

    .offers-card .card-title svg {
        display: none;
    }
}

/* Related products — now use the rich card design from the homepage */
.related-card {
    position: relative;
}

.related-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Cards inside the related column must NOT shrink — they keep full natural height */
.related-list .product-card {
    border-radius: var(--radius-lg);
    flex-shrink: 0;
    flex-grow: 0;
}

.link-more {
    display: block;
    text-align: center;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    padding: 14px 0 4px;
    border-top: 1px solid var(--border-light);
    margin-top: 14px;
}

/* ===== RESPONSIVE TABLET ===== */
@media (min-width: 768px) {
    .product-page { padding: 24px 0 40px; }

    .offers-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .product-title { font-size: 26px; }

    .thumbnails-large .thumb-card { width: 80px; height: 80px; }
}

/* ===== RESPONSIVE DESKTOP - FIT IN VIEWPORT ===== */
@media (min-width: 1024px) {
    /* On desktop product page, body becomes viewport-locked */
    body:has(.product-page) {
        overflow: hidden;
        height: 100vh;
    }

    /* Hide footer on product detail desktop view (small copyright only) */
    body:has(.product-page) .footer { display: none; }

    /* Main fills remaining viewport */
    .product-page {
        padding: 10px 0;
        height: calc(100vh - 72px); /* header height */
        display: flex;
        flex-direction: column;
    }

    .product-page > .container {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding-left: clamp(20px, 3.5vw, 80px);
        padding-right: clamp(20px, 3.5vw, 80px);
    }

    .breadcrumb {
        margin-bottom: 8px;
        font-size: 12px;
        flex-shrink: 0;
    }

    /* 3-column layout filling the remaining viewport */
    .product-layout {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
        align-items: stretch;
        flex: 1;
        min-height: 0;
    }

    /* All columns fill the grid row and clip at their boundary */
    .product-gallery-col,
    .product-info-col,
    .related-col {
        height: 100%;
        overflow: hidden;
    }

    /* Gallery column may still scroll if content overflows */
    .product-gallery-col {
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* ===== Gallery column compact ===== */
    .product-gallery-col {
        padding: 14px;
        display: flex;
        flex-direction: column;
    }

    .tabs {
        padding-bottom: 8px;
        margin-bottom: 10px;
    }

    .tab {
        padding: 6px 12px;
        font-size: 12px;
    }

    .tab-content.active {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }

    /* Gallery becomes flexible: takes available space */
    .gallery {
        aspect-ratio: auto;
        flex: 1;
        min-height: 0;
        margin-bottom: 10px;
    }

    .thumbnails-large {
        gap: 6px;
        margin-top: 10px;
        padding: 8px;
        flex-shrink: 0;
    }
    .thumbnails-large .thumb-card { width: 64px; height: 64px; border-radius: 8px; }
    .thumb-card img { padding: 4px; }
    .thumb-badge { font-size: 7px; padding: 1px 5px; bottom: 2px; }

    /* ===== Info column compact — wrapped in a single card like gallery & related ===== */
    .product-info-col {
        display: flex;
        flex-direction: column;
        gap: 0;
        background: var(--white);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow);
        border: 1px solid var(--border-light);
        padding: 10px;
    }

    /* All cards keep their natural height except chart-card which fills remaining space */
    .product-info-col > .card {
        flex-shrink: 0;
        flex-grow: 0;
        /* Inner cards become sub-sections — remove individual shadows */
        box-shadow: none;
    }

    /* Last inner card needs no bottom margin (outer padding covers it) */
    .product-info-col > .card:last-child {
        margin-bottom: 0;
    }

    /* Chart card — smaller, gives extra room to offers card */
    .product-info-col > .chart-card {
        flex: 0 0 clamp(148px, 18vh, 178px);
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .product-info-col > .chart-card .chart-header {
        flex-shrink: 0;
    }

    .product-info-col > .chart-card .chart-wrapper {
        flex: 1 1 auto;
        min-height: clamp(58px, 8vh, 88px);
        height: auto;
    }

    /* Offers card — taller, more presence */
    .product-info-col > .offers-card {
        flex: 0 1 clamp(185px, 25vh, 280px);
        min-height: clamp(175px, 24vh, 260px);
        display: flex;
        flex-direction: column;
    }

    .product-title {
        font-size: 18px;
        line-height: 1.25;
        margin-bottom: 6px;
    }

    .rating-row {
        margin-bottom: 10px;
        gap: 6px;
    }

    .stars svg { width: 14px; height: 14px; }
    .rating-text { font-size: 13px; }

    .card {
        padding: 14px;
        margin-bottom: 10px;
    }

    .card-title {
        font-size: 13px;
        margin-bottom: 10px;
    }

    /* Price card */
    .price-row {
        grid-template-columns: max-content minmax(210px, 1fr);
        gap: 8px;
        margin-bottom: 8px;
    }

    .price-value { font-size: 28px; }
    .currency { font-size: 12px; }
    .price-cents { font-size: 12px; }

    .price-meta {
        grid-template-columns: repeat(2, minmax(96px, max-content));
        column-gap: 10px;
    }
    .deal-source { column-gap: 5px; }
    .deal-label { font-size: 9px; }
    .discount-badge,
    .history-badge {
        padding: 3px 8px;
        font-size: 11px;
    }
    .price-old,
    .history-reference {
        font-size: 12px;
    }

    .savings { display: none; }
    .savings-label { font-size: 10px; }
    .savings-amount { font-size: 13px; }

    .price-stats {
        padding-top: 8px;
        gap: 6px;
    }

    .stat-item { padding: 5px 6px; gap: 5px; }
    .stat-icon { width: 24px; height: 24px; }
    .stat-icon svg { width: 12px; height: 12px; }
    .stat-label { font-size: 9px; }
    .stat-value { font-size: 11px; }

    /* Chart card */
    .chart-header { margin-bottom: 10px; }

    .range-tab { padding: 4px 10px; font-size: 11px; }

    /* Offers card */
    .offers-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        flex: 1 1 auto;
        align-items: stretch;
        grid-auto-rows: 1fr;
    }

    .offer-card {
        padding: 9px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        justify-content: flex-start;
        min-height: 100%;
    }
    .offer-badge  { font-size: 9px; padding: 2px 8px; margin-bottom: 6px; }
    .offer-seller { font-size: 11px; margin-bottom: 2px; }
    .offer-price  { font-size: 15px; margin-top: auto; margin-bottom: 8px; }
    .offer-btn    { padding: 6px; font-size: 12px; width: 100%; }

    /* ===== Related column ===== */
    .related-col {
        position: relative;
        overflow-y: hidden;
    }

    .related-card {
        position: static;
        height: 100%;
        display: flex;
        flex-direction: column;
        padding: 14px;
        margin-bottom: 0;
    }

    .related-header {
        margin-bottom: 10px;
        flex-shrink: 0;
    }

    .related-list {
        flex: 1;
        overflow-y: auto;
        gap: 6px;
        padding-right: 4px;
    }

    /* Rich cards inside related column — ultra compact so 2 fit fully */
    .related-list .product-card {
        border-radius: 14px;
        flex-shrink: 0;
        flex-grow: 0;
        height: auto;
        min-height: max-content;
    }
    .related-list .product-image-wrap {
        aspect-ratio: 16/4.5;
    }
    .related-list .product-images-row img {
        padding: 4px;
    }
    .related-list .product-info {
        padding: 5px 12px 7px;
        gap: 3px;
    }
    .related-list .product-category {
        font-size: 9px;
        letter-spacing: 0.8px;
    }
    .related-list .product-name {
        font-size: 12.5px;
        -webkit-line-clamp: 1;
        min-height: 16px;
        line-height: 1.25;
    }
    .related-list .product-stats-row { margin-top: 0; gap: 8px; }
    .related-list .product-price { font-size: 16px; }
    .related-list .product-price sup { font-size: 9px; }
    .related-list .product-rating { font-size: 11px; }
    .related-list .product-rating .star-icon { width: 10px; height: 10px; }
    .related-list .mini-chart {
        max-width: 120px;
        gap: 1px;
    }
    .related-list .mini-chart-svg { max-width: 100px; height: 24px; }
    .related-list .mini-chart-icon { font-size: 9px; gap: 3px; }
    .related-list .mini-chart-icon svg { width: 10px; height: 10px; }
    .related-list .product-kpis { gap: 4px; margin-top: 1px; }
    .related-list .kpi {
        padding: 3px 7px;
        font-size: 10px;
        gap: 3px;
    }
    .related-list .kpi svg { width: 10px; height: 10px; }
    .related-list .discount-tag {
        top: 6px; left: 6px;
        padding: 2px 8px;
        font-size: 10px;
    }
    .related-list .fav-btn {
        top: 6px; right: 6px;
        width: 26px; height: 26px;
    }
    .related-list .fav-btn svg { width: 12px; height: 12px; }
    .related-list .card-nav { width: 22px; height: 22px; }
    .related-list .card-dots { bottom: 3px; }
    .related-list .card-dots .dot { width: 4px; height: 4px; }
    .related-list .card-dots .dot.active { width: 12px; }

    /* Tighter related header/footer to give more room to the list */
    .related-card .card-title { font-size: 13px; margin-bottom: 0; }
    .related-header { margin-bottom: 8px; }
    .link-more { padding: 8px 0 2px !important; margin-top: 8px !important; font-size: 12px !important; }

    .link-more {
        padding: 10px 0 4px;
        margin-top: 10px;
        font-size: 13px;
        flex-shrink: 0;
    }
}

@media (max-width: 560px) {
    .price-row {
        grid-template-columns: 1fr;
    }

    .price-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .savings {
        display: none;
    }
}

@container (max-width: 680px) {
    .price-row {
        grid-template-columns: max-content minmax(0, 1fr);
    }

    .price-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .deal-source {
        min-width: 0;
    }

    .savings {
        display: none;
    }
}

@container (max-width: 460px) {
    .price-row {
        grid-template-columns: 1fr;
    }

    .price-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ===== LARGE DESKTOP ===== */
@media (min-width: 1280px) {
    .product-layout { gap: 18px; }

    .product-title { font-size: 20px; }
    .price-value { font-size: 36px; }

    .offers-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
    .offer-price { font-size: 16px; }

    .related-img { width: 64px; height: 64px; }
}

@media (min-width: 1440px) {
    .product-title { font-size: 22px; }
    .price-value { font-size: 40px; }

    .card { padding: 16px; margin-bottom: 12px; }
    .card-title { font-size: 14px; }
}

/* ===== SHORT VIEWPORTS (laptops with limited height) ===== */
@media (min-width: 1024px) and (max-height: 800px) {
    .product-title { font-size: 17px; }
    .card-title { margin-bottom: 8px; font-size: 12px; }

    /* On short viewports keep thumbnails visible but smaller */
    .thumbnails-large {
        padding: 6px;
        margin-top: 8px;
        gap: 5px;
    }
    .thumbnails-large .thumb-card { width: 54px; height: 54px; }
    .thumb-card img { padding: 3px; }
    .thumb-badge { display: none; }
}

/* ===== DESKTOP LAYOUT OVERRIDE — HARD CONSTRAINTS FIRST =====
   NON-NEGOTIABLE: prices NEVER get clipped or ellipsis-truncated.
   Strategy: zero horizontal padding on outer wrapper to give inner cards
   the full column; stat-items stack vertically so values get full cell width;
   font sizes capped low enough to guarantee fit at 1024px viewport.
   ===== */
@media (min-width: 1024px) {

    /* ── Outer wrapper: NO horizontal padding so inner cards use the full column ── */
    .product-info-col {
        padding: clamp(8px, 0.7vw, 12px) 0;
    }
    /* Non-card direct children need their own horizontal padding */
    .product-info-col > .product-title,
    .product-info-col > .rating-row {
        padding-left:  clamp(10px, 1vw, 14px);
        padding-right: clamp(10px, 1vw, 14px);
    }

    /* ── Inner sub-cards: scale padding ── */
    .product-info-col > .card {
        padding: clamp(9px, 0.95vw, 14px);
        position: relative;
        overflow: hidden; /* prevents any inner content from bleeding into siblings */
    }
    .product-info-col > .price-card {
        padding: clamp(7px, 0.7vw, 10px);
    }
    .product-info-col > .price-card .card-title {
        margin-bottom: clamp(4px, 0.45vw, 6px);
    }

    /* ── Price row stays side-by-side ── */
    .price-row {
        grid-template-columns: max-content minmax(0, 1fr);
        gap: clamp(4px, 0.45vw, 8px);
        margin-bottom: clamp(4px, 0.45vw, 7px);
    }
    .price-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: clamp(4px, 0.5vw, 10px);
    }
    .savings { display: none; }

    /* ── deal-source: label + badge inline (2-row spec) ── */
    .deal-source {
        grid-template-columns: max-content auto;
        column-gap: 5px;
        row-gap: 0;
        align-items: center;
        min-width: 0;
    }
    /* Hide old price & reference — not in 2-row spec */
    .price-old,
    .history-reference { display: none; }

    /* ── Price value & price card text ── */
    .price-value { font-size: clamp(18px, 1.45vw, 24px); }
    .price-cents { font-size: clamp(9px, 0.72vw, 11px); }
    .currency    { font-size: clamp(9px, 0.7vw, 10.5px); }
    .deal-label  {
        font-size: clamp(7px, 0.6vw, 9.5px);
        letter-spacing: 0.3px;
    }
    .discount-badge,
    .history-badge {
        font-size: clamp(8px, 0.72vw, 10px);
        padding: clamp(1px, 0.2vw, 3px) clamp(5px, 0.45vw, 7px);
    }

    /* ── STAT ITEMS: VERTICAL LAYOUT — gives full cell width to the value ── */
    .price-stats {
        gap: clamp(4px, 0.5vw, 7px);
        padding-top: clamp(5px, 0.55vw, 7px);
    }
    .price-stats .stat-item {
        display: grid;
        grid-template-columns: auto max-content;
        grid-template-areas:
            "icon label"
            "value value";
        justify-content: center;
        align-content: center;
        align-items: center;
        column-gap: 3px;
        row-gap: 1px;
        text-align: center;
    }
    .price-stats .stat-item > div:last-child {
        display: contents;
    }
    .price-stats .stat-icon {
        grid-area: icon;
    }
    .price-stats .stat-label {
        grid-area: label;
    }
    .price-stats .stat-value {
        grid-area: value;
        justify-self: center;
        overflow: visible;
        text-overflow: clip;
    }
    .stat-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1px;
        padding: clamp(3px, 0.4vw, 5px) clamp(3px, 0.35vw, 5px);
    }
    .stat-item > div:last-child {
        min-width: 0;
        max-width: 100%;
        text-align: center;
    }
    .stat-icon { width: clamp(17px, 1.45vw, 20px); height: clamp(17px, 1.45vw, 20px); }
    .stat-icon svg { width: clamp(9px, 0.75vw, 10px); height: clamp(9px, 0.75vw, 10px); }
    .stat-label {
        font-size: clamp(6.5px, 0.58vw, 8px);
        white-space: nowrap;
    }
    .stat-value {
        font-size: clamp(8.5px, 0.72vw, 10px);
        white-space: nowrap; /* never wraps */
        /* NO ellipsis — the vertical layout guarantees enough width */
    }

    /* ── Chart range tabs ── */
    .range-tab {
        font-size: clamp(9px, 0.8vw, 11px);
        padding: clamp(3px, 0.4vw, 6px) clamp(7px, 0.8vw, 12px);
    }

    /* ── Offers card ── */
    .offers-card.card { padding: clamp(8px, 0.9vw, 13px); }
    .offers-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: clamp(3px, 0.45vw, 8px);
        flex: 1 1 auto;
        align-items: stretch;
        grid-auto-rows: 1fr;
    }
    .offer-card {
        padding: clamp(5px, 0.6vw, 9px) clamp(2px, 0.3vw, 5px);
        border-width: 1.5px;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        justify-content: center;
        gap: clamp(2px, 0.3vw, 4px);
        min-height: 100%;
    }
    .offer-badge {
        font-size: clamp(5.5px, 0.55vw, 8.5px);
        padding: 2px clamp(3px, 0.35vw, 6px);
        letter-spacing: 0.15px;
        line-height: 1.2;
        max-width: 100%;
        white-space: normal; /* allows wrap as last resort instead of clipping */
    }
    .offer-seller {
        font-size: clamp(8px, 0.75vw, 10.5px);
        line-height: 1.2;
        max-width: 100%;
        overflow-wrap: break-word;
    }
    /* PRICE: never ellipsis, never clip — font sized so it fits at 1024px+ */
    .offer-price {
        font-size: clamp(9px, 0.8vw, 11.5px);
        margin: clamp(6px, 0.8vw, 12px) 0 0;
        white-space: nowrap;
        max-width: 100%;
        /* NO overflow:hidden / NO text-overflow:ellipsis — would clip the price */
    }
    .offer-btn {
        font-size: clamp(8.5px, 0.8vw, 11px);
        padding: clamp(4px, 0.5vw, 6px) clamp(3px, 0.4vw, 5px);
        width: 100%;
        margin-top: clamp(4px, 0.5vw, 7px);
    }

    /* ── Title & rating ── */
    .product-title { font-size: clamp(15px, 1.35vw, 21px); }
    .rating-text   { font-size: clamp(11px, 1vw, 14px); }
}

/* ===== SHORT VIEWPORT COMPACT MODE =====
   When height is limited, shrink everything proportionally so the chart
   AND the offers card both fit without clipping or overflow.
   ===== */
@media (min-width: 1024px) and (max-height: 800px) {
    /* Outer wrapper: less padding */
    .product-info-col { padding: 6px 0; }

    /* Sub-cards: compact padding & margins */
    .product-info-col > .card { padding: 8px 10px; margin-bottom: 6px; }
    .product-info-col > .card .card-title { margin-bottom: 6px; }

    /* Title & rating: smaller & tighter */
    .product-title { font-size: 15px; margin-bottom: 4px; }
    .rating-row   { margin-bottom: 6px; }

    /* Price card: more compact */
    .product-info-col > .price-card { padding: 6px 8px; }
    .product-info-col > .price-card .card-title { margin-bottom: 4px; }
    .price-value  { font-size: 20px; }
    .price-row    { margin-bottom: 4px; }
    .price-stats  { padding-top: 5px; gap: 5px; }
    .stat-item    { padding: 3px 3px; gap: 1px; }
    .stat-icon    { width: 17px; height: 17px; }
    .stat-icon svg { width: 9px; height: 9px; }
    .stat-label   { font-size: 6.5px; }
    .stat-value   { font-size: 8.5px; }

    /* Chart card: keep visible but compact */
    .product-info-col > .chart-card {
        flex-basis: clamp(128px, 16vh, 150px);
        min-height: clamp(110px, 14vh, 160px);
    }
    .product-info-col > .chart-card .chart-wrapper {
        min-height: clamp(65px, 8vh, 100px);
    }

    /* Offers card: compact */
    .product-info-col > .offers-card {
        min-height: clamp(165px, 23vh, 240px);
    }
    .offers-card.card { padding: 7px 8px; }
    .offers-header   { margin-bottom: 4px; }
    .offer-card      { padding: 4px 3px; gap: 1px; }
    .offer-badge     { font-size: 6px; padding: 1px 4px; }
    .offer-seller    { font-size: 8px; }
    .offer-price     { font-size: 10px; }
    .offer-btn       { font-size: 9px; padding: 3px 2px; }
}

/* ===== PRICE CURRENT REFINEMENT ===== */
@media (min-width: 1024px) {
    .product-info-col > .price-card {
        padding: clamp(9px, 0.85vw, 12px);
        border-radius: 18px;
        background:
            radial-gradient(ellipse 76% 78% at 100% 0%, rgba(16, 185, 129, 0.16), transparent 70%),
            linear-gradient(135deg, #ffffff 24%, #f4fdf8 100%);
    }

    .product-info-col > .price-card .card-title {
        margin-bottom: clamp(6px, 0.55vw, 8px);
        font-size: clamp(12px, 0.95vw, 14px);
    }

    .price-card .price-row {
        grid-template-columns: max-content minmax(0, 1fr);
        align-items: center;
        gap: clamp(7px, 0.8vw, 12px);
        padding-bottom: clamp(8px, 0.75vw, 10px);
        margin-bottom: 0;
        border-bottom: 1px solid rgba(209, 250, 229, 0.9);
    }

    .price-card .price-main {
        gap: 4px;
    }

    .price-card .price-value {
        font-size: clamp(22px, 1.85vw, 31px);
        line-height: 0.95;
        letter-spacing: 0;
    }

    .price-card .price-cents {
        font-size: clamp(10px, 0.82vw, 13px);
    }

    .price-card .currency {
        font-size: clamp(10px, 0.78vw, 12px);
        font-weight: 800;
    }

    .price-card .price-meta {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: clamp(6px, 0.65vw, 9px);
        min-width: 0;
    }

    .price-card .deal-source {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "label badge"
            "reference reference";
        align-items: center;
        gap: 2px 6px;
        min-width: 0;
        padding: clamp(5px, 0.55vw, 8px) clamp(6px, 0.7vw, 10px);
        border: 1px solid rgba(209, 250, 229, 0.95);
        border-radius: 13px;
        background: rgba(255, 255, 255, 0.72);
    }

    .price-card .deal-label {
        grid-area: label;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: clamp(7px, 0.62vw, 9px);
        font-weight: 800;
        letter-spacing: 0;
    }

    .price-card .discount-badge,
    .price-card .history-badge {
        grid-area: badge;
        justify-self: end;
        padding: clamp(2px, 0.24vw, 3px) clamp(6px, 0.6vw, 9px);
        font-size: clamp(8.5px, 0.78vw, 11px);
    }

    .price-card .price-old,
    .price-card .history-reference {
        grid-area: reference;
        font-size: clamp(8.5px, 0.72vw, 10.5px);
        line-height: 1.15;
        white-space: nowrap;
    }

    .price-card .price-stats {
        border-top: 0;
        padding-top: clamp(7px, 0.65vw, 9px);
        gap: clamp(6px, 0.7vw, 9px);
    }

    .price-card .price-stats .stat-item {
        grid-template-columns: auto max-content;
        grid-template-areas:
            "icon label"
            "value value";
        justify-content: center;
        align-content: center;
        column-gap: 5px;
        row-gap: 2px;
        padding: clamp(5px, 0.58vw, 7px) clamp(5px, 0.65vw, 8px);
        border: 1px solid rgba(243, 244, 246, 0.95);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.82);
    }

    .price-card .stat-icon {
        grid-area: icon;
        width: clamp(18px, 1.45vw, 20px);
        height: clamp(18px, 1.45vw, 20px);
        border-radius: 999px;
    }

    .price-card .stat-icon svg {
        width: clamp(9px, 0.75vw, 10px);
        height: clamp(9px, 0.75vw, 10px);
    }

    .price-card .stat-label {
        grid-area: label;
        font-size: clamp(6.5px, 0.58vw, 8.5px);
        font-weight: 800;
        letter-spacing: 0;
    }

    .price-card .stat-value {
        grid-area: value;
        justify-self: center;
        font-size: clamp(8.5px, 0.72vw, 10.5px);
        overflow: visible;
        text-overflow: clip;
    }
}

@media (min-width: 1024px) and (max-height: 800px) {
    .product-info-col > .price-card {
        padding: 7px 9px;
    }

    .product-info-col > .price-card .card-title {
        margin-bottom: 5px;
    }

    .price-card .price-row {
        gap: 7px;
        padding-bottom: 6px;
    }

    .price-card .price-value {
        font-size: 22px;
    }

    .price-card .deal-source {
        padding: 4px 6px;
        border-radius: 11px;
    }

    .price-card .price-stats {
        padding-top: 6px;
        gap: 5px;
    }

    .price-card .price-stats .stat-item {
        padding: 4px 4px;
    }

    .price-card .stat-icon {
        width: 17px;
        height: 17px;
    }

    .price-card .stat-label {
        font-size: 6.5px;
    }

    .price-card .stat-value {
        font-size: 8.5px;
    }
}

@media (min-width: 1024px) {
    .price-card .deal-source {
        grid-template-columns: 1fr;
        grid-template-areas:
            "label"
            "badge"
            "reference";
        justify-items: start;
        align-content: center;
        gap: 1px;
    }

    .price-card .deal-label {
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    .price-card .discount-badge,
    .price-card .history-badge {
        justify-self: start;
    }
}


/* ===== v2.1 — two-card grid for related products ===== */
.related-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.related-list .product-card {
    min-width: 0;
    width: 100%;
}

@media (max-width: 639px) {
    .related-list {
        grid-template-columns: 1fr;
    }
}

/* ===== v2.2-force-two-columns-related ===== */
@media (min-width: 560px) {
    #relatedList.related-list {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }
}

@media (max-width: 559px) {
    #relatedList.related-list {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }
}
