﻿.sanpham-container {
    max-width: 1200px;
    margin: 50px auto;
}

/* Header */
.sanpham-title {
    font-weight: 800;
    font-size: 2rem;
    color: #333;
}

.sanpham-hr {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #00c6ff);
    margin: 0 auto 2rem auto;
    border: none;
    border-radius: 5px;
}
.all-sp {
    margin-left: 43%
}
/* Card */
.sanpham-card {
    border: none;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 460px;
    position: relative;
    background: white;
}

    .sanpham-card:hover {
        transform: scale(1.03);
        box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    }

/* Ảnh chiếm 2/3 card */
.sanpham-img-wrapper {
    flex: 2;
    overflow: hidden;
}

.sanpham-img {
    width: auto;
    height: 250px;
    object-fit: cover;
    display: block;
}

/* Nội dung chiếm 1/3 card */
.card-body {
    flex: 1;
}

/* Tiêu đề */
.sanpham-card-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Giới hạn 2 dòng */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4em;
    max-height: 2.8em;
}

.sanpham-card-link {
    text-decoration: none;
    color: #222;
    transition: color 0.2s;
}

    .sanpham-card-link:hover {
        color: #007bff;
        text-decoration: underline;
    }

.sanpham-card-summary {
    display: -webkit-box;
    -webkit-line-clamp: 2;  
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}


.sanpham-card-detail {
    color: #007bff;
    font-size: 0.9rem;
    text-decoration: none;
    font-weight: 500;
}

    .sanpham-card-detail:hover {
        text-decoration: underline;
    }


.slider-btn-area {
    position: absolute;
    text-align: center;
    bottom: 15px;
    width: 100%;
}

.btn-cart {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}
.btn-buy, .btn-all {
    display: inline-block;
    padding: 5px 10px;
    background-color: #007bff;
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 2.7s ease;
}

    .btn-buy:hover {
        background-color: #0056b3;
    }
/* Nút giỏ hàng */
.btn-cart {
    background: #ff9800;
    color: #fff;
    border: 0;
    width: 100%;
    padding:15px;
    font-size:16px;
}


    .btn-cart:hover {
        background: #e68900;
        transform: translateY(-2px); /* nhích lên một chút */
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }

/* Nút mua ngay */
.btn-buy, .btn-all {
    background: #745696;
    color: #fff;
}

    .btn-buy, .btn-all:hover {
        background: #6610f2;
        color: #fff;
        transform: scale(1.05); /* phóng to nhẹ */
        box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    }

/* Style chung cho button - và + */
.qty-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ccc;
    border-radius: 0;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s ease;
}

    /* Hover: đổi màu + bóng mờ */
    .qty-btn:hover {
        background: #e0e0e0;
        transform: scale(1.05);
    }

    /* Active: nhấn xuống */
    .qty-btn:active {
        background: #d6d6d6;
        transform: scale(0.95);
    }

/* Input số lượng */
.qty-input {
    width: 50px;
    height: 40px;
    text-align: center;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    border-left: none;
    border-right: none;
    outline: none;
    font-weight: bold;
}

/* Bo tròn cụm lại */
.quantity {

    overflow: hidden;
}

.rating {
    direction: rtl;
    display: inline-flex;
    font-size: 1.5rem;
}

    .rating input {
        display: none;
    }

    .rating label {
        color: #ddd;
        cursor: pointer;
        padding: 0 3px;
    }

        .rating input:checked ~ label,
        .rating label:hover,
        .rating label:hover ~ label {
            color: #ffc107; /* màu vàng sao */
        }

.box-tabs .nav-link {
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 8px 18px;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
}

    .box-tabs .nav-link:hover {
        background: #f5f5f5;
        color: #e53935;
        transform: translateY(-2px);
        transform: translateY(-2px);
    }

    .box-tabs .nav-link.active {
        background: #e53935;
        color: #fff !important;
        box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    }
/* Overlay toàn màn hình */
/*.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}*/

/* Hộp thông báo */
/*.popup {
    background: rgba(25, 135, 84, 0.85);
    color: #fff;
    padding: 2% 1%;
    border-radius: 12px;
    text-align: center;
    max-width: 25%;
    height: 20%;
    box-sizing: border-box;
}*/

/* Icon tròn xanh */
/*.popup-icon {
    width: 60px;
    height: 60px;
    background: #00c853;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px auto;
    font-size: 2em;
    color: #fff;
}*/

/* Chữ thông báo */
/*.popup-text {
    font-size: 1.5em;
    line-height: 1.4em;
}*/

.overlay1 {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99999;
}

    .overlay1 .popup {
        background: rgba(25, 135, 84, 0.9);
        color: #fff;
        padding: 20px 16px;
        border-radius: 12px;
        text-align: center;
        width: 320px;
        max-width: 90%;
    }
.overlay2 {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99999;
}

    .overlay2 .popup {
        background: rgba(25, 135, 84, 0.9);
        color: #fff;
        padding: 20px 16px;
        border-radius: 12px;
        text-align: center;
        width: 320px;
        max-width: 90%;
    }

.popup-icon {
    width: 60px;
    height: 60px;
    background: #00c853;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px auto;
    font-size: 2em;
    color: #fff;
}

.popup-text {
    font-size: 1.2em;
    line-height: 1.4em;
}

.font-price {
    font-weight: bold;
    color: #53c7ff;
}
/* Responsive nhỏ hơn 480px (mobile) */
@media (max-width: 600px) {
    .overlay1 .popup {
        padding: 8% 5%;
    }

    .popup-icon {
        width: 30px;
        height: 30px;
        font-size: 1.6em;
    }

    .popup-text {
        font-size: 0.8em;
    }
}

/* Tablet (≤ 991px) */
@media (max-width: 991px) {
    .sanpham-card {
        min-height: 420px;
        height: auto;
    }

    .all-sp {
        margin-left: 30%;
    }
    .btn-all {
        margin: 0 auto;

    
    }
    .sanpham-img {
        height: 250px;
        margin: 0 auto;
        display: block;
    }

    .sanpham-card-title {
        font-size: 1rem;
    }
}

/* Mobile nhỏ (≤ 575px) */
@media (max-width: 768px) {
    .sanpham-container{
        width: 100%;
    }
    .sanpham-row {
        display: flex;
        flex-wrap: wrap;
        width:100%;
       margin:auto !important;
    }
    .all-sp {
        margin-left: 32%;
    }
    .sanpham-card-summary {
        font-size: 0.75rem;
        margin: 0px;
    }
        .sanpham-row .col-lg-3, s
        .sanpham-row .col-md-4,
        .sanpham-row .col-sm-6 {
            width: 50%;/* 2 sản phẩm / hàng */
            padding: 0 8px; /* khoảng cách giữa các card */
            box-sizing: border-box;
        }

    .sanpham-card {
        width: 100%; /* full trong col */
        min-height: 360px;
        height: auto;
      
    }

    .sanpham-img {
        height: 200px;
        margin: 0 auto;
        display: block;
    }
    .san
    .sanpham-card-title {
        font-size: 0.95rem;
        text-align: center;
    }
    
    .btn-buy {
        
        padding: 5px;
        width: 80%;
        font-size: 0.6rem;
    }
}
@media (max-width: 370px) {
    .sanpham-row .col-lg-3,
    .sanpham-row .col-md-4,
    .sanpham-row .col-sm-6 {
        width: 100%; /* chỉ 1 sản phẩm / hàng */
        padding: 0 5px;
    }
    .sanpham-card-summary {
        font-size: 0.9rem;
        margin: 0px;
    }
    .all-sp {
        margin-left: 30%;
    }
        .all-sp .btn-all {
            width: 30%;

            padding-left: 5%;
            /*width: 80%;*/
            font-size: 0.8rem;
        }
    .sanpham-card {
        width: 100%;
        min-height: 380px;
        height: auto;
    }

    .sanpham-img {
        height: 220px;
        margin: 0 auto;
    }

    .sanpham-card-title {
        font-size: 0.9rem;
    }

    .btn-buy {
        width: 100%;
        padding: 8px;
        /*width: 80%;*/
        font-size: 0.8rem;
    }
}
.search-sp-page {
    display: flex;
    flex-wrap: nowrap;
    min-height: 100vh;
    background: #fff;
}

/* Sidebar */
.search-sp-sidebar {
    width: 15%; /* bạn có thể đổi 10%, 12%, 15% tùy */
    min-width: 220px;
    background: #f8f9fa;
    border-right: 1px solid #ddd;
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.search-sp-title {
    font-size: 16px;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.search-sp-filter-group {
    margin-bottom: 25px;
}

.search-sp-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.search-sp-select {
    width: 100%;
    font-size: 14px;
}

.search-sp-slider {
    width: 100%;
    accent-color: #007bff;
    cursor: pointer;
}

.search-sp-price-text {
    font-weight: 600;
    color: #007bff;
    text-align: center;
}

/* Nội dung */
.search-sp-content {
    margin-left: 15%; /* bằng với width của sidebar */
    padding: 30px;
    flex: 1;
    background: #fff;
}

.search-sp-breadcrumb {
    list-style: none;
    display: flex;
    gap: 6px;
    font-size: 15px;
    margin-bottom: 20px;
}

    .search-sp-breadcrumb li a {
        color: #007bff;
        text-decoration: none;
    }

    .search-sp-breadcrumb li::after {
        content: "/";
        margin-left: 6px;
        color: #aaa;
    }

    .search-sp-breadcrumb li:last-child::after {
        content: "";
    }

.search-sp-results h4 {
    margin-bottom: 20px;
    font-weight: 600;
}
/* --- CHỈ DÀNH CHO MOBILE (<= 768px) --- */
@media (max-width: 768px) {
    .mobile-slider-v2.owl-carousel {
        display: block !important; /* Owl cần block để tính toán stage */
        margin: 0 auto !important;
    }

    .mobile-slider-v2 .item-slider-v2 {
        width: 100% !important; /* Owl sẽ tự chia 50% dựa trên config JS */
        padding: 0 5px;
    }

    .mobile-slider-v2 .sanpham-card {
        min-height: 350px;
        margin-bottom: 0 !important;
    }

    /* Chỉnh nút bấm nhỏ lại cho mobile */
    .mobile-slider-v2 .btn-buy {
        font-size: 0.7rem;
        padding: 8px 5px;
        width: 100%;
    } .sp-card{
        width:100% !important;
    }
}

/* --- ĐẢM BẢO DESKTOP KHÔNG BỊ ẢNH HƯỞNG --- */
@media (min-width: 769px) {
    #sanpham-slider-mobile .owl-carousel {
        display: flex !important;
        flex-wrap: wrap !important;
    }

    /* Vô hiệu hóa lớp wrapper của Owl trên Desktop */
    #sanpham-slider-mobile .owl-stage-outer,
    #sanpham-slider-mobile .owl-stage {
        display: block !important;
        width: 100% !important;
    }

    #sanpham-slider-mobile .owl-item {
        width: 25% !important; /* 4 sản phẩm/hàng */
        float: left;
    }
   
}