/* =====================================================
   Kitchen Trending Finishes — Dynamic Component
   ===================================================== */

/* --- CSS Isolation: prevent page styles from bleeding in --- */
.cmp-trending-finishes {
    position: relative;
    /* padding: 40px; */
    padding-right: 0;
    /* padding-left: 40px; */
    margin: 0 auto;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
    color: #232426;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.cmp-trending-finishes *,
.cmp-trending-finishes *::before,
.cmp-trending-finishes *::after {
    box-sizing: border-box;
    font-family: inherit;
}

.cmp-trending-finishes a,
.cmp-trending-finishes a:hover,
.cmp-trending-finishes a:focus,
.cmp-trending-finishes a:visited {
    text-decoration: none;
    color: inherit;
    outline: none;
}

.cmp-trending-finishes button {
   font-family: Archivo;
    line-height: 101%;
color: #8C8E90;
font-size: 18px;
}

.cmp-trending-finishes h2,
.cmp-trending-finishes h4,
.cmp-trending-finishes p {
       font-family: Archivo;
}

.cmp-trending-finishes img {
    border: 0;
    max-width: 100%;
}

/* ----- Header: Title + Arrows ----- */

.cmp-trending-finishes__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-right: 40px;
}

.cmp-trending-finishes__header-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cmp-trending-finishes__title {
    font-size: 32px;
    font-weight: 500;
    color: #232426;
    margin: 0;
    font-family: Archivo;
    line-height: 101%;
}

.cmp-trending-finishes__subtitle {
    font-size: 18px;
    font-weight: 300;
    color: #323232;
    margin: 0;
        font-family: Archivo;
        line-height: 100%;
}

.cmp-trending-finishes__arrows {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
}

.cmp-trending-finishes__arrow {
    width: 64px;
    height: 64px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    color: #232426;
}

.cmp-trending-finishes__arrow:hover {
    background: #f3f3f3;
}

.cmp-trending-finishes__arrow svg {
    width: 20px;
    height: 20px;
}

/* ----- Body: Tabs + Sliders ----- */

.cmp-trending-finishes__body {
    display: flex;
    gap: 30px;
    margin-top: 40px;
}

/* ----- Vertical Tabs (left) ----- */

.cmp-trending-finishes__tabs {
    min-width: 225px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cmp-trending-finishes__tab {
    font-family: inherit;
    font-weight: 600;
    color: #8c8e90;
    padding: 18px 20px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.cmp-trending-finishes__tab:hover {
    color: #555;
}

.cmp-trending-finishes__tab--active {
    border: 1px solid #e6e7eb;
    color: #232426 !important;
    background: #fff;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.08);
}

/* ----- Sliders (right) ----- */

.cmp-trending-finishes__sliders {
        width: calc(100% - 250px);
    overflow: hidden;
}

.cmp-trending-finishes__slider {
    display: none;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    grid-auto-columns: 250px;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    margin-right: 16px;
    max-width: 1800px;
    margin: 0 auto;
}

.cmp-trending-finishes__slider::-webkit-scrollbar {
    display: none;
}

.cmp-trending-finishes__slider--active {
    display: grid;
}

/* ----- Product Card ----- */
.cmp-trending-finishes__card-visual {
    position: relative;
    overflow: hidden;
}

.cmp-trending-finishes__card-hero {
    /* position: absolute; */
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cmp-trending-finishes__card-hero {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s ease, visibility 0.7s ease;
    pointer-events: none;
}
.cmp-trending-finishes__card {
    width: 250px;
    flex-shrink: 0;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.cmp-trending-finishes__card:hover {
    text-decoration: none;
    color: inherit;
}
.cmp-trending-finishes__card-title::after {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  margin-top: 4px; /* spacing between text and arrow */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 7l-10 10'/%3E%3Cpath d='M8 7l9 0l0 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
    left: 5px;
    top: -3px;
    position: relative;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Show on card hover */
.cmp-trending-finishes__card:hover .cmp-trending-finishes__card-title::after {
  opacity: 1;
  visibility: visible;
}
.cmp-trending-finishes__card-visual {
    position: relative;
    width: 100%;
    height: 160px;
    border-radius: 12px;
    overflow: hidden;
}

/* Image 1: Color swatch (hex background) */
.cmp-trending-finishes__card-swatch {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    transition: opacity 0.5s ease;
    animation: trendingCardCarousel 6s ease-in-out !important;
}

/* Image 2: Hero image (auto-carousel via CSS animation) */
.cmp-trending-finishes__card-hero {
    /* position: absolute; */
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    opacity: 0;
    animation: trendingCardCarousel 6s ease-in-out !important;
    /* Hide alt text when image doesn't load */
    color: transparent;
    font-size: 0;
    text-indent: -9999px;
    overflow: hidden;
}

/* Stagger animation so cards don't all flip at the same time */
.cmp-trending-finishes__card:nth-child(2) .cmp-trending-finishes__card-hero { animation-delay: 0.5s; }
.cmp-trending-finishes__card:nth-child(3) .cmp-trending-finishes__card-hero { animation-delay: 1.0s; }
.cmp-trending-finishes__card:nth-child(4) .cmp-trending-finishes__card-hero { animation-delay: 1.5s; }
.cmp-trending-finishes__card:nth-child(5) .cmp-trending-finishes__card-hero { animation-delay: 2.0s; }
.cmp-trending-finishes__card:nth-child(6) .cmp-trending-finishes__card-hero { animation-delay: 0.3s; }
.cmp-trending-finishes__card:nth-child(7) .cmp-trending-finishes__card-hero { animation-delay: 0.8s; }
.cmp-trending-finishes__card:nth-child(8) .cmp-trending-finishes__card-hero { animation-delay: 1.3s; }
.cmp-trending-finishes__card:nth-child(9) .cmp-trending-finishes__card-hero { animation-delay: 1.8s; }
.cmp-trending-finishes__card:nth-child(10) .cmp-trending-finishes__card-hero { animation-delay: 2.3s; }

@keyframes trendingCardCarousel {
    0%, 42%   { opacity: 0; }  /* Show swatch */
    50%, 92%  { opacity: 1; }  /* Show hero image */
    100%      { opacity: 0; }  /* Back to swatch */
}

/* Finish Badge (top-right corner) */
.cmp-trending-finishes__card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #00000080;
    opacity: .7;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    z-index: 2;
    pointer-events: none;
    font-family: Archivo;
    font-style: italic;
}

/* Card Title */
.cmp-trending-finishes__card-title {
    margin: 12px 0 0;
    font-size: 18px;
    font-weight: 500;
    color: #232426;
    line-height: 132%;
    font-family: Archivo;
    display: flex;

}

.cmp-trending-finishes__card-title img{
    display: none;
}

/* =====================================================
   Responsive — Tablet (≤991px)
   ===================================================== */

@media (max-width: 991px) {
    .cmp-trending-finishes {
        padding: 30px;
        padding-right: 0;
    }
 .cmp-trending-finishes__card-title::after {
    opacity: 1;
    visibility: visible;
    width: 20px;
    height: 20px;
    left: 0;
  }

    .cmp-trending-finishes__header {
        padding-right: 30px;
    }

    .cmp-trending-finishes__tabs {
        width: 160px;
        min-width: 160px;
    }

    .cmp-trending-finishes__tab {
        font-size: 16px;
        padding: 16px;
    }

    .cmp-trending-finishes__slider {
        grid-auto-columns: 220px;
    }

    .cmp-trending-finishes__card {
        width: 220px;
    }

    .cmp-trending-finishes__card-visual {
        height: 160px;
    }

    .cmp-trending-finishes__card-hero {
        height: 160px;
    }
}

/* =====================================================
   Responsive — Mobile (≤767px)
   ===================================================== */

@media (max-width: 767px) {
    .cmp-trending-finishes {
        padding: 20px 0;
       
    }

    .cmp-trending-finishes__header {
        padding-right: 0;
        justify-content: center;
    }

    .cmp-trending-finishes__title {
        font-size: 24px;
        text-align: center;
        line-height: 110%;
    }

    .cmp-trending-finishes__subtitle {
        font-size: 14px;
        color: #75787B;
        text-align: center;
        width: 80%;
        margin: 0 auto;
    }
.cmp-trending-finishes__sliders{
    width: 100%;
    padding-left: 16px;
}
    .cmp-trending-finishes__arrows {
        display: none;
    }
.cmp-trending-finishes button{
    font-size: 14px;
    font-weight: 500;
    color: #74798A;
    border: 1px solid #E6E6E8;
}

.cmp-trending-finishes__tab--active {
    color: #000000;
}
    .cmp-trending-finishes__body {
        flex-direction: column;
        gap: 16px;
        margin-top: 20px;
    }

    /* Tabs become horizontal pills */
    .cmp-trending-finishes__tabs {
        width: 100%;
        min-width: 100%;
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        padding-left: 16px;
 
    }
.cmp-trending-finishes__tabs > :last-child{
       margin-right: 16px;
}
    .cmp-trending-finishes__tabs::-webkit-scrollbar {
        display: none;
    }

    .cmp-trending-finishes__tab {
        font-size: 14px;
        padding: 10px 16px;
        white-space: nowrap;
        border: 1px solid transparent;
        border-radius: 9999px;
        text-align: center;
        flex-shrink: 0;
    }

    .cmp-trending-finishes__tab--active {
        background: #fff;
        border-color: #e6e7eb;
        border-radius: 9999px;
    }

    /* Slider: keep 2-row grid, smaller cards */
    .cmp-trending-finishes__slider {
        grid-template-rows: repeat(2, auto);
        grid-auto-columns: 160px;
        gap: 12px;
    }

    .cmp-trending-finishes__card {
        width: 160px;
    }

    .cmp-trending-finishes__card-visual {
        height: 140px;
        border-radius: 3px;
    }
.cmp-trending-finishes__card-swatch{
    border-radius: 3px;
}
    .cmp-trending-finishes__card-hero {
        height: 120px;
        visibility: visible !important;
        opacity: 1 !important;
               height: 94px;
        border-radius: 3px;
        bottom: 0;
        top: unset;
    }

    .cmp-trending-finishes__card-title {
        font-size: 16px;
        margin-top: 8px;
        display: flex;
               gap: 8px;
    }

    .cmp-trending-finishes__card-title img{
       display: block;
       width: 10px;
    }


    .cmp-trending-finishes__tab--active{
        box-shadow: unset;
    }
    .cmp-trending-finishes__card-badge {
        font-size: 12px;
        padding: 2px 8px;
        top: 8px;
        right: 8px;
    }
}



/* Small Desktop / Large Tablet */
@media (min-width: 1024px) and (max-width: 1440px) {
  .cmp-trending-finishes {
    margin-left: 40px;
  }

}

/* Extra Large Desktop */
@media (min-width: 1440px) and (max-width: 1599px) {
  .cmp-trending-finishes {
    margin-left: 5%;
  }

}

/* Full HD Desktop */
@media (min-width: 1600px) and (max-width: 1679px) {
  .cmp-trending-finishes {
    margin-left: 7%;
  }

}

@media (min-width: 1680px) and (max-width: 1900px) {
  .cmp-trending-finishes {
    margin-left: 9.5%;
  }


}

@media (min-width: 1900px) {
  .cmp-trending-finishes {
    margin-left: 14.5%;
  }

}