/**
 * Fresh Air - Global Product Card Styles
 * Applies to all WooCommerce product displays across the site
 * Including: Shop, Category pages, Related products, Upsells, etc.
 */

/* ===== BASE PRODUCT CARD ===== */
.products .product,
.woocommerce ul.products li.product,
ul.products li.product,
.product-small,
.product-small.box,
.product-small.box-normal {
    background: #ffffff !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 2px solid transparent !important;
    margin-bottom: 1.5rem !important;
}

.products .product:hover,
.woocommerce ul.products li.product:hover,
ul.products li.product:hover,
.product-small:hover,
.product-small.box:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 15px 35px rgba(46, 204, 113, 0.15) !important;
    border-color: #2ecc71 !important;
}

/* ===== PRODUCT IMAGE ===== */
.products .product .box-image,
.product-small .box-image,
.woocommerce ul.products li.product .box-image,
ul.products li.product .attachment-woocommerce_thumbnail,
.product-small .product-image {
    background: linear-gradient(180deg, #f8fffe 0%, #ffffff 100%) !important;
    border-radius: 16px 16px 0 0 !important;
    overflow: hidden !important;
    position: relative !important;
}

.products .product img,
.product-small img.attachment-woocommerce_thumbnail,
.woocommerce ul.products li.product img,
ul.products li.product img {
    padding: 1rem !important;
    transition: transform 0.4s ease !important;
    object-fit: contain !important;
}

.products .product:hover img,
.product-small:hover img,
ul.products li.product:hover img {
    transform: scale(1.05) !important;
}

/* ===== PRODUCT INFO/TEXT ===== */
.products .product .box-text,
.product-small .box-text,
.woocommerce ul.products li.product .box-text,
ul.products li.product .woocommerce-loop-product__title {
    padding: 1.25rem !important;
    background: #ffffff !important;
    text-align: left !important;
}

/* ===== CATEGORY LABEL ===== */
.products .product .category,
.product-small .category,
.woocommerce ul.products li.product .category,
.product-small .box-text .category,
ul.products li.product .posted_in {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: #2ecc71 !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
}

.product-small .category a,
.products .product .category a {
    color: #2ecc71 !important;
    text-decoration: none !important;
}

/* ===== PRODUCT TITLE ===== */
.products .product .product-title,
.products .product .woocommerce-loop-product__title,
.product-small .product-title,
.product-small .name,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
ul.products li.product h2 {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #2c3e50 !important;
    line-height: 1.4 !important;
    margin: 0 0 0.75rem !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.products .product .product-title a,
.product-small .product-title a,
.product-small .name a,
ul.products li.product h2 a {
    color: #2c3e50 !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

.products .product .product-title a:hover,
.product-small .product-title a:hover,
.product-small .name a:hover,
ul.products li.product h2 a:hover {
    color: #2ecc71 !important;
}

/* ===== PRICE ===== */
.products .product .price,
.product-small .price,
.woocommerce ul.products li.product .price,
ul.products li.product .price {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: #27ae60 !important;
    margin: 0 !important;
}

.products .product .price del,
.product-small .price del {
    color: #95a5a6 !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
}

.products .product .price ins,
.product-small .price ins {
    text-decoration: none !important;
    color: #e74c3c !important;
}

/* ===== ADD TO CART / VIEW BUTTON ===== */
.products .product .add_to_cart_button,
.products .product .button,
.product-small .add_to_cart_button,
.product-small .button.product_type_simple,
.woocommerce ul.products li.product .button,
ul.products li.product .button,
.product-small .quick-view {
    background: #2ecc71 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 0.6rem 1.5rem !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    text-transform: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3) !important;
}

.products .product .add_to_cart_button:hover,
.products .product .button:hover,
.product-small .add_to_cart_button:hover,
.product-small .button.product_type_simple:hover,
.product-small .quick-view:hover {
    background: #27ae60 !important;
    transform: scale(1.05) !important;
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4) !important;
}

/* ===== SALE BADGE ===== */
.products .product .onsale,
.product-small .onsale,
.woocommerce span.onsale,
ul.products li.product .onsale {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    color: #ffffff !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    padding: 0.4rem 0.8rem !important;
    border-radius: 8px !important;
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    z-index: 10 !important;
    line-height: 1 !important;
    min-height: auto !important;
    min-width: auto !important;
}

/* ===== PRODUCT FOOTER (Price + Button container) ===== */
.product-small .box-text .price-wrapper,
.product-small .box-text .add-to-cart-button {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 1rem !important;
}

/* ===== FLATSOME SPECIFIC OVERRIDES ===== */
/* Product box shadows and borders */
.product-small.box {
    border: none !important;
}

.product-small.box .box-text {
    border: none !important;
    border-radius: 0 0 16px 16px !important;
}

/* Hover icons (quick view, wishlist) */
.product-small .image-tools,
.products .product .image-tools {
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.product-small:hover .image-tools,
.products .product:hover .image-tools {
    opacity: 1 !important;
}

.product-small .image-tools .quick-view,
.product-small .image-tools a {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #2c3e50 !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

.product-small .image-tools .quick-view:hover,
.product-small .image-tools a:hover {
    background: #2ecc71 !important;
    color: #ffffff !important;
}

/* ===== RELATED PRODUCTS & UPSELLS (FLATSOME) ===== */
/* Main container */
.related.products,
.upsells.products,
.cross-sells {
    padding: 2rem 0 !important;
    background: #f8faf9 !important;
    margin-top: 2rem !important;
}

.related.products>h2,
.upsells.products>h2,
.cross-sells>h2 {
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    color: #2c3e50 !important;
    margin-bottom: 1.5rem !important;
}

/* Product row/slider container */
.related.products .product-row,
.upsells.products .product-row,
.cross-sells .product-row,
.related.products .row,
.upsells.products .row {
    gap: 1.5rem !important;
}

/* Individual product cards in related section */
.related.products .product-small,
.upsells.products .product-small,
.cross-sells .product-small,
.related.products ul.products li.product,
.upsells.products ul.products li.product,
.cross-sells ul.products li.product,
.product-row .product-small {
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden !important;
    border: 2px solid transparent !important;
    transition: all 0.35s ease !important;
    margin: 0 0.5rem 1rem !important;
}

.related.products .product-small:hover,
.upsells.products .product-small:hover,
.cross-sells .product-small:hover,
.product-row .product-small:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 15px 35px rgba(46, 204, 113, 0.15) !important;
    border-color: #2ecc71 !important;
}

/* Product image in related */
.related.products .product-small .box-image,
.upsells.products .product-small .box-image,
.cross-sells .product-small .box-image,
.product-row .product-small .box-image {
    background: linear-gradient(180deg, #f8fffe 0%, #ffffff 100%) !important;
    border-radius: 16px 16px 0 0 !important;
    overflow: hidden !important;
}

.related.products .product-small .box-image img,
.upsells.products .product-small .box-image img,
.cross-sells .product-small .box-image img,
.product-row .product-small .box-image img {
    padding: 0.5rem !important;
    border-radius: 16px 16px 0 0 !important;
}

/* Product info box in related */
.related.products .product-small .box-text,
.upsells.products .product-small .box-text,
.cross-sells .product-small .box-text,
.product-row .product-small .box-text {
    background: #ffffff !important;
    padding: 1.25rem !important;
    border-radius: 0 0 16px 16px !important;
    text-align: left !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
}

/* Category in related */
.related.products .product-small .category,
.upsells.products .product-small .category,
.product-row .product-small .category {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: #2ecc71 !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 0.25rem !important;
}

.related.products .product-small .category a,
.product-row .product-small .category a {
    color: #2ecc71 !important;
    text-decoration: none !important;
}

/* Title in related */
.related.products .product-small .name,
.related.products .product-small .product-title,
.upsells.products .product-small .name,
.product-row .product-small .name {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #2c3e50 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.related.products .product-small .name a,
.product-row .product-small .name a {
    color: #2c3e50 !important;
    text-decoration: none !important;
}

.related.products .product-small .name a:hover,
.product-row .product-small .name a:hover {
    color: #2ecc71 !important;
}

/* Price in related */
.related.products .product-small .price,
.upsells.products .product-small .price,
.product-row .product-small .price {
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    color: #27ae60 !important;
    margin: 0.25rem 0 0 !important;
}

/* Add button container for related products */
.related.products .product-small .box-text::after,
.upsells.products .product-small .box-text::after,
.product-row .product-small .box-text::after {
    content: 'Xem' !important;
    display: inline-block !important;
    background: #2ecc71 !important;
    color: #ffffff !important;
    padding: 0.5rem 1.5rem !important;
    border-radius: 50px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    text-align: center !important;
    margin-top: 0.75rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3) !important;
    width: fit-content !important;
}

.related.products .product-small .box-text:hover::after,
.upsells.products .product-small .box-text:hover::after,
.product-row .product-small .box-text:hover::after {
    background: #27ae60 !important;
    transform: scale(1.05) !important;
}

/* Hide existing buttons that may conflict */
.related.products .product-small .add_to_cart_button,
.upsells.products .product-small .add_to_cart_button,
.product-row .product-small .add_to_cart_button {
    display: none !important;
}

/* Slider navigation arrows */
.related.products .flickity-prev-next-button,
.upsells.products .flickity-prev-next-button,
.product-row .flickity-prev-next-button {
    background: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
}

.related.products .flickity-prev-next-button:hover,
.upsells.products .flickity-prev-next-button:hover,
.product-row .flickity-prev-next-button:hover {
    background: #2ecc71 !important;
}

.related.products .flickity-prev-next-button:hover svg,
.upsells.products .flickity-prev-next-button:hover svg,
.product-row .flickity-prev-next-button:hover svg {
    fill: #ffffff !important;
}

/* Box styling fix */
.related.products .product-small.box,
.upsells.products .product-small.box,
.product-row .product-small.box {
    border: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
}

/* UX Builder row elements */
.row.slider-row .product-small,
.slider .product-small {
    background: #ffffff !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    margin: 0 0.5rem !important;
}


/* ===== ANIMATIONS ===== */
@keyframes freshCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.products .product,
.product-small {
    animation: freshCardFadeIn 0.5s ease forwards;
}

/* Staggered animation for grid items */
.products .product:nth-child(1) {
    animation-delay: 0.05s;
}

.products .product:nth-child(2) {
    animation-delay: 0.1s;
}

.products .product:nth-child(3) {
    animation-delay: 0.15s;
}

.products .product:nth-child(4) {
    animation-delay: 0.2s;
}

.products .product:nth-child(5) {
    animation-delay: 0.25s;
}

.products .product:nth-child(6) {
    animation-delay: 0.3s;
}

.products .product:nth-child(7) {
    animation-delay: 0.35s;
}

.products .product:nth-child(8) {
    animation-delay: 0.4s;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {

    .products .product .box-text,
    .product-small .box-text {
        padding: 1rem !important;
    }

    .products .product .product-title,
    .product-small .product-title,
    .product-small .name {
        font-size: 0.9rem !important;
    }

    .products .product .price,
    .product-small .price {
        font-size: 1rem !important;
    }

    .products .product .add_to_cart_button,
    .product-small .add_to_cart_button {
        padding: 0.5rem 1rem !important;
        font-size: 0.8rem !important;
    }
}

/* ===== FLATSOME SHOP PAGE SPECIFIC FIXES ===== */
/* Target the shop page product cards specifically */
.products.row .product-small.col,
.products.row .product-small.col.has-hover,
.woocommerce-page .products .product-small {
    background: #ffffff !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.35s ease !important;
    border: 2px solid transparent !important;
    /* Removed padding: 0 to allow grid gutter */
    margin-bottom: 30px !important;
    /* Increased vertical gap */
}

/* Ensure horizontal gap in row */
.products.row {
    margin-left: -15px !important;
    margin-right: -15px !important;
}

.products.row .col {
    padding-left: 15px !important;
    padding-right: 15px !important;
    padding-bottom: 15px !important;
}

.products.row .product-small.col:hover,
.products.row .product-small.col.has-hover:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 15px 35px rgba(46, 204, 113, 0.15) !important;
    border-color: #2ecc71 !important;
}

/* Inner box container */
.products.row .product-small .product-small.box,
.products.row .product-small.box {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    border-radius: 16px !important;
    overflow: hidden !important;
}

/* Box image in shop page */
.products.row .product-small .box-image,
.woocommerce-page .product-small .box-image {
    background: linear-gradient(180deg, #f8fffe 0%, #ffffff 100%) !important;
    border-radius: 16px 16px 0 0 !important;
    overflow: hidden !important;
    position: relative !important;
}

.products.row .product-small .box-image img {
    border-radius: 16px 16px 0 0 !important;
    padding: 0.5rem !important;
    transition: transform 0.4s ease !important;
}

.products.row .product-small:hover .box-image img {
    transform: scale(1.05) !important;
}

/* Box text in shop page */
.products.row .product-small .box-text,
.products.row .product-small .box-text-products,
.woocommerce-page .product-small .box-text {
    background: #ffffff !important;
    padding: 1.25rem !important;
    border-radius: 0 0 16px 16px !important;
    text-align: left !important;
    position: relative !important;
}

/* Product name in shop page */
.products.row .product-small .name.product-title,
.products.row .product-small .product-title,
.woocommerce-page .product-small .name {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #2c3e50 !important;
    line-height: 1.4 !important;
    margin-bottom: 0.5rem !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.products.row .product-small .name a,
.products.row .product-small .product-title a {
    color: #2c3e50 !important;
    text-decoration: none !important;
}

.products.row .product-small .name a:hover,
.products.row .product-small .product-title a:hover {
    color: #2ecc71 !important;
}

/* Price wrapper in shop page */
.products.row .product-small .price-wrapper,
.woocommerce-page .product-small .price-wrapper {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 0.5rem !important;
    padding-top: 0.75rem !important;
    border-top: 1px solid #ecf0f1 !important;
}

.products.row .product-small .price,
.woocommerce-page .product-small .price {
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    color: #27ae60 !important;
}

/* Add "Xem" button to shop page cards */
.products.row .product-small .price-wrapper::after,
.woocommerce-page .products .product-small .price-wrapper::after {
    content: '👁 Xem' !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    background: #2ecc71 !important;
    color: #ffffff !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: 50px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3) !important;
    text-decoration: none !important;
}

.products.row .product-small .price-wrapper:hover::after,
.woocommerce-page .products .product-small .price-wrapper:hover::after {
    background: #27ae60 !important;
    transform: scale(1.05) !important;
}

/* Make the whole price-wrapper clickable area */
.products.row .product-small .price-wrapper {
    position: relative !important;
}

/* Category archive pages */
.woocommerce.archive .products .product-small,
.tax-product_cat .products .product-small {
    background: #ffffff !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    border: 2px solid transparent !important;
}

.woocommerce.archive .products .product-small:hover,
.tax-product_cat .products .product-small:hover {
    transform: translateY(-8px) !important;
    border-color: #2ecc71 !important;
}

/* Fix for nested product-small */
.product-small .product-small.box {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* ===== SHORTCODE SIDEBAR STYLING ===== */
.fresh-filter-wrapper-widget .fresh-filter-sidebar {
    width: 100% !important;
    box-shadow: none !important;
    padding: 0 !important;
    border: none !important;
}

#secondary .widget {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}