/**
 * Catálogo y Tienda WooCommerce — Rediseño Premium a Código Puro (v1)
 * Tucumascotas / Metodología Crecienta
 */

/* ==========================================================================
   1. CONTENEDOR PRINCIPAL Y LIMPIEZA
   ========================================================================== */
.post-type-archive-product .site-content,
.tax-product_cat .site-content {
    background-color: #f8fafc;
    padding-bottom: 70px;
}

/* Ocultar elementos obsoletos / residuales de WooCommerce o Astra */
.post-type-archive-product .page-title,
.tax-product_cat .page-title,
.post-type-archive-product .page-description,
.tax-product_cat .page-description,
.post-type-archive-product .ast-woocommerce-container > .entry-header {
    display: none !important;
}

/* ==========================================================================
   2. HERO COMERCIAL DE TIENDA Y CATEGORÍAS
   ========================================================================== */
.tucu-catalog-hero {
    background: linear-gradient(135deg, #2b1055 0%, #6b2c91 100%);
    color: #ffffff;
    padding: 44px 20px 38px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tucu-catalog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 80% 20%, rgba(209, 64, 224, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.tucu-catalog-hero__container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.tucu-catalog-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.16);
    color: #f3e8ff;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 12px;
}

.tucu-catalog-hero__title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 800;
    margin: 0 0 10px;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.tucu-catalog-hero__desc {
    font-size: 15.5px;
    color: #e9d5ff;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ==========================================================================
   3. BARRA DE CHIPS / FILTROS DE CATEGORÍAS
   ========================================================================== */
.tucu-catalog-bar-wrapper {
    background: #ffffff;
    border-bottom: 1px solid #edf2f7;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    position: sticky;
    top: 60px;
    z-index: 40;
}

.tucu-catalog-bar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox */
}

.tucu-catalog-bar-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.tucu-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    color: #475569;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.tucu-cat-chip:hover {
    color: #6b2c91;
    border-color: #d8b4fe;
    background: #fbf6ff;
}

.tucu-cat-chip.is-active {
    background: #6b2c91;
    border-color: #6b2c91;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(107, 44, 145, 0.25);
}

.tucu-cat-chip--promo {
    border-color: #fdba74;
    color: #c2410c;
    background: #fff7ed;
}

.tucu-cat-chip--promo:hover {
    background: #ffedd5;
    border-color: #fb923c;
    color: #9a3412;
}

/* ==========================================================================
   4. BARRA DE HERRAMIENTAS (RESULTADOS Y ORDENAMIENTO)
   ========================================================================== */
.tucu-catalog-toolbar {
    max-width: 1200px;
    margin: 24px auto 20px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.woocommerce-result-count {
    margin: 0 !important;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    color: #64748b;
}

.woocommerce-ordering {
    margin: 0 !important;
}

.woocommerce-ordering select.orderby {
    height: 42px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background-color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.woocommerce-ordering select.orderby:focus {
    border-color: #6b2c91;
    box-shadow: 0 0 0 3px rgba(107, 44, 145, 0.12);
}

/* ==========================================================================
   5. LAYOUT DE CATÁLOGO CON SIDEBAR IZQUIERDO Y PRODUCTOS
   ========================================================================== */
.post-type-archive-product .site-main,
.tax-product_cat .site-main,
.post-type-archive-product .ast-woocommerce-container,
.tax-product_cat .ast-woocommerce-container,
.post-type-archive-product #primary,
.tax-product_cat #primary,
.post-type-archive-product .site-content > .ast-container,
.tax-product_cat .site-content > .ast-container,
.tc-wc-main {
    max-width: 1240px !important;
    margin: 0 auto !important;
    padding: 10px 20px 50px !important;
    width: 100% !important;
}

.tucu-catalog-layout {
    display: flex !important;
    align-items: flex-start !important;
    gap: 30px !important;
    width: 100% !important;
    margin-top: 20px !important;
}

/* Sidebar Izquierdo Sticky */
.tucu-catalog-sidebar {
    width: 270px !important;
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 130px !important;
    z-index: 30 !important;
    transition: all 0.25s ease !important;
}

.tc-sidebar-inner {
    background: #ffffff !important;
    border: 1.5px solid #edf2f7 !important;
    border-radius: 20px !important;
    padding: 22px 18px !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 22px !important;
}

.tc-sidebar-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-bottom: 12px !important;
    border-bottom: 1.5px solid #f1f5f9 !important;
}

.tc-sidebar-title {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    color: #1e293b !important;
}

.tc-sidebar-reset-btn {
    font-family: 'Outfit', sans-serif !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    color: #ef4444 !important;
    background: #fef2f2 !important;
    border: 1px solid #fee2e2 !important;
    border-radius: 6px !important;
    padding: 3px 8px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}

.tc-sidebar-reset-btn:hover {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

.tc-sidebar-close-mobile {
    display: none !important;
    background: none !important;
    border: none !important;
    font-size: 20px !important;
    color: #64748b !important;
    cursor: pointer !important;
}

/* Widgets del Sidebar */
.tc-sidebar-widget {
    display: flex !important;
    flex-direction: column !important;
}

.tc-sidebar-widget-title {
    font-family: 'Outfit', sans-serif !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    color: #64748b !important;
    margin: 0 0 10px 0 !important;
}

/* Buscador en Sidebar */
.tc-sidebar-search-input-wrap {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
}

.tc-sidebar-search-field {
    width: 100% !important;
    height: 40px !important;
    padding: 0 38px 0 12px !important;
    border-radius: 10px !important;
    border: 1.5px solid #e2e8f0 !important;
    background: #f8fafc !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    outline: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.tc-sidebar-search-field:focus {
    border-color: #6b2c91 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(107, 44, 145, 0.12) !important;
}

.tc-sidebar-search-submit {
    position: absolute !important;
    right: 8px !important;
    background: none !important;
    border: none !important;
    color: #64748b !important;
    cursor: pointer !important;
    padding: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.tc-sidebar-search-submit:hover {
    color: #6b2c91 !important;
}

/* Lista de Categorías en Sidebar */
.tc-sidebar-cat-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.tc-sidebar-cat-item a {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    color: #475569 !important;
    text-decoration: none !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.tc-sidebar-cat-item a:hover {
    background: #f8fafc !important;
    color: #6b2c91 !important;
}

.tc-sidebar-cat-item.is-active a {
    background: #f3e8ff !important;
    color: #6b2c91 !important;
    font-weight: 800 !important;
}

.tc-cat-name {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.tc-cat-count {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #94a3b8 !important;
    background: #f1f5f9 !important;
    padding: 2px 7px !important;
    border-radius: 20px !important;
}

.tc-sidebar-cat-item.is-active .tc-cat-count {
    background: #6b2c91 !important;
    color: #ffffff !important;
}

/* Marcas en Sidebar */
.tc-sidebar-brand-chips {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
}

.tc-brand-chip {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 5px 10px !important;
    border-radius: 8px !important;
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #475569 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}

.tc-brand-chip:hover {
    border-color: #6b2c91 !important;
    color: #6b2c91 !important;
    background: #faf5ff !important;
}

.tc-brand-chip.is-active {
    background: #6b2c91 !important;
    border-color: #6b2c91 !important;
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(107, 44, 145, 0.2) !important;
}

.tc-brand-chip-remove {
    font-size: 10px !important;
    opacity: 0.85 !important;
}

/* Accesos a Servicios */
.tc-sidebar-service-links {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

.tc-service-link {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    background: #fff7ed !important;
    border: 1px solid #fed7aa !important;
    color: #c2410c !important;
    text-decoration: none !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    transition: all 0.2s ease !important;
}

.tc-service-link:hover {
    background: #ffedd5 !important;
    border-color: #fb923c !important;
}

/* Columna de Productos de WooCommerce */
.tucu-catalog-content {
    flex: 1 !important;
    min-width: 0 !important;
}

/* Botón Móvil de Filtros */
.tc-mobile-filter-bar {
    display: none;
    margin-bottom: 16px;
    width: 100%;
}

.tc-mobile-filter-btn {
    width: 100%;
    height: 46px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.tc-filter-btn-badge {
    background: #6b2c91;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 20px;
    text-transform: uppercase;
}

/* ==========================================================================
   6. GRILLA Y TARJETAS DE PRODUCTO (CARDS)
   ========================================================================== */
ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 22px !important;
    list-style: none !important;
    margin: 0 0 40px !important;
    padding: 0 !important;
}

/* Reset de flotados antiguos de WooCommerce */
ul.products::before,
ul.products::after {
    display: none !important;
}

ul.products li.product {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    background: #ffffff;
    border: 1.5px solid #edf2f7;
    border-radius: 18px;
    padding: 20px 18px 18px;
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    overflow: hidden;
}

ul.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 28px rgba(107, 44, 145, 0.08);
    border-color: #d8b4fe;
}

/* Badge de Oferta (Sale) */
ul.products li.product span.onsale {
    position: absolute;
    top: 14px;
    left: 14px;
    right: auto;
    margin: 0;
    min-height: auto;
    min-width: auto;
    line-height: normal;
    background: linear-gradient(135deg, #ff6b00 0%, #ff8533 100%) !important;
    color: #ffffff !important;
    font-family: 'Outfit', sans-serif !important;
    font-weight: 800 !important;
    font-size: 11.5px !important;
    padding: 4px 10px !important;
    border-radius: 50px !important;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(255, 107, 0, 0.3);
}

/* Contenedor y enlace de imagen */
ul.products li.product a.woocommerce-LoopProduct-link {
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: inherit;
    flex-grow: 1;
}

ul.products li.product a.woocommerce-LoopProduct-link img {
    height: 190px !important;
    width: 100% !important;
    object-fit: contain !important;
    margin: 0 auto 16px !important;
    transition: transform 0.3s ease;
}

ul.products li.product:hover a.woocommerce-LoopProduct-link img {
    transform: scale(1.05);
}

/* Título de Producto */
ul.products li.product .woocommerce-loop-product__title {
    font-family: 'Outfit', sans-serif !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    line-height: 1.35 !important;
    margin: 0 0 12px !important;
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

ul.products li.product:hover .woocommerce-loop-product__title {
    color: #6b2c91 !important;
}

/* Precios */
ul.products li.product .price {
    font-family: 'Outfit', sans-serif !important;
    font-size: 17.5px !important;
    font-weight: 800 !important;
    color: #6b2c91 !important;
    display: flex !important;
    align-items: baseline;
    gap: 8px;
    margin: auto 0 16px !important;
}

ul.products li.product .price del {
    color: #94a3b8 !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
}

ul.products li.product .price ins {
    color: #d140e0 !important;
    font-weight: 900 !important;
    text-decoration: none !important;
}

/* Botón Añadir al carrito */
ul.products li.product .button,
ul.products li.product a.add_to_cart_button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 42px !important;
    background: linear-gradient(135deg, #ff6b00 0%, #ff8533 100%) !important;
    color: #ffffff !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 13.5px !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
    text-decoration: none !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.22) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    margin-top: auto !important;
}

ul.products li.product .button:hover,
ul.products li.product a.add_to_cart_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 107, 0, 0.35) !important;
}

/* Estado añadido (View cart) */
ul.products li.product .added_to_cart {
    display: block !important;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    color: #10b981;
    text-decoration: underline;
    margin-top: 8px;
}

/* ==========================================================================
   6. PAGINACIÓN MODERNA
   ========================================================================== */
nav.woocommerce-pagination {
    margin: 40px 0 20px;
    display: flex;
    justify-content: center;
}

nav.woocommerce-pagination ul {
    display: flex !important;
    gap: 8px !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

nav.woocommerce-pagination ul li {
    border: none !important;
    margin: 0 !important;
}

nav.woocommerce-pagination ul li a,
nav.woocommerce-pagination ul li span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 14px !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #475569 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}

nav.woocommerce-pagination ul li a:hover {
    border-color: #6b2c91 !important;
    color: #6b2c91 !important;
    background: #fbf6ff !important;
}

nav.woocommerce-pagination ul li span.current {
    background: #6b2c91 !important;
    border-color: #6b2c91 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(107, 44, 145, 0.25) !important;
}

/* ==========================================================================
   7. RESPONSIVE MOBILE & TABLET
   ========================================================================== */
@media (max-width: 960px) {
    .tc-mobile-filter-bar {
        display: block !important;
    }

    .tucu-catalog-layout {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .tucu-catalog-sidebar {
        display: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(15, 23, 42, 0.6) !important;
        backdrop-filter: blur(4px) !important;
        z-index: 99999 !important;
        padding: 20px !important;
        overflow-y: auto !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .tucu-catalog-sidebar.is-open {
        display: flex !important;
    }

    .tucu-catalog-sidebar .tc-sidebar-inner {
        width: 100% !important;
        max-width: 420px !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2) !important;
    }

    .tc-sidebar-close-mobile {
        display: block !important;
    }
}

@media (max-width: 640px) {
    ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
    }

    ul.products li.product {
        padding: 14px 12px 14px;
        border-radius: 14px;
    }

    ul.products li.product a.woocommerce-LoopProduct-link img {
        height: 140px !important;
    }

    ul.products li.product .woocommerce-loop-product__title {
        font-size: 13.5px !important;
        min-height: 36px;
    }

    ul.products li.product .price {
        font-size: 15px !important;
    }

    ul.products li.product .button,
    ul.products li.product a.add_to_cart_button {
        height: 36px !important;
        font-size: 12px !important;
        border-radius: 8px !important;
    }

    .tucu-catalog-hero {
        padding: 32px 16px 26px;
    }
}
