/* 
 * MyShop: Premium Design System
 * Modern, Clean and Dynamic Ecommerce Styling
 */

:root {
    --myshop-primary: #0d6efd;
    --myshop-primary-hover: #0b5ed7;
    --myshop-secondary: #6c757d;
    --myshop-price-color: #dc3545;
    --myshop-card-bg: #ffffff;
    --myshop-border-radius: 12px;
    --myshop-shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --myshop-shadow-md: 0 10px 25px rgba(0,0,0,0.08);
    --myshop-transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 1. Global Reset & Basic Styling */
.myshop-products-block {
    margin: 50px 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* 2. Block Header Styles */
.myshop-block-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.myshop-dynamic-title {
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: -0.5px;
}

.myshop-view-switcher .btn {
    border-radius: 8px;
    padding: 8px 12px;
    margin-left: 5px;
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
    transition: var(--myshop-transition);
}

.myshop-view-switcher .btn.btn-primary {
    background: var(--myshop-primary);
    border-color: var(--myshop-primary);
    color: #fff;
}

.myshop-view-switcher .btn:hover {
    background: #f8f9fa;
    color: var(--myshop-primary);
}

/* 3. Product Card Styling (Grid View) */
.product-item {
    transition: var(--myshop-transition);
}

.news-related-post {
    border: 1px solid #f0f0f0 !important;
    border-radius: var(--myshop-border-radius) !important;
    overflow: hidden;
    background: var(--myshop-card-bg);
    box-shadow: var(--myshop-shadow-sm);
    transition: var(--myshop-transition) !important;
}

.news-related-post:hover {
    transform: translateY(-8px);
    box-shadow: var(--myshop-shadow-md);
    border-color: rgba(13, 110, 253, 0.2) !important;
}

/* Product Image Hover Effects */
.news-related-post .news-thumb {
    object-fit: cover;
    transition: transform 0.6s ease;
    border-bottom: 1px solid #f8f9fa;
}

.news-related-post:hover .news-thumb {
    transform: scale(1.08);
}

.news-related-post a {
    display: block;
    overflow: hidden; /* Important for scale effect */
}

/* Card Body Content */
.news-related-post .card-body {
    padding: 20px !important;
}

.news-related-post .card-title {
    font-size: 1rem !important;
    font-weight: 600 !important;
    line-height: 1.4;
    margin-bottom: 12px !important;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.news-related-post .card-title a {
    color: #333 !important;
    transition: color 0.2s ease;
}

.news-related-post .card-title a:hover {
    color: var(--myshop-primary) !important;
}

.product-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--myshop-price-color) !important;
    margin-bottom: 15px !important;
}

/* Button Styling */
.news-related-post .btn {
    border-radius: 8px !important;
    padding: 10px 15px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0.2px;
    transition: var(--myshop-transition) !important;
    border: none !important;
}

.news-related-post .btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%) !important;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}

.news-related-post .btn-primary:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #084298 100%) !important;
    box-shadow: 0 6px 15px rgba(13, 110, 253, 0.35);
    transform: scale(1.02);
}

/* Nút icon giỏ hàng */
.myshop-product-actions .btn.btn-outline-primary,
.myshop-product-actions .btn.add-to-cart {
    border: 1.5px solid #eee !important;
    background: #f8f9fa !important;
    color: #333 !important;
    border-radius: 10px !important;
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: var(--myshop-transition) !important;
    font-size: 1.1rem !important;
}

.myshop-product-actions .btn.add-to-cart:hover,
.myshop-product-actions .btn.btn-outline-primary:hover {
    border-color: var(--myshop-primary) !important;
    background: #fff !important;
    color: var(--myshop-primary) !important;
    transform: rotate(5deg) scale(1.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.news-related-post .btn-secondary {
    background: #f1f3f5 !important;
    color: #495057 !important;
}

.news-related-post .btn-secondary:hover {
    background: #e9ecef !important;
    color: #212529 !important;
}

/* 4. List View Specific Styles */
.product-list-item {
    border: 1px solid #f0f0f0;
    border-radius: var(--myshop-border-radius);
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--myshop-shadow-sm);
    transition: var(--myshop-transition);
}

.product-list-item:hover {
    transform: translateX(5px);
    box-shadow: var(--myshop-shadow-md);
    border-color: var(--myshop-primary);
}

.product-list-item img {
    border-radius: 8px;
    width: 100%;
    height: 180px !important;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-list-item:hover img {
    transform: scale(1.05);
}

/* Tối ưu Swiper để tránh nhảy Breadcrumb (Layout Shift) */
.tour-main-swiper, .bds-main-swiper, .myshop-main-swiper {
    height: 500px; /* Ép độ cao cố định */
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    contain: paint; 
}

@media (min-width: 768px) {
    .tour-main-swiper, .bds-main-swiper, .myshop-main-swiper {
        min-height: 450px;
    }
}

.tour-main-swiper .swiper-slide img,
.bds-main-swiper .swiper-slide img,
.myshop-main-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fix gap when image is short - remove min-height and use auto */
.myshop-product-gallery-wrapper .myshop-main-swiper,
.product-gallery-wrapper .myshop-main-swiper {
    min-height: auto !important;
    background: transparent;
}

.myshop-product-gallery-wrapper .myshop-main-swiper .swiper-slide,
.product-gallery-wrapper .myshop-main-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Make thumb closer - reduce gap */
.myshop-product-gallery-wrapper .myshop-thumb-swiper,
.product-gallery-wrapper .myshop-thumb-swiper {
    margin-top: 5px !important;
}

.tour-thumb-swiper, .bds-thumb-swiper {
    padding: 10px 0;
}

.tour-thumb-swiper .swiper-slide,
.bds-thumb-swiper .swiper-slide {
    opacity: 0.7; /* Tăng độ sáng mặc định */
    transition: all 0.3s ease;
    cursor: pointer;
    filter: grayscale(20%); /* Thêm chút nghệ thuật */
}

.tour-thumb-swiper .swiper-slide-thumb-active,
.bds-thumb-swiper .swiper-slide-thumb-active {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.05); /* Phóng lớn nhẹ ảnh đang chọn */
}

.tour-thumb-item, .bds-thumb-item {
    border: 2px solid #eee;
    transition: all 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.swiper-slide-thumb-active .tour-thumb-item,
.swiper-slide-thumb-active .bds-thumb-item {
    border-color: var(--myshop-primary) !important;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.2);
}

/* Swiper Navigation Arrows - Premium Look */
.tour-main-swiper .swiper-button-next,
.tour-main-swiper .swiper-button-prev,
.bds-main-swiper .swiper-button-next,
.bds-main-swiper .swiper-button-prev,
.myshop-main-swiper .swiper-button-next,
.myshop-main-swiper .swiper-button-prev {
    color: var(--myshop-primary);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.tour-main-swiper .swiper-button-next:hover,
.tour-main-swiper .swiper-button-prev:hover,
.bds-main-swiper .swiper-button-next:hover,
.bds-main-swiper .swiper-button-prev:hover,
.myshop-main-swiper .swiper-button-next:hover,
.myshop-main-swiper .swiper-button-prev:hover {
    background: var(--myshop-primary);
    color: #fff;
    transform: scale(1.1);
}

.tour-main-swiper .swiper-button-next:after,
.tour-main-swiper .swiper-button-prev:after,
.bds-main-swiper .swiper-button-next:after,
.bds-main-swiper .swiper-button-prev:after {
    font-size: 16px;
    font-weight: bold;
}

/* 6. Load More Button Styling */
.myshop-load-more-btn {
    border-radius: 30px !important;
    padding: 12px 40px !important;
    font-weight: 700 !important;
    background: #fff !important;
    color: var(--myshop-primary) !important;
    border: 2px solid var(--myshop-primary) !important;
    transition: var(--myshop-transition) !important;
}

.myshop-load-more-btn:hover {
    background: var(--myshop-primary) !important;
    color: #fff !important;
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.2);
}

/* 7. Skeleton / Loading Animation */
@keyframes myshop-shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

.myshop-loading {
    animation: myshop-shimmer 1.5s infinite linear;
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 800px 104px;
}

/* 8. Cart & Checkout Styling */
.myshop-cart-item img {
    width: 80px !important;
    height: 100px !important;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    background: #f8fafc;
}

.myshop-checkout-table img {
    width: 60px !important;
    height: 75px !important;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
}

.cart-item-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
    margin-bottom: 5px;
}

.cart-item-variant {
    font-size: 0.85rem;
    color: #64748b;
}

/* --- Premium Stacking Page Transition --- */
body.is-transitioning #content {
    pointer-events: none;
}

#content {
    will-change: transform, opacity;
}

.sacmau-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(100%);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.1);
}

.loader-bar {
    width: 100px;
    height: 3px;
    background: #eee;
    position: relative;
    overflow: hidden;
    border-radius: 3px;
}

.loader-bar::after {
    content: '';
    position: absolute;
    left: -50%;
    width: 50%;
    height: 100%;
    background: var(--myshop-primary);
    animation: loader-running 1.5s infinite ease-in-out;
}

@keyframes loader-running {
    0% { left: -50%; }
    100% { left: 100%; }
}

/* Fix Flash of Unstyled Content */
.js #content {
    opacity: 0;
}

/* Đảm bảo Swiper có khung sẵn để không bị nhảy layout */
.myshop-main-swiper, .tour-main-swiper {
    aspect-ratio: 1/1; /* Hoặc tỷ lệ phù hợp */
    background: #f8f9fa;
}