/*!
Theme Name: phucthanhan
Theme URI: https://sdn.agency/
Author: SDN Agency
Author URI: https://sdn.agency/
Description: Description
Version: 1.0.0
Tested up to: 5.4
Requires PHP: 5.6
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: phucthanhan
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/
/* Custom Filter Loading Spinner */
#product-grid {
    position: relative;
    min-height: 200px;
}
#product-grid.is-loading::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.7);
    z-index: 10;
}
#product-grid.is-loading::after {
    content: "";
    position: absolute;
    top: 50px;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #c99b38;
    border-radius: 50%;
    animation: ptan-spin 1s linear infinite;
    z-index: 11;
}
@keyframes ptan-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ponytail: parent terms accordion and children styling */
.filter-parent-toggle {
    padding: 0.6rem 0;
    color: #5a3e2b;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.filter-parent-toggle::after {
    content: "▸";
    font-size: 1.2rem;
    color: #c99b38;
    line-height: 1;
    margin-left: 0.6rem;
    display: inline-block;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.filter-item.is-open > .filter-parent-toggle::after {
    transform: rotate(90deg);
}
.filter-children-wrap {
    display: none;
    padding-left: 1.6rem;
    margin-top: 0.8rem;
    margin-left: 0.4rem;
    border-left: 2px solid #e0d5c8;
}
.filter-item.is-open > .filter-children-wrap {
    display: block;
}
.filter-children-wrap .filter-label {
    padding: 0.2rem 0;
}
.filter-parent-toggle .filter-chevron {
    display: none !important;
}

/* ponytail: style for SKU search input in sidebar filter (Soft Gray Block) */
.filter-search-block {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 0.8rem;
    padding: 0 1.6rem;
    box-sizing: border-box;
    transition: all 0.3s ease-in-out;
    border: 1px solid transparent;
}
.filter-search-block:focus-within {
    background-color: #ffffff;
    border-color: #784123;
    box-shadow: 0 0 5px rgba(120, 65, 35, 0.1);
}
.filter-search-block .filter-sku_input {
    flex-grow: 1;
    width: 100%;
    font-size: 1.4rem;
    line-height: 140%;
    color: #1a1a1a;
    background: transparent;
    border: none;
    outline: none;
    padding: 1.2rem 0;
    box-sizing: border-box;
}
.filter-search-block .filter-sku_input::placeholder {
    color: #a0a0a0;
    font-style: italic;
}
.filter-search-block .sku-search-icon {
    width: 1.6rem;
    height: 1.6rem;
    flex-shrink: 0;
    opacity: 0.4;
    transition: opacity 0.3s ease;
    margin-left: 1rem;
}
.filter-search-block:focus-within .sku-search-icon {
    opacity: 0.8;
}

/* ponytail: single-thu-vien layout & floating back button */
.gallery-detail {
    position: relative;
    overflow: hidden;
}
.gallery-detail ._3d-flip-book,
.gallery-detail div[class*="flip-book"],
.gallery-detail .book-widget,
.gallery-detail .full-size,
.gallery-detail iframe {
    height: 100% !important;
}

.thu-vien-back-btn {
    position: absolute;
    top: 2.4rem;
    left: 2.4rem;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.6rem;
    background-color: rgba(245, 245, 245, 0.95);
    color: #1a1a1a;
    border-radius: 0.8rem;
    font-size: 1.4rem;
    font-weight: 500;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.thu-vien-back-btn:hover {
    background-color: #ffffff;
    border-color: #784123;
    color: #784123;
    box-shadow: 0 4px 16px rgba(120, 65, 35, 0.2);
}
.thu-vien-back-btn svg {
    width: 1.6rem;
    height: 1.6rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
@media (max-width: 767px) {
    .thu-vien-back-btn {
        top: 1.6rem;
        left: 1.6rem;
        padding: 0.8rem 1.2rem;
        font-size: 1.2rem;
    }
}

/* ponytail: related section header layout & styling */
.related-heading.flex-row-desktop {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2.4rem;
}
.related-tabs.custom-tabs {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 1rem;
}
.related-tabs.custom-tabs::-webkit-scrollbar {
    display: none;
}
.related-tabs.custom-tabs {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
@media (min-width: 992px) {
    .related-heading.flex-row-desktop {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .related-tabs.custom-tabs {
        width: auto;
        padding-bottom: 0;
    }
}

/* ponytail: center arrows vertically on the sides of the swiper */
.related-swiper .swiper-control.side-controls {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    bottom: auto !important;
    margin: 0 !important;
    height: auto !important;
    z-index: 999 !important;
    pointer-events: none !important;
}
.related-swiper .swiper-control.side-controls .swiper-navigation {
    pointer-events: none !important;
    display: flex !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 0 2rem !important;
    box-sizing: border-box !important;
}
@media (min-width: 1201px) {
    .related-swiper .swiper-control.side-controls .swiper-navigation {
        margin-left: -2.4rem !important;
        width: calc(100% + 4.8rem) !important;
        padding: 0 !important;
    }
}
.related-swiper .swiper-control.side-controls .prev,
.related-swiper .swiper-control.side-controls .next {
    pointer-events: auto !important;
    position: relative !important;
    z-index: 1000 !important;
}

/* ponytail: child filter box highlight flash animation */
@keyframes highlight-flash-animation {
    0% {
        background-color: #f2ebe4;
    }
    100% {
        background-color: transparent;
    }
}
.highlight-flash {
    animation: highlight-flash-animation 1.5s ease-out;
}

/* ponytail: show/hide social buttons based on screen width */
@media screen and (max-width: 576px) {
    .sticky-desktop-only {
        display: none !important;
    }
}
@media screen and (min-width: 577px) {
    .sticky-mobile-only {
        display: none !important;
    }
}

/* ponytail: active state highlight for logos on slider */
.logo-swiper .swiper-slide .logo-img.active {
    outline: 2px solid #784123;
    outline-offset: 4px;
    background-color: #f7f3ee;
    border-color: #784123;
}
