/* 
 * 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 {
    height: 260px !important;
    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);
}

/* 5. Product Detail Gallery Fixes */
.product-gallery-slider .slick-slide img {
    border-radius: var(--myshop-border-radius);
    max-height: 500px;
    object-fit: contain;
    background: #f8f9fa;
}

/* Swiper Gallery - Fix Layout & Gaps */
.myshop-main-swiper {
    height: 500px; /* Chiều cao cố định để cân bằng với cột thông tin bên phải */
    background: #f8fafc;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 15px !important; /* Thu hẹp khoảng cách với thumbnails */
}

@media (max-width: 991px) {
    .myshop-main-swiper { height: 400px; } /* Hạ chiều cao trên tablet */
}

@media (max-width: 768px) {
    .myshop-main-swiper { height: auto; aspect-ratio: 1/1; } /* Mobile dùng vuông cho gọn */
}

.myshop-main-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.myshop-thumb-swiper { overflow: hidden; }
.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: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.myshop-main-swiper .swiper-button-next:after, 
.myshop-main-swiper .swiper-button-prev:after { font-size: 16px; font-weight: bold; }
