/* ========================================
   LAYOUT LOJA
======================================== */

.woocommerce-shop .container,
.tax-product_cat .container,
.post-type-archive-product .container {
    width: min(var(--rt-site-container), calc(100% - 40px));
    max-width: none;
    margin: 40px auto;
    padding: 0;
}

.rt-shop-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 18px;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    align-items: flex-start;
}

.rt-shop-sidebar {
    background: #fff;
    border: none;
    padding: 0;
    border-radius: 6px;
    height: fit-content;
}

.rt-shop-products {
    width: 100%;
    min-width: 0;
}

.rt-shop-products .woocommerce-result-count,
.rt-shop-products .woocommerce-ordering {
    margin-bottom: 18px;
}

/* ========================================
   GRID / CARDS
======================================== */

.woocommerce ul.products,
.woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after,
.woocommerce-page ul.products::before,
.woocommerce-page ul.products::after {
    display: none !important;
    content: none !important;
}

/* ========================================
   CARD BASE
======================================== */

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    width: 100% !important;
    min-width: 0;
    height: 430px;
    display: flex !important;
    flex-direction: column;
    background: linear-gradient(145deg, #f1f1f1, #ffffff);
    border: none;
    border-radius: 12px;
    padding: 0;
    position: relative;
    margin: 0 !important;
    float: none !important;
    clear: none !important;
    overflow: hidden;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.18s ease;
}

.woocommerce ul.products li.product:hover,
.woocommerce-page ul.products li.product:hover {
    transform: none;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
}

.woocommerce ul.products li.product a.woocommerce-LoopProduct-link,
.woocommerce-page ul.products li.product a.woocommerce-LoopProduct-link {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    text-decoration: none;
    color: inherit;
}

/* ========================================
   IMAGEM
======================================== */

.woocommerce ul.products li.product img,
.woocommerce-page ul.products li.product img {
    width: 100%;
    height: 230px;
    object-fit: contain;
    margin: 0 auto 12px;
    display: block;
}

/* ========================================
   BADGE OFERTA
======================================== */

.woocommerce ul.products li.product .onsale,
.woocommerce-page ul.products li.product .onsale {
    position: absolute !important;
    top: calc(16px + 230px - 8px) !important;
    left: 16px !important;
    right: auto !important;
    bottom: auto !important;

    width: auto !important;
    max-width: max-content !important;
    min-width: 0 !important;
    height: 24px !important;
    min-height: 0 !important;

    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    background: #ff6a00 !important;
    color: #fff !important;

    padding: 0 10px !important;
    margin: 0 !important;

    border-radius: 4px !important;

    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-align: center;
    white-space: nowrap;

    z-index: 30;
}

/* ========================================
   TÍTULO
======================================== */

.woocommerce-loop-product__title {
    height: 44px;
    overflow: hidden;
    line-height: 1.25;
    color: #111111;
}

/* ========================================
   PREÇO
======================================== */

.woocommerce ul.products li.product .price,
.woocommerce-page ul.products li.product .price {
    margin-top: auto;
    font-weight: bold;
    color: var(--primary);
}

/* ========================================
   BOTÃO
======================================== */

.woocommerce ul.products li.product .button,
.woocommerce-page ul.products li.product .button {
    margin-top: 10px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #000000;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.woocommerce ul.products li.product .button:hover,
.woocommerce-page ul.products li.product .button:hover {
    background: #ff4a00;
    color: #ffffff;
}

/* ========================================
   BADGE / CLASSIFICAÇÃO
======================================== */

.rt-product-condition {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 20;
}

.rt-condition-badge {
    position: relative;
    width: 32px;
    height: 32px;
    background: #000;
    color: #ff4a00;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: bold;
    cursor: default;
}

.rt-condition-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 50%;
    right: calc(100% + 10px);
    transform: translateY(-50%);
    min-width: 190px;
    max-width: 240px;
    padding: 8px 10px;
    background: #000;
    color: #ff4a00;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.3;
    font-weight: bold;
    text-align: left;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 999;
}

.rt-condition-badge::before {
    content: "";
    position: absolute;
    top: 50%;
    right: calc(100% + 4px);
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-style: solid;
    border-color: transparent transparent transparent #000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 1000;
}

.rt-condition-badge:hover::after,
.rt-condition-badge:hover::before {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   FILTROS
======================================== */

.rt-sidebar-block {
    margin-bottom: 24px;
}

.rt-sidebar-block:last-child {
    margin-bottom: 0;
}

.rt-sidebar-block h4 {
    margin-bottom: 8px;
    font-size: 14px;
}

.rt-sidebar-block a {
    display: block;
    padding: 5px 6px;
    margin-bottom: 4px;
    background: transparent;
    color: #000;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.2;
    transition: color 0.2s;
}

.rt-sidebar-block a.active,
.rt-sidebar-block a:hover {
    background: transparent;
    color: #ff6a00;
}

.rt-sidebar-block input {
    width: 100%;
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    color: var(--text);
}

.rt-sidebar-block button {
    width: 100%;
    padding: 8px;
    background: #000;
    color: #ff4a00;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}

.rt-sidebar-block button:hover {
    background: #ff4a00;
    color: #000;
}

/* ========================================
   RESPONSIVO
======================================== */

@media (max-width: 1200px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .woocommerce-shop .container,
    .tax-product_cat .container,
    .post-type-archive-product .container {
        width: min(100% - 24px, 100%);
    }

    .rt-shop-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .woocommerce ul.products li.product,
    .woocommerce-page ul.products li.product {
        height: 400px;
    }

    .woocommerce ul.products li.product img,
    .woocommerce-page ul.products li.product img {
        height: 200px;
    }

    .woocommerce ul.products li.product .onsale,
    .woocommerce-page ul.products li.product .onsale {
        top: calc(16px + 200px - 8px) !important;
        left: 16px !important;
    }
}

@media (max-width: 480px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: 1fr;
    }
}
/* RT Recovery - ajustes finais dos cards */
.woocommerce ul.products li.product .rt-product-condition,
.woocommerce-page ul.products li.product .rt-product-condition {
    top: 0 !important;
    right: 0 !important;
}

.woocommerce ul.products li.product .rt-condition-badge,
.woocommerce-page ul.products li.product .rt-condition-badge {
    border-radius: 0 0 0 6px !important;
}

.woocommerce ul.products li.product .rt-loop-description,
.woocommerce-page ul.products li.product .rt-loop-description {
    font-size: 13px !important;
    line-height: 1.38 !important;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce-page ul.products li.product .button:hover,
.rt-sidebar-block button:hover {
    background: #d94100 !important;
    color: #ffffff !important;
    border-color: #d94100 !important;
    transform: none !important;
}


/* RT Recovery - product category archive must show product cards */
.rt-product-category-page ul.products li.product-category,
.tax-product_cat ul.products li.product-category {
    display: none !important;
}


/* RT Recovery - ajuste real do popup da classificação */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
.rt-shop-products ul.products li.product,
.home ul.products li.product,
.front-page ul.products li.product,
.woocommerce ul.products li.product a,
.woocommerce-page ul.products li.product a,
.woocommerce ul.products li.product .woocommerce-LoopProduct-link,
.woocommerce-page ul.products li.product .woocommerce-LoopProduct-link{
    overflow: visible !important;
}

.woocommerce ul.products li.product .rt-product-condition,
.woocommerce-page ul.products li.product .rt-product-condition,
.rt-shop-products ul.products li.product .rt-product-condition,
.home ul.products li.product .rt-product-condition,
.front-page ul.products li.product .rt-product-condition .rt-product-condition{
    overflow: visible !important;
    z-index: 2000 !important;
}

.woocommerce ul.products li.product .rt-condition-badge,
.woocommerce-page ul.products li.product .rt-condition-badge,
.rt-shop-products ul.products li.product .rt-condition-badge,
.home ul.products li.product .rt-condition-badge,
.front-page ul.products li.product .rt-condition-badge .rt-condition-badge,
.rt-condition-badge{
    overflow: visible !important;
}

.woocommerce ul.products li.product .rt-condition-badge::after,
.woocommerce-page ul.products li.product .rt-condition-badge::after,
.rt-shop-products ul.products li.product .rt-condition-badge::after,
.home ul.products li.product .rt-condition-badge::after,
.front-page ul.products li.product .rt-condition-badge::after .rt-condition-badge::after,
.rt-condition-badge::after{
    top: 40px !important;
    right: calc(100% + 10px) !important;
    transform: none !important;
    z-index: 99999 !important;
}

.woocommerce ul.products li.product .rt-condition-badge::before,
.woocommerce-page ul.products li.product .rt-condition-badge::before,
.rt-shop-products ul.products li.product .rt-condition-badge::before,
.home ul.products li.product .rt-condition-badge::before,
.front-page ul.products li.product .rt-condition-badge::before .rt-condition-badge::before,
.rt-condition-badge::before{
    top: 48px !important;
    right: calc(100% + 4px) !important;
    transform: none !important;
    z-index: 100000 !important;
}


/* RT Recovery - bloco Com base na sua navegação igual aos demais cards */
.rt-related-products,
.rt-navigation-products,
.rt-recommended-products,
.rt-products-you-may-like,
.rt-browsing-based-products{
    width:100% !important;
}

.rt-related-products ul.products,
.rt-navigation-products ul.products,
.rt-recommended-products ul.products,
.rt-products-you-may-like ul.products,
.rt-browsing-based-products ul.products{
    display:grid !important;
    grid-template-columns:repeat(auto-fill,minmax(240px,1fr)) !important;
    gap:20px !important;
}

.rt-related-products li.product,
.rt-navigation-products li.product,
.rt-recommended-products li.product,
.rt-products-you-may-like li.product,
.rt-browsing-based-products li.product{
    height:auto !important;
    min-height:0 !important;
}


/* RT Recovery - recomendações usam exatamente os mesmos cards */
.rt-product-recommendation-section ul.products,
.rt-product-recommendation-grid{
    display:grid !important;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr)) !important;
    gap:24px !important;
}

.rt-product-recommendation-section ul.products li.product,
.rt-product-recommendation-grid li.product{
    background:#fff !important;
    border-radius:12px !important;
    overflow:hidden !important;
    box-shadow:none !important;
    min-height:auto !important;
    height:auto !important;
}

.rt-product-recommendation-section ul.products li.product *,
.rt-product-recommendation-grid li.product *{
    visibility:visible !important;
}

.rt-product-recommendation-section ul.products li.product .button,
.rt-product-recommendation-grid li.product .button{
    display:inline-flex !important;
}
