/* Tekno Trailer – Site Overrides
   Use this file for global style tweaks. It is enqueued by the MU plugin. */

/* Starting price (Elementor Product Price widget) on single product pages */
.single-product .elementor-widget-woocommerce-product-price .price {
  font-size: 32px !important;
  line-height: 1.1;
}

/* --- WPCode ID 13061: product comparison css fixes --- */
/* Force show compare bar images */
.woosc-bar-item img {
  display: inline-block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Make compare table images uniform */
#woosc_table .tr-image img {
  width: auto;
  height: 180px; /* adjust this value to your preferred image height */
  object-fit: cover; /* ensures image fits inside the box without distortion */
  display: block;
  margin: 0 auto;
}

/* Consistent layout for image cells */
#woosc_table .tr-image {
  text-align: center;
  vertical-align: middle;
  height: 200px; /* should be slightly taller than the img height */
  overflow: hidden;
}

/* --- WPCode ID 12382: variation price colors --- */
/* Live-updated price shown after choosing variations */
.elementor-widget-woocommerce-product-add-to-cart .single_variation .price,
.elementor-widget-woocommerce-product-add-to-cart .single_variation .price *,
.single-product div.product form.cart .woocommerce-variation-price .price,
.single-product div.product form.cart .woocommerce-variation-price .price * {
  color: #000 !important;
}

/* Sale states (old/new prices) */
.single-product div.product .price del,
.single-product div.product .price ins {
  color: #000 !important;
}

/* Ensure Elementor Products widget is visible in Tabs on mobile */
@media (max-width: 767px) {
    .elementor-widget-tabs .elementor-tab-content .elementor-widget-woocommerce-products {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Custom Cross-sells Layout */
.tekno-cross-sells-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 columns on desktop */
    gap: 15px;
}

.tekno-cross-sell-item {
    display: grid;
    grid-template-columns: 100px 40fr 20fr 25fr; /* Fixed image, proportional rest */
    align-items: center;
    gap: 10px;
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 5px;
    background: #fff;
    min-height: 120px;
}

/* 1. Image: Fixed 100px */
.tekno-cs-image {
    width: 100px;
    height: 100px;
}

.tekno-cs-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

/* 2. Product Name */
.tekno-cs-title {
    font-size: 16px;
    line-height: 1.2;
    font-weight: 600;
    padding-right: 5px;
    overflow: hidden; /* Prevent spillover */
}

.tekno-cs-title a {
    text-decoration: none;
    color: #333;
}

.tekno-cs-title a:hover {
    color: #e60000;
}

/* 3. Price */
.tekno-cs-price {
    font-weight: bold;
    color: #333;
    font-size: 16px;
    white-space: nowrap; /* Keep price on one line if possible */
}

/* 4. Button */
.tekno-cs-action {
    text-align: right;
    min-width: 0; /* Allow flex/grid item to shrink below content size if needed */
}

/* Button Styling */
a.tekno-cs-btn {
    display: inline-block !important;
    white-space: normal !important; /* Allow text to wrap if needed */
    font-size: 11px !important; /* Smaller font */
    padding: 6px 4px !important; /* Smaller padding */
    background-color: #e60000 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 3px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    line-height: 1.1 !important;
    width: 100% !important;
    box-sizing: border-box !important; /* Prevent overflow */
    text-align: center !important;
    margin: 0 !important;
    min-height: 0 !important;
}

a.tekno-cs-btn:hover {
    background-color: #cc0000 !important;
    color: #fff !important;
}

/* Loading state */
a.tekno-cs-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

/* Added checkmark after adding */
a.tekno-cs-btn.added::after {
    font-family: 'WooCommerce';
    content: '\e017';
    margin-left: 5px;
}

/* Hide "View Cart" link */
.tekno-cs-action .added_to_cart {
    display: none !important;
}

/* Mobile Styles */
@media (max-width: 767px) {
    .tekno-cross-sells-grid {
        grid-template-columns: 1fr; /* 1 column on mobile */
        gap: 10px;
    }

    /* Grid layout for mobile item: Image left, Details right */
    .tekno-cross-sell-item {
        display: grid;
        grid-template-columns: 75px 1fr;
        grid-template-areas:
            "image title"
            "image price"
            "image action";
        gap: 5px 15px; /* row-gap col-gap */
        padding: 10px;
        min-height: auto;
        align-items: start;
    }
    
    /* Image Area */
    .tekno-cs-image {
        grid-area: image;
        flex: unset;
        min-width: unset;
        max-width: unset;
        margin: 0;
    }

    .tekno-cs-image img {
        width: 75px;
        height: 75px;
    }
    
    /* Title Area */
    .tekno-cs-title {
        grid-area: title;
        flex: unset;
        padding-right: 0;
        font-size: 14px;
        margin-bottom: 0;
    }
    
    /* Price Area */
    .tekno-cs-price {
        grid-area: price;
        flex: unset;
        font-size: 14px;
        margin: 0;
    }
    
    /* Action Area */
    .tekno-cs-action {
        grid-area: action;
        flex: unset;
        text-align: left;
    }
    
    /* Mobile Button */
    a.tekno-cs-btn {
        width: auto !important;
        display: inline-block !important;
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
    
    /* Show all items (override previous hiding rules if any remain) */
    .tekno-cross-sells-grid .tekno-cross-sell-item:nth-child(n+11) {
        display: grid;
    }

    .tekno-cs-load-more-container {
        display: none;
    }
}

/* Hide load more button on desktop */
@media (min-width: 768px) {
    .tekno-cs-load-more-container {
        display: none;
    }
}
