/* ============================================================
   CALC LOOP CARD — Tarjeta de producto para el loop de tienda
   ============================================================ */

.calc-loop-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    font-family: 'Montserrat', sans-serif;
}

/* --- Imagen --- */
.calc-loop-img-link {
    display: block;
    text-decoration: none;
}

.calc-loop-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f5f5f5;
}

.calc-loop-img-main,
.calc-loop-img-hover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.35s ease;
}

.calc-loop-img-main {
    opacity: 1;
    z-index: 1;
}

.calc-loop-img-hover {
    opacity: 0;
    z-index: 2;
}

.calc-loop-card:hover .calc-loop-img-main {
    opacity: 0;
}

.calc-loop-card:hover .calc-loop-img-hover {
    opacity: 1;
}

/* --- Titulo --- */
h2.calc-loop-title {
    margin: 12px 0 4px;
    font-size: 20px !important;
    font-weight: 600 !important;
    line-height: 25px !important;
    display: block;
    min-height: 75px;
}

.calc-loop-title a {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 600;
}

.calc-loop-title a:hover {

    font-weight: 600 !important;
}

/* --- Precio --- */
.calc-loop-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 3px;
    margin: 4px 0 8px;
    font-size: 13px;
    color: #444;
    line-height: 1.4;
}

.calc-loop-price-amount {
    font-weight: 700;
    font-size: 15px;
    color: #1a1a1a;
}

.calc-loop-price-amount .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.calc-loop-price-unit {
    font-size: 11px;
    color: #666;
}

.calc-loop-price-note {
    display: block;
    width: 100%;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* --- Swatches de color --- */
.calc-loop-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
}

.calc-loop-swatch {
    position: relative;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #bbbbbb;
    box-sizing: border-box;
    transition: border-color 0.15s, transform 0.15s;
}

.calc-loop-swatch:hover {
    transform: scale(1.15);
    border-color: #888;
}

.calc-loop-swatch.selected {
    border-color: #2e2e2e;
    transform: scale(1.12);
}

.calc-loop-swatch .swatch-inner {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: solid 1px #bbbbbb;
}

/* Franja roja diagonal para sin stock */
.calc-loop-swatch.out-stock .swatch-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(
        to bottom right,
        transparent calc(50% - 1px),
        #d32f2f calc(50% - 1px),
        #d32f2f calc(50% + 1px),
        transparent calc(50% + 1px)
    );
    pointer-events: none;
}

/* Tooltip del swatch */
.calc-loop-swatch::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 5px 10px;
    background: #333;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    white-space: pre-line;
    text-align: center;
    width: 120px;
    line-height: 1.5;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 200;
}

.calc-loop-swatch:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .calc-loop-title {
        font-size: 13px;
    }
    .calc-loop-price-amount {
        font-size: 14px;
    }
    .calc-loop-swatch {
        width: 20px;
        height: 20px;
    }
}
