/* Yawei Text Pic Component */
.yawei-text-pic {
    background-color: var(--bg-color);
}

.yawei-text-pic-block {
    padding: 80px 100px;
    background-color: transparent;
}

/* ADD compensated max-width for this component's .container at various breakpoints */
/* Based on Bootstrap standard container widths + compensation for new overlap */

@media (min-width: 992px) {
    .yawei-text-pic-block .container {
        max-width: 1004px; /* Generic LG default 960px + 17px compensation */
    }
    .yawei-text-pic-block .col-md-6 {
        max-width: 52.2%;
        flex: 0 0 52.2%;
    }
}

@media (min-width: 1200px) and (max-width: 1500px){
    .yawei-text-pic-block .container {
        max-width: 1192px; /* Generic XL default 1140px + 22px compensation */
    }
    .yawei-text-pic-block .col-md-6 {
        max-width: 52.3%;
        flex: 0 0 52.3%;
    }
}

@media (min-width: 1280px)  {
    .yawei-text-pic-block .container {
        max-width: 1254px; /* Generic 1280px default 1200px + 24px compensation */
    }
}

@media (min-width: 1500px) {
    .yawei-text-pic-block .container {
        max-width: 1820px; /* Generic 1500px default 1440px + 31px compensation */
    }
    .yawei-text-pic-block .col-md-6 {
        max-width: 52.4%;
        flex: 0 0 52.4%;
    }
}
@media (max-width: 1920px) {
    .yawei-text-pic-block .container {
        
        max-width: 1820px; /* Generic 1500px default 1440px + 31px compensation */
    }
}

/* Section Header */
.yawei-text-pic-block .section-header {
    margin-bottom: 40px;
}

.yawei-text-pic-block .section-title {
    font-family: var(--title-font-family);
    font-size: 40px;
    font-weight: 700;
    color: #333333; /* Darker color for title on light gray background */
    text-transform: uppercase;
    letter-spacing: -0.025em; /* Adjusted letter spacing */
    line-height: 1.15;
    margin: 0;
}

/* Product Matrix Grid */
.yawei-text-pic-block .product-matrix-grid .row {
    /* no-gutters class in HTML handles padding, ensure items can touch */
    overflow: hidden; /* Helps manage shifted elements */
    justify-content: space-around;
}

.yawei-text-pic-block .product-matrix-item {
    height: 100%;
    /* Removed margin-bottom, as columns will handle spacing or it might not be needed */
}

/* Specific column adjustments for overlap/meeting edges */
.yawei-text-pic-block .product-matrix-item-right-column {
    margin-left: calc(-5.625% + 10px); /* Original -7.5% reduced by 1/4, 10px gap remains */
}

.yawei-text-pic-block .product-image-container {
    position: relative;
    height: 100%;
    background: transparent; /* Container itself is transparent */
    overflow: hidden; /* Important for clip-path to work well with hover effects */
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Product Image Wrapper - This gets the clip-path */
.yawei-text-pic-block .product-image-wrapper {
    position: relative;
    width: 100%;
    min-height: 590px; /* Base height */
    overflow: hidden;
    background: #e0e0e0; /* Fallback background for image area */
    transition: transform 0.3s ease;
}

.yawei-text-pic-block .product-matrix-item-left .product-image-wrapper {
    clip-path: polygon(0% 0%, 100% 0%, 88.75% 100%, 0% 100%); /* Angle increased, 100% - 11.25% = 88.75% */
}

.yawei-text-pic-block .product-matrix-item-right .product-image-wrapper {
    clip-path: polygon(11.25% 0%, 100% 0%, 100% 100%, 0% 100%); /* Angle increased */
}

.yawei-text-pic-block .product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    z-index: 0;
    transition: transform 0.3s ease; /* Add transition here for smooth scaling */
}

.yawei-text-pic-block .product-image-container:hover .product-image {
    transform: scale(1.05); /* Image scales to 1.05x on hover, content remains static */
}

/* Product Content - Overlay */
.yawei-text-pic-block .product-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 30px 35px; /* Increased padding slightly */
    background: transparent;
    text-align: center;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-height: auto;
    box-sizing: border-box;
}

.yawei-text-pic-block .product-title {
    font-family: var(--font-family);
    font-size: 24px;
    font-weight: 400;
    line-height: 1.3;
    margin: 0 0 15px 0;
    text-align: center;
    color: #101115;
}

/* Explore Button Base - common styles */
.yawei-text-pic-block .explore-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--title-font-family);
    font-size: 16px;
    line-height: 21px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 7px 42px;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    background: transparent;
    color: #333333;
    border: 1px solid #000;
}

/* Unified Hover style for the button when the BUTTON ITSELF is hovered */
.yawei-text-pic-block .explore-btn:hover {
    /* Hover style: like previous explore-btn-left */
    background: #e6002d;
    color: #ffffff;
    border-color: #e6002d;
}

/* Responsive Design - simplified, slant percentages remain constant */
@media (max-width: 1200px) {
    .yawei-text-pic-block .section-title {
        font-size: 40px;
    }
    .yawei-text-pic-block .product-title {
        font-size: 20px;
    }
    .yawei-text-pic-block .explore-btn {
        font-size: 15px;
        padding: 9px 26px;
    }
    .yawei-text-pic-block .product-image-wrapper {
        min-height: 400px;
    }
}

@media (max-width: 991px) {
    /* Switched to 991px for Bootstrap md breakpoint */
    .yawei-text-pic-block {
        padding: 50px 0;
    }
    .yawei-text-pic-block .section-header {
        margin-bottom: 40px;
    }
    .yawei-text-pic-block .section-title {
        font-size: 32px;
    }
    .yawei-text-pic-block .product-image-wrapper {
        min-height: 320px;
    }
    .yawei-text-pic-block .product-content {
        padding: 25px 30px;
    }
    .yawei-text-pic-block .product-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    .yawei-text-pic-block .explore-btn {
        font-size: 14px;
        padding: 8px 24px;
    }

    /* Stack columns on medium and below */
    .yawei-text-pic-block .product-matrix-item-left-column,
    .yawei-text-pic-block .product-matrix-item-right-column {
        flex: 0 0 100%;
        max-width: 100%;
        margin-left: 0 !important; /* Reset margin for stacking */
    }
    .yawei-text-pic-block .product-matrix-item-left .product-image-wrapper,
    .yawei-text-pic-block .product-matrix-item-right .product-image-wrapper {
        aspect-ratio: 579/358;
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%) !important; /* Reset to rectangle when stacked */
        margin-bottom: 24px; /* Add space between stacked items */
    }
    .yawei-text-pic-block .product-matrix-item-right .product-image-wrapper:last-child {
        margin-bottom: 0;
    }
   
}

@media (max-width: 767px) {
    /* Bootstrap sm breakpoint */
    .yawei-text-pic-block {
        padding: 40px 0;
    }
    .yawei-text-pic-block .section-title {
        font-size: 20px;
    }
    .yawei-text-pic-block .product-image-wrapper {
        min-height: 280px;
    }
    .yawei-text-pic-block .product-content {
        padding: 20px 25px;
    }
    .yawei-text-pic-block .product-title {
        font-size: 18px;
    }
    .yawei-text-pic-block .explore-btn {
        font-size: 13px;
        padding: 7px 22px;
    }
}

@media (max-width: 575px) {
    /* Bootstrap xs breakpoint */
    .yawei-text-pic-block .section-title {
        font-size: 20px;
    }
    .yawei-text-pic-block .product-image-wrapper {
        min-height: 240px;
    }
    .yawei-text-pic-block .product-content {
        padding: 15px 20px;
    }
    .yawei-text-pic-block .product-title {
        font-size: 12px;
    }
    .yawei-text-pic-block .explore-btn {
        font-size: 12px;
        padding: 6px 20px;
    }
}

@media (min-width: 768px) {
  .product-matrix-item-right .product-image-wrapper {
    clip-path: polygon(15% 0, 100% 0, 100% 100%, 0% 100%);
  }
}
