/*
 Theme Name:   Ce-LoShop Child
 Theme URI:    https://ce-loshop.com
 Description:  Tema optimizado para Dropshipping (Estilo Temu/DSers) basado en Astra.
 Author:       Antigravity
 Author URI:   https://ce-loshop.com
 Template:     astra
 Version:      1.0.0
*/

/* ========================================================
   OPTIMIZACIÓN PARA DROPSHIPPING (DSers / TMDS)
   ======================================================== */

/* 1. Control de Títulos Kilométricos en la Cuadrícula de Productos */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    height: 2.6em !important;
    color: #333 !important;
    margin-bottom: 10px;
}

/* 2. Resaltar Brutalmente el Precio y el Descuento */
.woocommerce ul.products li.product .price del,
.woocommerce div.product p.price del {
    color: #999;
    font-size: 0.85em;
    font-weight: normal;
    display: inline-block;
    margin-right: 5px;
}
.woocommerce ul.products li.product .price ins,
.woocommerce div.product p.price ins {
    color: #e50014;
    font-size: 1.3em;
    font-weight: 800;
    text-decoration: none;
}

/* 3. Etiqueta de "¡OFERTA!" Extrema */
.woocommerce span.onsale {
    background-color: #e50014;
    color: white;
    font-weight: bold;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    text-transform: uppercase;
    line-height: 1;
    min-height: auto;
    min-width: auto;
    top: 10px;
    left: 10px;
    right: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 4. Estilizar y Ordenar las Variantes (Tallas, Colores) */
.woocommerce-variation-add-to-cart {
  margin-top: 15px;
}
.woocommerce div.product form.cart .variations select {
    width: 100%;
    padding: 10px;
    border: 2px solid #eee;
    border-radius: 5px;
    background-color: #fcfcfc;
    font-weight: bold;
    margin-bottom: 15px;
}
.woocommerce div.product form.cart .variations label {
    font-weight: bold;
    color: #333;
}

/* 5. Urgencia: Estilizar el mensaje de "Pocas unidades en stock" */
.woocommerce div.product p.stock {
    font-size: 14px;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 15px;
}
.woocommerce div.product p.stock.low-in-stock {
    color: #d90000;
    background-color: #fff0f0;
    border: 1px solid #ffdcdc;
}
.woocommerce div.product p.stock.in-stock {
    color: #007c00;
    background-color: #e6f9e6;
}

/* 6. Homogeneizar las imágenes importadas */
.woocommerce ul.products li.product a img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
}

/* 7. Etiquetas de "Envío Gratis" y "Pocas unidades" estilo Temu */
.celoshop-urgency-badge {
  background-color: #fff0f0;
  color: #e02020;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 8px;
  border: 1px solid #ffcdd2;
}

/* 8. Sellos de confianza bajo el botón de compra */
.celoshop-trust-badges {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}
.celoshop-trust-badges img {
  height: 25px;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.celoshop-trust-badges img:hover {
  opacity: 1;
}

/* 9. Ocultar elementos innecesarios (SKU, info de proveedor) */
.sku_wrapper, .celoshop-hide-supplier {
  display: none !important;
}

/* --- TEMPORIZADOR DE OFERTA RELÁMPAGO (Estilo Temu) --- */
.celoshop-flash-sale-timer {
    background: linear-gradient(90deg, #ff3b30, #fb7701);
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(251, 119, 1, 0.25);
    width: fit-content;
    animation: pulse-timer 2s infinite;
}
.celoshop-flash-sale-timer .timer-icon {
    font-size: 1.2rem;
}
.celoshop-flash-sale-timer .timer-boxes {
    background: #ffffff;
    color: #ff3b30;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
@keyframes pulse-timer {
    0% { box-shadow: 0 4px 12px rgba(251, 119, 1, 0.25); }
    50% { box-shadow: 0 4px 18px rgba(255, 59, 48, 0.5); }
    100% { box-shadow: 0 4px 12px rgba(251, 119, 1, 0.25); }
}
@media (max-width: 480px) {
    .celoshop-flash-sale-timer {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    .celoshop-flash-sale-timer .timer-boxes {
        font-size: 1rem;
        padding: 3px 6px;
    }
}

/* --- CHECKOUT ESTILO TEMU (ONE-PAGE OPTIMIZED) --- */
@media (min-width: 769px) {
    .woocommerce-checkout form.checkout {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .woocommerce-checkout .col2-set {
        width: 55%;
    }
    .woocommerce-checkout #order_review_heading,
    .woocommerce-checkout #order_review {
        width: 40%;
    }
    .woocommerce-checkout #order_review {
        position: sticky;
        top: 20px;
        background: #fdfdfd;
        padding: 25px;
        border-radius: 8px;
        border: 1px solid #e1e1e1;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    }
}
.woocommerce form .form-row input.input-text, 
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fcfcfc;
    width: 100%;
}
.woocommerce form .form-row input.input-text:focus, 
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
    border-color: #fb7701 !important;
    box-shadow: 0 0 0 4px rgba(251, 119, 1, 0.15);
    background-color: #ffffff;
    outline: none;
}
.woocommerce form .form-row label {
    font-weight: 600;
    color: #444;
    font-size: 0.9rem;
    margin-bottom: 6px;
    display: block;
}
.woocommerce-checkout #payment {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}
.woocommerce-checkout #payment ul.payment_methods li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}
.woocommerce-checkout #payment ul.payment_methods li:last-child {
    border-bottom: none;
}
#place_order {
    background: linear-gradient(90deg, #fb7701, #ff4500) !important;
    color: #ffffff !important;
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    padding: 20px !important;
    border-radius: 50px !important;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 8px 25px rgba(251, 119, 1, 0.4);
    transition: all 0.3s ease;
    border: none !important;
    margin-top: 15px;
}
#place_order:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(251, 119, 1, 0.5);
    background: linear-gradient(90deg, #ff8c1a, #ff5722) !important;
}
.woocommerce-error, .woocommerce-message {
    border-radius: 8px;
    padding: 15px 20px;
    font-weight: 600;
    border-top: 3px solid;
}
.woocommerce-error { border-top-color: #e2401c; background-color: #fff5f5; }
.woocommerce-message { border-top-color: #00a650; background-color: #f0fff4; }
.woocommerce-checkout .form-row .required {
    display: none;
}
@media (max-width: 768px) {
    .woocommerce-checkout .woocommerce-checkout-review-order {
        position: relative;
        top: 0;
        margin-bottom: 20px;
        padding: 15px;
    }
    #place_order {
        font-size: 1.1rem !important;
        padding: 18px !important;
    }
}

/* --- ESTILO PARA BOTÓN WHATSAPP --- */
.celoshop-whatsapp-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    border-radius: 50px;
    text-align: center;
    box-shadow: 0px 4px 15px rgba(0,0,0,0.25);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    animation: pulse-whatsapp 2s infinite;
}
.celoshop-whatsapp-btn img {
    width: 35px;
    height: 35px;
}
.celoshop-whatsapp-btn:hover {
    transform: scale(1.1);
    animation: none;
}
@keyframes pulse-whatsapp {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* --- DISEÑO GENERAL TIPO TEMU / APP MÓVIL --- */
body {
    background-color: #f5f5f5 !important;
}

/* Redondear todo (estilo moderno) */
.woocommerce ul.products li.product, 
.ast-container {
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Cabecera (Header) naranja y fija */
.site-header, .ast-main-header-wrap {
    background-color: #ffffff;
    border-bottom: 3px solid #fb7701;
    position: sticky;
    top: 0;
    z-index: 9999;
}

/* Barra de búsqueda estilo Marketplace */
.widget_product_search form, .woocommerce-product-search {
    display: flex;
    position: relative;
    width: 100%;
}
.widget_product_search .search-field, .woocommerce-product-search .search-field {
    width: 100%;
    border: 2px solid #fb7701 !important;
    border-radius: 30px !important;
    padding: 12px 20px !important;
    font-size: 1rem;
    outline: none;
}
.widget_product_search button[type="submit"], .woocommerce-product-search button[type="submit"] {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    border-radius: 0 30px 30px 0 !important;
    background-color: #fb7701 !important;
    color: #fff !important;
    padding: 0 25px !important;
    border: none;
    font-weight: bold;
    cursor: pointer;
}

/* Menú de Navegación Inferior (Mobile App Look) */
.celoshop-mobile-nav {
    display: none;
}
@media (max-width: 768px) {
    .celoshop-mobile-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #ffffff;
        box-shadow: 0 -4px 15px rgba(0,0,0,0.08);
        z-index: 99998; /* Justo debajo de whatsapp */
        padding: 10px 0 15px 0; /* Padding extra abajo para iPhones */
        border-top: 1px solid #eee;
    }
    .celoshop-mobile-nav a {
        text-align: center;
        color: #888;
        font-size: 0.75rem;
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        width: 25%;
    }
    .celoshop-mobile-nav a svg {
        width: 22px;
        height: 22px;
        stroke: currentColor;
    }
    .celoshop-mobile-nav a.active {
        color: #fb7701;
    }
    
    /* Levantar el botón de whatsapp para que no tape el menú */
    .celoshop-whatsapp-btn {
        bottom: 90px !important;
    }
}

/* Categorías en forma de burbuja (Para usar en el Home) */
.celoshop-category-bubbles {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 20px 10px;
    scrollbar-width: none; /* Firefox */
}
.celoshop-category-bubbles::-webkit-scrollbar {
    display: none; /* Chrome */
}
.celoshop-category-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    text-decoration: none !important;
}
.celoshop-category-bubble img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fb7701;
    padding: 2px;
    transition: transform 0.2s;
}
.celoshop-category-bubble:hover img {
    transform: scale(1.05);
}
.celoshop-category-bubble span {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #333;
    font-weight: 600;
    text-align: center;
}
