/* ===== CAROUSEL STYLING ===== */

.kingsmart-carousel {
    margin: 30px auto;
    position: relative;
    max-width: 92%;
}

.kingsmart-carousel .swiper-slide {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 15px;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    transition: box-shadow 0.3s ease;
}

.kingsmart-carousel .swiper-slide:hover {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* ===== SHARED PRODUCT BLOCKS ===== */

.product-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.product-title {
    font-size: 15px;
    font-weight: bold;
    line-height: 1.3em;
    height: 2.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 10px 0;
}

.product-price {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 10px;
}

.product-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
}

.product-buttons a {
    display: inline-block;
    width: 48%;
    text-align: center;
}

.product-buttons img {
    width: 100%;
    height: auto;
    max-height: 40px;
    object-fit: contain;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

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

/* ===== SWIPER ARROWS ===== */
.swiper-button-prev,
.swiper-button-next {
    top: 50%;
    width: 36px;
    height: 36px;
    background-color: white;
    border: 2px solid #ccc;
    transform: translateY(-50%);
    z-index: 10;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.swiper-button-prev {
    left: -70px;
}

.swiper-button-next {
    right: -70px;
}

.swiper-button-prev::after,
.swiper-button-next::after {
    font-size: 20px;
    color: #333;
}

@media (max-width: 768px) {
    .swiper-button-prev,
    .swiper-button-next {
        display: none !important;
    }
}


/* ===== GRID LAYOUT ===== */

.kingsmart-grid {
    display: grid !important;
    gap: 20px;
    margin: 30px auto;
    max-width: 1200px;
    width: 100%;
}

/* Desktop columns */
.kingsmart-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}
.kingsmart-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}
.kingsmart-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}
.kingsmart-grid.columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* Grid item */
.kingsmart-grid .grid-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 15px;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: box-shadow 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.kingsmart-grid .grid-item:hover {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* ✅ Mobile & tablet: luôn 2 cột */
@media (max-width: 1024px) {
    .kingsmart-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ❌ Xoá đoạn ép về 1 cột để luôn 2 cột cho mọi thiết bị */
