/**
 * Todo Licencias PTY — Shop / Archive Page Styles
 * Full-width grid, no sidebar, matches live Drupal site
 */

/* ===== HERO BANNER ===== */
.tl-archive-hero {
    background: #418eff; /* azul por defecto (marcas) */
    text-align: center;
    padding: 40px 20px 36px;
    position: relative;
    overflow: hidden;
    margin-top: 0;
}

/* Categorías → cyan, igual al botón POR CATEGORÍA del header */
.tl-archive-hero--category {
    background: #38c1da;
}

/* Marcas → azul, igual al botón POR MARCA del header */
.tl-archive-hero--brand {
    background: #418eff;
}

.tl-archive-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.tl-archive-hero .tl-archive-subtitle {
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    display: block;
    margin-bottom: 6px;
}

.tl-archive-hero h1 {
    color: #ffffff;
    font-size: 30px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    position: relative;
}

/* ===== ARCHIVE CONTENT WRAPPER ===== */
.tl-archive-content {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

/* ===== FILTER BAR ===== */
.tl-archive-filters {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tl-archive-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tl-archive-filter span {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
}

.tl-archive-filter select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.tl-archive-filter select:hover {
    border-color: #428BCA;
}

.tl-archive-results {
    margin-left: auto;
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

/* ===== PRODUCT GRID ===== */
.tl-archive-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* ===== PRODUCT CARD ===== */
.tl-archive-product {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #eee;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: inherit !important;
}

.tl-archive-product:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* ===== PRODUCT IMAGE ===== */
.tl-archive-product-image {
    background: #f5f5f5;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
}

.tl-archive-product-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    display: block;
}

/* ===== OFERTA BADGE ===== */
.tl-badge-offer {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #f7941d, #ff6b35);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* ===== PRODUCT BODY ===== */
.tl-archive-product-body {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tl-archive-product-body h3 {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.45;
    /* Allow wrapping, show up to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* But NO single-line truncation */
    white-space: normal;
    word-wrap: break-word;
}

/* ===== PRICE ===== */
.tl-archive-product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.tl-archive-product-price .price-original {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    font-weight: 500;
}

.tl-archive-product-price .price-current {
    font-size: 16px;
    font-weight: 700;
    color: #f7941d;
}

/* ===== PAGINATION ===== */
.tl-archive-pagination {
    text-align: center;
    margin: 40px 0 10px;
}

.tl-archive-pagination a,
.tl-archive-pagination span {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    transition: all 0.15s;
}

.tl-archive-pagination a:hover {
    background: #f0f0f0;
    border-color: #428BCA;
    color: #428BCA;
}

.tl-archive-pagination .current {
    background: #428BCA;
    color: #fff;
    border-color: #428BCA;
}

.tl-no-products {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 16px;
}

/* ===== PARTNER BADGES ===== */
.tl-partner-badges {
    background: #f8f9fa;
    border-top: 1px solid #eee;
    padding: 24px 20px;
}

.tl-partner-badges-inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.tl-partner-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tl-partner-icon {
    font-size: 28px;
}

.tl-partner-text {
    font-size: 14px;
    color: #555;
    line-height: 1.3;
}

.tl-partner-text strong {
    display: block;
    font-size: 15px;
    color: #333;
}

/* ===== OVERRIDE any WooCommerce defaults leaking through ===== */

/* Hide WC sidebar if it sneaks in */
.woocommerce-sidebar,
.widget-area,
.catalog-sidebar,
aside.catalog-sidebar {
    display: none !important;
}

/* Override WC default product styles */
.woocommerce ul.products,
.woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce ul.products li.product {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Override WC product images */
.woocommerce ul.products li.product a img,
.woocommerce ul.products li.product img {
    object-fit: contain !important;
    width: auto !important;
    height: auto !important;
    max-height: 200px !important;
    margin: 0 auto !important;
}

/* Override WC add to cart button on archive */
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product a.add_to_cart_button {
    display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .tl-archive-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 767px) {
    .tl-archive-hero {
        padding: 24px 16px 20px;
    }

    .tl-archive-hero h1 {
        font-size: 22px;
    }

    .tl-archive-content {
        padding: 16px 12px 30px;
    }

    .tl-archive-filters {
        gap: 12px;
    }

    .tl-archive-results {
        margin-left: 0;
        width: 100%;
    }

    .tl-archive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .tl-archive-product-image {
        padding: 16px;
    }

    .tl-archive-product-body {
        padding: 10px 12px 14px;
    }

    .tl-archive-product-body h3 {
        font-size: 12px;
    }

    .tl-archive-product-price .price-current {
        font-size: 14px;
    }

    .tl-partner-badges-inner {
        flex-direction: column;
        gap: 16px;
    }
}

@media (max-width: 400px) {
    .tl-archive-grid {
        grid-template-columns: 1fr;
    }
}
