/* Product detail page - similar products section */
.similar-products-section {
    position: relative;
    margin-top: 3.25rem;
    padding: clamp(2.8rem, 5vw, 4.5rem) 0;
    border-top: 1px solid #E7ECF5;
    border-bottom: 1px solid #E7ECF5;
    background: linear-gradient(180deg, #F6F8FD 0%, #FFFFFF 100%);
}

.similar-products-section .section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 1.6rem;
}

.similar-products-section .section-heading h2 {
    position: relative;
    margin: 0 0 .65rem;
    padding-right: 1rem;
    color: var(--color-text-main);
    font-size: clamp(1.45rem, 2.4vw, 2.05rem);
    font-weight: 900;
    line-height: 1.6;
}

.similar-products-section .section-heading h2::before {
    content: "";
    position: absolute;
    top: .35rem;
    right: 0;
    bottom: .35rem;
    width: 4px;
    border-radius: 10px;
    background: var(--color-primary);
}

.similar-products-section .section-heading p {
    margin: 0;
    color: var(--color-text-light);
    font-size: .93rem;
    line-height: 1.9;
}

.similar-products-section .section-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: .55rem;
    padding: .75rem 1rem;
    border: 1px solid #D9E2F2;
    border-radius: 12px;
    background: #fff;
    color: var(--color-primary);
    font-size: .82rem;
    font-weight: 800;
    text-decoration: none;
    transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}

.similar-products-section .section-link:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

.similar-products-section .products-slider-wrapper {
    padding: 1rem !important;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 24px !important;
    background: rgba(255, 255, 255, .92) !important;
    box-shadow: 0 18px 48px rgba(23, 42, 85, .08) !important;
}

.similar-products-section .home-products-swiper {
    width: 100%;
    height: auto;
    padding: .25rem .25rem 2.35rem;
    border-radius: 18px;
    background: transparent !important;
}

.similar-products-section .home-product-slide {
    display: flex;
    height: auto;
    align-items: stretch;
    padding: .55rem .35rem 1rem;
    background: transparent;
    text-align: right;
    font-size: inherit;
}

.similar-products-section .home-product-card {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #E4E9F2;
    border-radius: 20px;
    background: #fff;
    color: var(--color-text-main);
    text-align: right;
    text-decoration: none !important;
    box-shadow: 0 8px 24px rgba(23, 42, 85, .055);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.similar-products-section .home-product-card:hover {
    transform: translateY(-5px);
    border-color: #C7D5EF;
    box-shadow: 0 18px 38px rgba(23, 42, 85, .13);
}

.similar-products-section .home-product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 18px 18px 0 0;
    background: linear-gradient(145deg, #F7F9FD 0%, #EDF2FB 100%);
}

.similar-products-section .home-product-image img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
    transition: transform .35s ease;
}

.similar-products-section .home-product-card:hover .home-product-image img {
    transform: scale(1.055);
}

.similar-products-section .home-product-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(to top, rgba(23, 42, 85, .52), transparent 70%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

.similar-products-section .home-product-overlay span {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem .8rem;
    border-radius: 999px;
    background: #fff;
    color: var(--color-primary);
    font-size: .75rem;
    font-weight: 800;
}

.similar-products-section .home-product-card:hover .home-product-overlay {
    opacity: 1;
}

.similar-products-section .home-product-content {
    display: flex;
    min-height: 150px;
    flex: 1;
    flex-direction: column;
    padding: 1rem 1rem .9rem;
    background: #fff;
}

.similar-products-section .home-product-title {
    display: -webkit-box;
    min-height: 3.3em;
    margin: 0 0 .65rem;
    overflow: hidden;
    color: var(--color-text-main);
    font-size: .93rem;
    font-weight: 900;
    line-height: 1.8;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    transition: color .2s ease;
}

.similar-products-section .home-product-card:hover .home-product-title {
    color: var(--color-primary);
}

.similar-products-section .home-product-content .text-success {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    margin-top: auto;
    padding: .32rem .6rem;
    border-radius: 999px;
    background: var(--color-primary-light);
    color: var(--color-primary) !important;
    font-size: .76rem;
    font-weight: 800;
    line-height: 1.6;
}

.similar-products-section .home-product-more {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-top: auto;
    padding-top: .75rem;
    border-top: 1px solid #E9EDF4;
    color: var(--color-text-light);
    font-size: .75rem;
    font-weight: 700;
}

.similar-products-section .home-product-more i {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-primary-light);
    color: var(--color-primary);
    transition: transform .2s ease, background .2s ease, color .2s ease;
}

.similar-products-section .home-product-card:hover .home-product-more i {
    transform: translateX(-3px);
    background: var(--color-primary);
    color: #fff;
}

.similar-products-section .swiper-button-next,
.similar-products-section .swiper-button-prev {
    top: 42%;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 8px 20px rgba(23, 42, 85, .18);
}

.similar-products-section .swiper-button-next {
    left: 2px;
}

.similar-products-section .swiper-button-prev {
    right: 2px;
}

.similar-products-section .swiper-button-next::after,
.similar-products-section .swiper-button-prev::after {
    font-size: .85rem;
    font-weight: 900;
}

.similar-products-section .swiper-pagination {
    bottom: 0;
}

.similar-products-section .swiper-pagination-bullet {
    background: #A8B6D2;
    opacity: 1;
}

.similar-products-section .swiper-pagination-bullet-active {
    width: 26px;
    background: var(--color-primary);
    box-shadow: none;
}

@media (max-width: 767.98px) {
    .similar-products-section {
        margin-top: 2.5rem;
        padding: 2.75rem 0;
    }

    .similar-products-section .section-heading {
        display: block;
        margin-bottom: 1.2rem;
    }

    .similar-products-section .section-heading h2 {
        font-size: 1.45rem;
    }

    .similar-products-section .section-heading p {
        font-size: .82rem;
    }

    .similar-products-section .section-link {
        margin-top: 1rem;
        padding: .65rem .85rem;
        font-size: .76rem;
    }

    .similar-products-section .products-slider-wrapper {
        padding: .4rem !important;
        border-radius: 18px !important;
    }

    .similar-products-section .home-products-swiper {
        padding: .35rem .2rem 2.1rem;
    }

    .similar-products-section .home-product-slide {
        padding: .4rem .25rem .8rem;
    }

    .similar-products-section .home-product-card {
        border-radius: 17px;
    }

    .similar-products-section .home-product-image {
        aspect-ratio: 1 / .9;
        border-radius: 16px 16px 0 0;
    }


    .similar-products-section .home-product-content {
        min-height: 136px;
        padding: .8rem;
    }

    .similar-products-section .home-product-title {
        font-size: .82rem;
    }

    .similar-products-section .home-product-overlay {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .similar-products-section .swiper-button-next,
    .similar-products-section .swiper-button-prev {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .similar-products-section *,
    .similar-products-section *::before,
    .similar-products-section *::after {
        transition: none !important;
        animation: none !important;
    }
}


/* Product detail: section shortcuts and expandable long description */
html {
    scroll-behavior: smooth;
}

.product-detail-navigation {
    display: flex;
    align-items: center;
    gap: .45rem;
    width: 100%;
    margin-bottom: 1.5rem;
    padding: 0 0 .9rem;
    overflow-x: auto;
    border-bottom: 1px solid #E5EAF2;
    scrollbar-width: thin;
    scrollbar-color: #C5D1E5 transparent;
    -webkit-overflow-scrolling: touch;
}

.product-detail-navigation .tab-btn,
.product-detail-navigation .product-anchor-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: .5rem;
    min-height: 44px;
    margin: 0;
    padding: .7rem 1rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: #596780;
    font-size: .9rem;
    font-weight: 800;
    line-height: 1.6;
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.product-detail-navigation .tab-btn:hover,
.product-detail-navigation .product-anchor-tab:hover {
    border-color: #DCE5F3;
    background: #F4F7FC;
    color: #223C78;
}

.product-detail-navigation .tab-btn.active-tab {
    border-color: #DCE5F3;
    background: #EAF0FB;
    color: #223C78;
    box-shadow: inset 0 -2px 0 #223C78;
}

.product-detail-navigation .tab-btn i,
.product-detail-navigation .product-anchor-tab i {
    font-size: 1rem;
}

.product-page-anchor {
    scroll-margin-top: 120px;
}

.product-description-card {
    position: relative;
    border: 1px solid #E8EDF5;
    background-color: #F8F9FA;
}

.product-description-content {
    position: relative;
    max-height: none;
    overflow: hidden;
    opacity: 1;
    transition: max-height .65s cubic-bezier(.22, .61, .36, 1), opacity .35s ease;
    overflow-wrap: anywhere;
}

.product-description-content.is-collapsed {
    max-height: 420px;
}

.product-description-content::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 92px;
    background: linear-gradient(to bottom, rgba(248, 249, 250, 0), #F8F9FA);
    content: "";
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.product-description-content.is-collapsed::after {
    opacity: 1;
}

.product-description-content > :last-child {
    margin-bottom: 0;
}

.product-description-actions {
    position: relative;
    z-index: 1;
}

#toggleProductDescription {
    min-width: 154px;
    border: 1px solid #223C78;
    background-color: #223C78;
    color: #fff;
    font-weight: 800;
    box-shadow: 0 5px 14px rgba(34, 60, 120, .16);
    transition: background-color .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}

#toggleProductDescription:hover {
    border-color: #192D5D;
    background-color: #192D5D;
    color: #fff;
    box-shadow: 0 7px 18px rgba(34, 60, 120, .24);
    transform: translateY(-1px);
}

#toggleProductDescription:focus-visible {
    outline: 3px solid rgba(34, 60, 120, .25);
    outline-offset: 3px;
}

#toggleProductDescription:active {
    transform: translateY(0);
}

#toggleProductDescription[hidden] {
    display: none !important;
}

.product-detail-navigation::-webkit-scrollbar {
    height: 4px;
}

.product-detail-navigation::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: #C5D1E5;
}

@media (max-width: 767.98px) {
    .product-detail-navigation {
        gap: .3rem;
        margin-inline: -.25rem;
        width: calc(100% + .5rem);
        padding: 0 .25rem .75rem;
    }

    .product-detail-navigation .tab-btn,
    .product-detail-navigation .product-anchor-tab {
        min-height: 42px;
        padding: .6rem .8rem;
        border-radius: 10px;
        font-size: .82rem;
    }

    .product-description-content.is-collapsed {
        max-height: 340px;
    }

    .product-description-content::after {
        height: 76px;
    }

    .product-page-anchor {
        scroll-margin-top: 95px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .product-detail-navigation *,
    .product-description-content,
    .product-description-content::after,
    #toggleProductDescription {
        transition: none !important;
    }
}


/* Product image gallery: touch/swipe on mobile and thumbnail selection on desktop. */
.pd-product-gallery {
    width: 100%;
    min-width: 0;
}

.pd-gallery-swiper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 420px;
    overflow: hidden;
    border: 1px solid #E7ECF4;
    border-radius: 1rem;
    background: linear-gradient(145deg, #F8FAFD 0%, #EDF2F9 100%);
    touch-action: pan-y;
}

.pd-gallery-swiper .swiper-wrapper,
.pd-gallery-swiper .pd-gallery-slide {
    height: 100%;
}

.pd-gallery-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.pd-gallery-slide > a {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}

.pd-gallery-slide .pd-main-image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    transition: transform .3s ease, opacity .25s ease;
}

.pd-gallery-pagination {
    bottom: 10px !important;
    z-index: 2;
}

.pd-gallery-pagination .swiper-pagination-bullet {
    width: 7px;
    height: 7px;
    background: #A8B6D2;
    opacity: .95;
    transition: width .2s ease, background-color .2s ease;
}

.pd-gallery-pagination .swiper-pagination-bullet-active {
    width: 22px;
    border-radius: 99px;
    background: #223C78;
}

.pd-thumbnails {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.pd-thumbnails .pd-thumb {
    flex: 0 0 80px;
    width: 80px;
    height: 60px;
    border-radius: .75rem;
    border: 2px solid transparent;
    overflow: hidden;
    opacity: .7;
    transition: border-color .2s ease, opacity .2s ease, transform .2s ease;
}

.pd-thumbnails .pd-thumb > a {
    display: block;
    width: 100%;
    height: 100%;
}

.pd-thumbnails .pd-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pd-thumbnails .pd-thumb.active,
.pd-thumbnails .pd-thumb:hover {
    border-color: #223C78;
    opacity: 1;
}

.pd-thumbnails .pd-thumb:hover {
    transform: translateY(-2px);
}

.product-features-placeholder {
    display: block;
    width: 100%;
    height: 0;
    margin: 0;
    padding: 0;
}

.product-mobile-features-target:empty {
    display: none;
}

@media (min-width: 768px) {
    .pd-thumbnails {
        display: flex !important;
    }

    .pd-gallery-pagination {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .pd-gallery-swiper {
        aspect-ratio: 4 / 3;
        max-height: 430px;
        border-radius: 1rem;
    }

    .pd-gallery-slide .pd-main-image {
        padding: .6rem;
    }

    .pd-thumbnails {
        display: none !important;
    }

    .product-features-placeholder {
        display: none;
    }

    .product-mobile-features-target:not(:empty) {
        padding-top: .75rem;
        padding-bottom: 1.25rem;
    }

    .product-mobile-features-target .features-section {
        margin-top: 0;
        padding-top: .5rem !important;
        padding-bottom: .5rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pd-gallery-slide .pd-main-image,
    .pd-gallery-pagination .swiper-pagination-bullet,
    .pd-thumbnails .pd-thumb {
        transition: none !important;
    }
}
