/*!
 * Tiered Discount by SKU — Frontend styles.
 *
 * @package TieredDiscountBySKU
 */

.tds-banner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 18px;
    padding: 14px 50px 14px 18px;
    background: linear-gradient(135deg, #fff5f8 0%, #ffe6ef 100%);
    border: 1px solid #f5c4d4;
    border-left: 5px solid #CC3366;
    border-radius: 8px;
    color: #4a2030;
    font-size: 14px;
    line-height: 1.45;
    box-shadow: 0 2px 6px rgba(204, 51, 102, 0.08);
}
.tds-banner.tds-banner--potential {
    background: linear-gradient(135deg, #fff9e6 0%, #fff2cc 100%);
    border-color: #f3d27a;
    border-left-color: #d39e00;
    color: #5a4400;
}
.tds-banner-icon {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #CC3366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}
.tds-banner--potential .tds-banner-icon { background: #d39e00; }
.tds-banner-content { flex: 1 1 auto; }
.tds-banner-title { font-weight: 700; margin: 0 0 2px; font-size: 15px; }
.tds-banner-text  { margin: 0; }
.tds-banner-text strong { color: #CC3366; font-weight: 700; }
.tds-banner--potential .tds-banner-text strong { color: #b07a00; }
.tds-banner-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 26px;
    height: 26px;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    opacity: 0.6;
    padding: 0;
}
.tds-banner-close:hover { opacity: 1; }

.tds-item-discount {
    display: block;
    margin: 6px 0 2px;
    font-size: 13px;
}
.tds-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 6px 4px 0;
}
.tds-badge-pct {
    background: #2e7d32;
    color: #fff;
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: 700;
}
.tds-badge-label { color: #2e7d32; }
.tds-badge-savings { color: #1b5e20; font-weight: 700; }

.tds-progress {
    display: block;
    margin: 4px 0 0;
    padding: 8px 10px;
    background: #f7f7f9;
    border: 1px solid #e6e6ea;
    border-radius: 6px;
}
.tds-progress-text {
    margin: 0 0 6px;
    font-size: 12px;
    color: #555;
    line-height: 1.3;
}
.tds-progress-text strong { color: #CC3366; }
.tds-progress-bar {
    position: relative;
    width: 100%;
    height: 8px;
    background: #e9e9ef;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 0 6px;
}
.tds-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #CC3366 0%, #ff6699 100%);
    border-radius: 4px;
    transition: width 0.4s ease;
}
.tds-progress-fill--max { background: linear-gradient(90deg, #2e7d32 0%, #66bb6a 100%); }
.tds-progress-tiers {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 11px;
}
.tds-tier-chip {
    padding: 2px 7px;
    background: #fff;
    border: 1px solid #d8d8de;
    border-radius: 999px;
    color: #888;
    font-weight: 600;
    white-space: nowrap;
}
.tds-tier-chip.tds-tier-reached {
    background: #e8f5e9;
    border-color: #a5d6a7;
    color: #1b5e20;
}
.tds-tier-chip.tds-tier-current {
    background: #CC3366;
    border-color: #CC3366;
    color: #fff;
}

.tds-discount-row th .tds-discount-breakdown {
    display: block;
    margin-top: 4px;
    font-weight: 400;
    font-size: 12px;
    color: #555;
}
.tds-discount-row th .tds-discount-breakdown summary {
    cursor: pointer;
    color: #CC3366;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.tds-discount-row th .tds-discount-breakdown summary::-webkit-details-marker { display: none; }
.tds-discount-row th .tds-discount-breakdown summary::before {
    content: "▸";
    display: inline-block;
    transition: transform 0.2s;
}
.tds-discount-row th .tds-discount-breakdown[open] summary::before { transform: rotate(90deg); }
.tds-discount-row th .tds-discount-breakdown ul {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid #eee;
    padding-top: 6px;
}
.tds-discount-row th .tds-discount-breakdown li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 0;
    font-size: 12px;
    color: #555;
}
.tds-discount-row th .tds-discount-breakdown li code {
    background: #f4f4f6;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
    color: #333;
}

@media (max-width: 600px) {
    .tds-banner {
        flex-wrap: wrap;
        padding: 12px 42px 12px 14px;
        font-size: 13px;
    }
    .tds-banner-icon { width: 28px; height: 28px; font-size: 14px; }
    .tds-banner-title { font-size: 14px; }
    .tds-item-discount { font-size: 12px; }
    .tds-progress-tiers { font-size: 10px; }
}

.tds-qty-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}
.tds-qty-option {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #fff;
    transition: box-shadow 0.2s;
}
.tds-qty-option:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.tds-qty-option-qty {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 2px;
}
.tds-qty-option-label {
    font-size: 13px;
    color: #888;
    font-weight: 400;
}
.tds-qty-option-pct {
    display: inline-block;
    background: #4CAF50;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 3px 10px;
    border-radius: 999px;
    margin: 8px 0;
}
.tds-qty-option-total {
    font-size: 22px;
    font-weight: 700;
    margin: 4px 0 2px;
}
.tds-qty-option-unit {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}
.tds-qty-option-savings {
    font-size: 14px;
    color: #4CAF50;
    font-weight: 600;
    margin-bottom: 12px;
}
.tds-qty-option-form { margin: 0; }
.tds-qty-option-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.tds-qty-option-btn:hover { background: #005a87; }
.tds-qty-option-btn:active { background: #004a6e; }

.tds-qty-options-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 24px;
}

.tds-qty-option {
    background: #ffffff;
    border: 2px solid #d9d9d9;
    border-radius: 10px;
    padding: 10px 10px 5px;
    display: flex;
    flex-direction: column;
    min-height: 270px;
}

.tds-qty-option--featured {
    border-color: #c8102e;
}

.tds-qty-option-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    color: #7f7f7f;
    font-size: 9px;
    font-weight: 600;
}

.tds-qty-option-check {
    width: 22px;
    height: 22px;
    border: 2px solid #c8102e;
    border-radius: 50%;
    color: #c8102e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    flex-shrink: 0;
}

.tds-qty-option-qty-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tds-qty-option-qty,
.tds-qty-option-label {
    font-size: 15px;
    font-weight: 400;
    color: #7f7f7f;
}

.tds-qty-option-unit-price {
    font-size: 28px;
    line-height: 1.1;
    font-weight: 700;
    color: #c8102e;
    margin-bottom: 6px;
    text-align: left;
}

.tds-qty-option-unit-price .amount {
    color: #c8102e;
}

.tds-qty-option-unit-label {
    font-size: 18px;
    font-weight: 500;
    color: #c8102e;
}

.tds-qty-option-savings-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    border: 1px solid #c8102e;
    color: #c8102e;
    border-radius: 10px;
    padding: 0px 8px;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
}

.tds-qty-option-divider {
	width: 90%;
    height: 1px;
    background: #dddddd;
    margin-bottom: 5px;
}

.tds-qty-option-total {
    font-size: 24px;
    line-height: 1.2;
    color: #8a8a8a;
    font-weight: 500;
    margin-bottom: 14px;
}

.tds-qty-option-total .amount {
    color: #8a8a8a;
}

.tds-qty-option-description {
    font-size: 18px;
    line-height: 1.3;
    color: #8a8a8a;
    font-weight: 600;
    min-height: 30px;
    margin-bottom: 0px;
}

.tds-qty-option-form {
    margin-top: auto;
}

.tds-qty-option-btn {
    width: 100%;
    height: 62px;
    border: 2px solid #d4d4d4;
    border-radius: 14px;
    background: #f1f1f1;
    color: #8d8d8d;
    font-size: 24px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s ease;
}

.tds-qty-option-btn--solid {
    background: #de0b17;
    border-color: #de0b17;
    color: #fff;
}

.tds-qty-option-unit-price span.woocommerce-Price-amount.amount {
    font-family: 'Montserrat' !important; 
    font-size:26px !important;
    font-weight:500;
    text-align:left !important;
}

.tds-qty-option-savings-badge span.woocommerce-Price-amount.amount {
    font-family: 'Montserrat' !important;
    font-size: 15px !important;
    font-weight: 500;
    text-align: left !important;
    padding-left: 5px;
}

.tds-qty-option-total span.woocommerce-Price-amount.amount {
    text-align:left !important;
}
.tds-qty-option-total {
   text-align:left !important; 
   display:flex;
   font-size: 18px;
}
.tds-qty-option-total span.woocommerce-Price-amount.amount {
    font-size: 18px !important;
    font-family:'Montserrat' !important;
    color: #8a8a8a;
    font-weight:500 !important;
    padding-left:6px;
}
.tds-qty-option-description {
    text-align:left;
    font-size:15px;
    font-weight:500;
}
form.tds-qty-option-form button.tds-qty-option-btn {
    width: 100% !important;
    background:none !important;
    border: 1px solid #8a8a8a4d;
    height:35px;
    padding:0px !important;
    color:#8a8a8a;
}
.tds-qty-option-form{
    margin:0px
}

.tds-qty-options-grid-tag {
    display:flex;
}

.tds-qty-options-grid-tag .tds-qty-options-grid-tag-text h3.text-discount{
    font-family:'Montserrat';
    font-size:20px;
    text-transform:uppercase;
    color:#8F8F8F;
    padding: 4px 0px 0px 10px !important;
    margin: 0px !important;
}

span.iconDiscount i {
    color:#8F8F8F;
}

form.tds-qty-option-form button.tds-qty-option-btn:hover {
    background-color:#D01317 !important;
    color:white !important;
}

@media (max-width: 767px){
    .tds-qty-options-grid {
            flex-direction: column;
    }
}
/* Precio en la miniatura del listado.
   El CSS del sitio deja `.price` en color #fff0 (transparente) porque el
   precio visible lo pintan `.price del .amount` y `.price ins .amount`, que
   solo existen cuando WooCommerce marca el producto en oferta. Para los SKU
   de lista blanca el plugin fuerza `is_on_sale() = false`, asi que WooCommerce
   emite un `.amount` como hijo directo de `.price` y este hereda el color
   transparente. El selector `>` alcanza justo ese caso (precio regular unico)
   y no toca el tachado gris de los productos que si estan en oferta. */
ul.products li.product .price > .woocommerce-Price-amount,
ul.products li.product .price > .woocommerce-Price-amount bdi,
ul.products li.product .price > .woocommerce-Price-amount .woocommerce-Price-currencySymbol {
    font-family: "Bebas Neue" !important;
    font-size: 36px !important;
    font-weight: 400 !important;
    color: #d01317 !important;
    -webkit-text-fill-color: #d01317 !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 70px;
}

/* Etiqueta promocional en la esquina superior izquierda de la miniatura.
   `li.product` ya es contenedor posicionado (lo usa .premium-tag del tema,
   anclada abajo a la derecha), así que basta con anclar arriba a la izquierda.
   pointer-events:none para no tapar el enlace del producto. */
ul.products li.product .tds-promo-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 30%;
    max-width: 120px;
    z-index: 2;
    line-height: 0;
    pointer-events: none;
}

ul.products li.product .tds-promo-tag img {
    width: 100%;
    height: auto;
    border-radius: 0 !important;
}

@media (max-width: 767px) {
    ul.products li.product .tds-promo-tag {
        width: 34%;
        top: 4px;
        left: 4px;
    }
}