/* === KHỐI BANNER === */
#banner {
    width: 85%; 
    max-width: 100%;
    margin: 15px auto 0;
    position: relative;
}
#banner-close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 22px;
    line-height: 26px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    padding: 0;
}
#banner-close-button:hover {
    background-color: rgba(0, 0, 0, 0.6);
    transform: scale(1.1);
}
#banner.is-hidden {
   display: none;
}
#banner-slider {
    aspect-ratio: 5 / 1; 
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background-color: #eee;
}
#banner-swiper-container img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
}
#banner-swiper-container {
    width: 100%;
    height: 100%;
}
#banner-swiper-container .swiper-pagination-bullet {
    background-color: rgba(255, 255, 255, 0.7);
    width: 10px;
    height: 10px;
    opacity: 1;
}
#banner-swiper-container .swiper-pagination-bullet-active {
    background-color: white;
    transform: scale(1.2);
}

/* === KHỐI SẢN PHẨM === */
/* Ghi chú: Sử dụng khối #product (khối cuối cùng) từ template.php 
   vì đây là phiên bản hoàn thiện nhất, đã có Tailwind. */
:root {
    --ease-out-quint: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out-cubic: cubic-bezier(0.65, 0, 0.35, 1);
}
#product-container {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
    padding: 24px;
    background-color: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}
#product .category-block {
    padding-bottom: 2.5rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid #f3f4f6;
}
#product .category-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
#product .fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out-quint), transform 0.8s var(--ease-out-quint);
}
#product .fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}
#product .subcategory-list{display:flex;gap:.75rem;overflow-x:auto;flex-wrap:nowrap;cursor:grab;-webkit-user-select:none;user-select:none;-ms-overflow-style:none;scrollbar-width:none;}
#product .subcategory-list.is-dragging{cursor:grabbing;}
#product .subcategory-list.is-dragging a{pointer-events:none;}
#product .subcategory-list::-webkit-scrollbar{display:none;}

/* CSS cho subcategory-button (đang bị comment trong template) */
#product .subcategory-button{
    display:inline-block;padding:6px 16px;font-size:14px;font-weight:500;background-color:#f8f9fa;color:#495057;border:1px solid #dee2e6;border-radius:8px;text-decoration:none;white-space:nowrap;
    transition: all 0.4s var(--ease-out-quint);
}
#product .subcategory-button:hover{
    background-color:#e53e3e;color:#fff;border-color:#e53e3e;
    transform: translateY(-3px) scale(1.02);
    box-shadow:0 6px 15px rgba(229,62,62,.25);
}
#product .subcategory-button.subcategory-button--view-all{background-color:#e53e3e;color:#fff;border-color:#e53e3e;flex-shrink:0;}
#product .subcategory-button.subcategory-button--view-all:hover{background-color:#c53030;border-color:#c53030;}

#product .swiper-slide {
    height: auto;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s var(--ease-out-quint), transform 0.6s var(--ease-out-quint);
}
#product .swiper-slide.is-visible {
    opacity: 1;
    transform: translateY(0);
}
#product .product-card {
    height:100%;display:flex;flex-direction:column;width:100%;
    transition: box-shadow 0.4s var(--ease-out-quint), transform 0.4s var(--ease-out-quint);
    border:1px solid #e5e7eb;border-radius:.75rem;overflow:hidden;
}
#product .product-card:hover {
    box-shadow:0 15px 30px -8px rgba(220,38,38,.15),0 10px 10px -8px rgba(220,38,38,.1);
    transform: translateY(-10px);
}
#product .product-card__name{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:40px;line-height:1.4;}
#product .product-card__meta{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;font-size:13px;color:#4a5568;margin-bottom:6px;min-height:18px;}
#product .product-card__price-current{font-size:1.35rem;color:#e53e3e;font-weight:700;}
#product .product-card__price-old{font-size:.85rem;color:#a0aec0;text-decoration:line-through;}
#product .product-card__discount-tag{position:absolute;top:12px;left:-7px;background-image:linear-gradient(to right,#ef4444,#dc2626);color:white;padding:6px 12px;font-size:13px;font-weight:700;z-index:10;line-height:1.2;box-shadow:0 4px 10px rgba(220,38,38,.4);transition:transform .3s var(--ease-out-quint);}
#product .product-card__discount-tag::after{content:'';position:absolute;top:100%;left:0;width:0;height:0;border-top:8px solid #b91c1c;border-left:8px solid transparent;}
#product .product-card__discount-tag:hover{transform:translateX(-3px) scale(1.05);}
#product .swiper-button-next, #product .swiper-button-prev {
    display:flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:50%;background-color:rgba(255,255,255,0.9);color:#4B5563;border:1px solid #e5e7eb;box-shadow:0 2px 5px rgba(0,0,0,.05);
    transition: all 0.4s var(--ease-out-quint);
    cursor:pointer;z-index:10;backdrop-filter: blur(4px);
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}
#product .product-slider-wrapper.slider-ready .swiper-button-next,
#product .product-slider-wrapper.slider-ready .swiper-button-prev {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}
#product .swiper-button-next:hover, #product .swiper-button-prev:hover{background-color:#DC2626;color:#fff;border-color:#DC2626;transform:scale(1.1);}
#product .swiper-button-next::after, #product .swiper-button-prev::after{display:none;}
#product .product-slider-wrapper .swiper-button-prev{left:-1.5rem;}
#product .product-slider-wrapper .swiper-button-next{right:-1.5rem;}
#product .swiper.is-dragging a{pointer-events:none;}
#product .category-header-title{white-space:nowrap;flex-shrink:0;}
#product .category-header{display:flex;justify-content:space-between;align-items:center;flex-wrap:nowrap;gap:1.5rem;margin-bottom:1rem;padding-bottom:.5rem;border-bottom:1px solid #e5e7eb;}
#product .category-header .subcategory-container{display:flex;align-items:center;gap:.5rem;overflow:hidden;min-width:0;}
.skeleton-card {
    border: 1px solid #e5e7eb; border-radius: .75rem; overflow: hidden;
    background-color: #fff;
}
.skeleton-img {
    height: 160px; background-color: #f3f4f6;
}
.skeleton-text {
    height: 16px; background-color: #f3f4f6; border-radius: 4px;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-img, .skeleton-text {
    background-image: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite linear;
}

/* CSS CHO MOBILE */
@media (max-width: 768px) {
    #banner {
        width: 100%;
        height: 100%;
        margin-top: 0;
    }
    #banner-slider {
        aspect-ratio: 5 / 1;
        border-radius: 0;
    }
    #product-container { 
        width: 100%; 
        padding: 16px; 
        border-radius: 0;
    }
    #product .category-header-title { font-size: 1.25rem; }
    #product .product-slider-wrapper .swiper-button-prev { left: 0.5rem; }
    #product .product-slider-wrapper .swiper-button-next { right: 0.5rem; }
}