/**
 * Latbit - Estilos del Indicador de Disponibilidad
 * Version: 1.2.0
 */

/* ========================================
   ESTILOS GENERALES DEL INDICADOR
======================================== */

/* Contenedor principal del indicador */
.latbit-inventory-indicator {
    margin: 0;
    font-family: inherit;
}

/* Contenedor del punto y texto */
.latbit-indicator-dot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

/* Punto indicador base */
.latbit-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* Punto verde - Disponible */
.latbit-available .latbit-dot {
    background-color: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
    animation: latbit-pulse-green 2s infinite;
}

.latbit-available .latbit-text {
    color: #28a745;
}

/* Punto naranja - Consultar disponibilidad */
.latbit-unavailable .latbit-dot {
    background-color: #ff9800;
    box-shadow: 0 0 8px rgba(255, 152, 0, 0.4);
    animation: latbit-pulse-orange 2s infinite;
}

.latbit-unavailable .latbit-text {
    color: #ff9800;
}

html body #page-container .et_pb_section .et_pb_wc_cart_totals_0 a.checkout-button {
    color: white !important;
}

/* Animación de pulso para punto verde */
@keyframes latbit-pulse-green {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
    }

    50% {
        box-shadow: 0 0 15px rgba(40, 167, 69, 0.6);
    }
}

/* Animación de pulso para punto naranja */
@keyframes latbit-pulse-orange {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(255, 152, 0, 0.4);
    }

    50% {
        box-shadow: 0 0 15px rgba(255, 152, 0, 0.6);
    }
}

/* ========================================
   ESTILOS ESPECÍFICOS PARA PÁGINAS
======================================== */

/* Estilos específicos para página de producto individual */
.latbit-indicator-single {
    margin: 20px 0;
}

.latbit-indicator-single .latbit-indicator-dot {
    font-size: 16px;
}

.latbit-indicator-single .latbit-dot {
    width: 14px;
    height: 14px;
}

/* Estilos específicos para listados de productos */
.latbit-indicator-loop {
    margin: 0;
    text-align: left;
}

.latbit-indicator-loop .latbit-indicator-dot {
    font-size: 13px;
    justify-content: center;
}

.latbit-indicator-loop .latbit-dot {
    width: 10px;
    height: 10px;
}

/* Estilos para shortcode */
.latbit-indicator-shortcode {
    display: inline-block;
    margin: 5px 0;
}

/* ========================================
   ESTILOS PARA CARRITO Y CHECKOUT
======================================== */

ul.woocommerce-error {
    background-color: #b81c23 !important;
}

.cart_totals .woocommerce-shipping-totals{
    display: none;
}

.woocommerce-error a{
    color: white;
}

.woocommerce-shipping-totals{
    display: none !important;
}

.dgwt-wcas-style-pirx.dgwt-wcas-search-focused .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input{
    border: none;
    background-color: transparent !important;
}

.dgwt-wcas-style-pirx .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input {
      background-color: transparent !important;
}


.coupon{
    display: none;
}

.woocommerce-additional-fields{
    margin-top: 30px;
}

span.select2-selection {
    background-color: #eee !important;
    border: none !important;
}

.select2-container .select2-selection--single{
    height: 55px !important;
    padding: 7px 0px;
}
    

.woocommerce-form-coupon-toggle{
    display: none;
}

/* Indicador en el carrito junto al nombre del producto */
.latbit-cart-indicator {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-right: 5px;
}

.latbit-cart-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

#ship-to-different-address{
    display: none !important;
}

.woocommerce-billing-fields{
    margin-top: 20px;
}

/* Punto verde en carrito */
.latbit-cart-indicator.latbit-available .latbit-cart-dot {
    background-color: #28a745;
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.4);
}

/* Punto naranja en carrito */
.latbit-cart-indicator.latbit-unavailable .latbit-cart-dot {
    background-color: #ff9800;
    box-shadow: 0 0 6px rgba(255, 152, 0, 0.4);
}

/* Aviso de disponibilidad en carrito */
.latbit-cart-notice {
    background-color: #f0f8ff;
    border: 2px solid #2196F3;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.latbit-cart-notice-content {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.latbit-notice-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}

.latbit-notice-text {
    flex: 1;
    color: white;
}

.latbit-notice-text strong {
    color: white;
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.latbit-notice-text p {
    margin: 0 0 10px 0;
    color: white;
}

/* Texto de advertencia */
.latbit-warning-text {
    background-color: #fff3cd;
    border-left: 4px solid #ff9800;
    padding: 10px 15px;
    margin-top: 12px;
    border-radius: 4px;
    color: #856404;
}

.latbit-warning-icon {
    margin-right: 8px;
}

/* Leyenda de indicadores */
.latbit-legend {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(33, 150, 243, 0.2);
    flex-wrap: wrap;
}

.latbit-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: white;
}

.latbit-legend .latbit-cart-dot {
    width: 12px;
    height: 12px;
}

.latbit-legend .latbit-cart-dot.latbit-available {
    background-color: #28a745;
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.4);
}

.latbit-legend .latbit-cart-dot.latbit-unavailable {
    background-color: #ff9800;
    box-shadow: 0 0 6px rgba(255, 152, 0, 0.4);
}

/* Aviso en checkout */
.latbit-checkout-notice td {
    padding: 0 !important;
}

.latbit-checkout-notice .latbit-cart-notice {
    margin: 10px 0 20px 0;
}

.woocommerce-shipping-fields{
    margin-top: 20px;
}

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

@media screen and (max-width: 768px) {
    .latbit-inventory-indicator {
        margin: 12px 0;
    }

    .latbit-indicator-single .latbit-indicator-dot {
        font-size: 14px;
    }

    .latbit-indicator-loop .latbit-indicator-dot {
        font-size: 12px;
    }

    /* Ajustes para carrito en móvil */
    .latbit-cart-notice {
        padding: 15px;
        font-size: 13px;
    }

    .latbit-cart-notice-content {
        flex-direction: column;
        gap: 10px;
    }

    .latbit-notice-icon {
        font-size: 20px;
    }

    .latbit-notice-text strong {
        font-size: 15px;
    }

    .latbit-legend {
        flex-direction: column;
        gap: 10px;
    }

    .latbit-cart-dot {
        width: 8px;
        height: 8px;
    }
}

/* ========================================
   ACCESIBILIDAD
======================================== */

.latbit-indicator-dot:focus-visible,
.latbit-cart-indicator:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Mejora de contraste para lectores de pantalla */
.latbit-cart-indicator[title]:hover::after {
    content: attr(title);
    position: absolute;
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-top: 25px;
    margin-left: -50px;
}

/* ========================================
   COMPATIBILIDAD CON TEMAS
======================================== */

.product .latbit-inventory-indicator,
.woocommerce-product-details .latbit-inventory-indicator {
    clear: both;
}

/* Asegurar que el indicador no rompa el layout del carrito */
.woocommerce-cart-form .latbit-cart-indicator,
.woocommerce-checkout-review-order .latbit-cart-indicator {
    display: inline-flex;
    margin-right: 8px;
}

/* Ajuste para tablas de WooCommerce */
.woocommerce table.shop_table .latbit-cart-indicator {
    vertical-align: middle;
}

.products a.button {
    color: white !important;
}

.et_shop_image img {
    height: 200px !important;
    object-fit: contain;
}

/* ========================================
  MI CUENTA
======================================== */

.woocommerce-MyAccount-navigation ul {
 list-style-type: none !important;
}

.woocommerce-MyAccount-navigation li {
 padding: 5px 10px;
 margin-bottom: 5px;
 background: #f9f9f9;
}

.woocommerce-MyAccount-navigation-link--downloads{
 display: none !important;
}

/* ========================================
   BLOQUE DE PRECIOS PERSONALIZADO (PVP / Dto. / Neto)
======================================== */

.latbit-price-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.5;
}

.latbit-price-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 0.9em;
}

.latbit-price-label {
    font-weight: 600;
    color: #555;
    min-width: 3.5em;
    white-space: nowrap;
}

.latbit-price-value {
    color: #333;
}

/* PVP: color neutro, más discreto */
.latbit-price-pvp .latbit-price-value {
    color: #555;
}

/* Dto.: destacar el porcentaje */
.latbit-price-dto .latbit-price-value {
    color: #e44;
    font-weight: 600;
}

/* Neto: precio final, más prominente */
.latbit-price-neto .latbit-price-label,
.latbit-price-neto .latbit-price-value {
    font-size: 1.1em;
    font-weight: 700;
    color: #333;
}

/* En catálogo (loop) alinear a la izquierda */
.products .latbit-price-block {
    align-items: flex-start;
    text-align: left;
}

/* En producto individual: alinear a la izquierda */
.single-product .latbit-price-block {
    align-items: flex-start;
}

/* Ocultar el precio tachado nativo por si algún hook lo inserta */
.latbit-price-block del {
    display: none;
}