/* ==========================
   GLOBAL STYLES
========================== */
html, body {
    overflow-x: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #fefefe;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
}

img, iframe, video {
    max-width: 100%;
    height: auto;
}

/* ==========================
   NAVBAR
========================== */
.navbar-brand img {
    max-width: 150px;
    height: auto;
}
.navbar {
    transition: all 0.3s ease;
}
.navbar-nav .nav-link {
    font-weight: 500;
}
.navbar-nav .nav-link:hover {
    color: #0d6efd;
}

/* ==========================
   BUTTONS
========================== */
.btn-outline-primary {
    border-radius: 50px;
    padding: 0.4rem 1.2rem;
    transition: all 0.2s ease;
}
.btn-outline-primary:hover {
    background-color: #0d6efd;
    color: #fff;
}
.btn-primary {
    border-radius: 50px;
    padding: 0.4rem 1.2rem;
}

/* ==========================
   CART OFFCANVAS
========================== */
.offcanvas {
    max-width: 420px;
    width: 100%;
}
.offcanvas-footer a {
    border-radius: 8px;
}

/* ==========================
   FOOTER
========================== */
footer {
    background-color: #f8f9fa;
    font-size: 0.9rem;
    color: #555;
    box-shadow: inset 0 1px 0 rgba(0,0,0,0.05);
}

/* ==========================
   BANNER SEARCH
========================== */
.banner-search-input {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}
.banner-search-input input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
}
.banner-search-input input::placeholder {
    color: #6c757d;
    opacity: 1;
}

/* ==========================
   PRODUCT CARD
========================== */
.card {
    border: none;
    cursor: default;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}
.card img {
    transition: transform 0.3s ease;
}
.card img:hover {
    transform: scale(1.05);
}
.card h6 a {
    color: #212529;
    transition: color 0.2s ease;
}
.card h6 a:hover {
    color: #0d6efd;
    text-decoration: none;
}

/* ==========================
   PRICE + ADD TO CART INLINE
========================== */
.card .d-flex.justify-content-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card .price-left {
    color: #dc3545;
    font-weight: 600;
}
.add-to-cart-btn {
    border-radius: 8px;
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    width: auto;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.add-to-cart-btn:hover {
    background-color: #0b5ed7;
    transform: translateY(-1px);
}

/* ==========================
   BADGES
========================== */
.badge.bg-danger, .badge.bg-warning {
    font-size: 0.75rem;
    padding: 0.35em 0.5em;
    border-radius: 0.5rem;
}
.badge.bg-danger {
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* ==========================
   PRODUCT MODAL / GALLERY
========================== */
#productModal .modal-dialog {
    max-width: 900px !important;
}
.gallery-wrapper {
    position: relative;
    user-select: none;
}
.gallery-main img, #mainProductImg {
    width: 100%;
    height: 60vh;
    object-fit: contain;
    background: #f8f8f8;
    border-radius: 8px;
}
.gallery-arrow {
    position: absolute;
    top: 50%;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    color: white !important;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 30;
}
.left-arrow { left: 10px; }
.right-arrow { right: 10px; }
.gallery-arrow.disabled { opacity: 0.3; cursor: default; }
.thumb-slide-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-top: 8px;
}
.thumb-slide img, #thumbContainer img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    margin-right: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform .2s, border .2s;
    border: 2px solid transparent;
}
#thumbContainer img:hover { transform: scale(1.05); }
#thumbContainer img.active, #thumbContainer img.border-primary { border: 2px solid #0d6efd !important; }

/* ==========================
   PRODUCT TITLE & PRICE
========================== */
.product-title {
    font-size: 1.45rem;
    font-weight: 600;
}
.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #dc3545;
}
.old-price {
    color: #6c757d;
    text-decoration: line-through;
    margin-left: 6px;
}
.product-modal-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ==========================
   CATEGORY FILTER
========================== */
.category-filters {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.category-filters .filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.category-filters .filter-buttons .btn-outline-primary {
    border-radius: 8px;
    font-size: 0.85rem;
    padding: 0.35rem 0.8rem;
}
.category-filters .filter-buttons .btn-outline-primary.active {
    background-color: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}



/* ==========================
   RESPONSIVE
========================== */
@media (max-width: 768px) {
    .banner-search-input { max-width: 90%; padding: 0.4rem 0.8rem; }
    .add-to-cart-btn { font-size: 0.8rem; padding: 0.35rem 0.5rem; }
    .gallery-main img, #mainProductImg { height: 50vh; }
    .gallery-arrow { width: 34px; height: 34px; }
    #thumbContainer img { width: 60px; height: 60px; }
}

@media (max-width: 576px) {
    /* Search form vẫn 1 dòng */
    .category-filters form.d-flex {
        flex-direction: row;
        flex-wrap: nowrap;
    }
    .category-filters form.d-flex .input-group {
        flex-grow: 1;
        min-width: 0;
    }
    .category-filters form.d-flex button {
        flex-shrink: 0;
    }
    /* Filter buttons wrap bình thường */
    .category-filters .filter-buttons {
        flex-wrap: wrap;
    }
    .category-filters .filter-buttons .btn,
    .category-filters .input-group .form-control,
    .category-filters .input-group .btn,
    .category-filters .input-group .input-group-text {
        width: auto;
        margin-bottom: 0;
    }

    #productModal .modal-dialog {
        max-height: 90vh !important;
        margin: 20px auto !important;
        display: flex;
        align-items: center;
    }
    #productModal .modal-content {
        max-height: 90vh !important;
        overflow: hidden;
        border-radius: 14px;
    }
    #productModal .modal-body {
        overflow-y: auto !important;
        padding-bottom: 20px;
    }
}

/* ==========================
   BODY MODAL OPEN
========================== */
body.modal-open {
    overflow: hidden;
}





.search-form .input-group,
.search-form .form-control,
.search-form .btn {
  height: 44px; /* chỉnh theo ý muốn */
}
