﻿/* =========================
   RESET
========================= */
* {
    box-sizing: border-box;
}

img {
    width: 100%;
    display: block;
}

/* =========================
   HEADER
========================= */
.d-flex.align-items-center.justify-content-around {
    display: flex;
    align-items: center;
    justify-content: space-between !important;
    gap: 20px;
    padding: 12px 24px;
    flex-wrap: wrap;
    background: #1e2235;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.btn-back-home {
    text-decoration: none;
    font-weight: 500;
    color: #fff;
    transition: 0.3s;
}

    .btn-back-home:hover {
        color: #00d2ff;
    }

a[href="/Cart"] {
    text-decoration: none;
    font-weight: 500;
    color: #fff;
}

.cart-count {
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 50%;
    margin-left: 5px;
}

/* =========================
   SEARCH
========================= */
form[asp-action="Search"] {
    display: flex;
    align-items: center;
    gap: 8px;
}

    form[asp-action="Search"] input {
        border-radius: 8px;
        padding: 8px 12px;
    }

    form[asp-action="Search"] button {
        background: #ff0055;
        color: #fff;
        border-radius: 8px;
        padding: 8px 14px;
        transition: 0.3s;
    }

        form[asp-action="Search"] button:hover {
            background: #ff4d4f;
        }

/* =========================
   MAIN LAYOUT
========================= */
.d-flex.mt-4.align-items-start {
    display: flex;
    gap: 24px;
    padding: 0 24px;
}

/* SIDEBAR */
.d-flex.flex-column.col-lg-3 {
    flex: 0 0 280px;
    max-width: 280px;
}

/* CONTENT */
.d-flex.mt-4.align-items-start > div:last-child {
    flex: 1;
}

/* =========================
   CATEGORY
========================= */
.category-wrapper {
    background: #1e2235;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 18px 40px rgba(0,0,0,0.5);
}

.category-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.category-kicker {
    display: inline-block;
    margin-bottom: 0.35rem;
    color: #ff0055;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.category-title {
    margin: 0;
    font-weight: 800;
    color: #fff;
}

.category-intro {
    margin: 0.55rem 0 0;
    color: #a0a5ba;
    font-size: 0.9rem;
    line-height: 1.55;
}

.category-badge {
    min-width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #ff0055 0%, #ff7b00 100%);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 14px 24px rgba(47, 27, 20, 0.18);
}

.category-summary {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.05);
    color: #a0a5ba;
    font-size: 0.82rem;
    font-weight: 600;
}

.category-summary span {
    display: flex;
    align-items: center;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.category-list-shell {
    max-height: 430px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(120, 77, 44, 0.24) transparent;
}

.category-list-shell::-webkit-scrollbar {
    width: 6px;
}

.category-list-shell::-webkit-scrollbar-thumb {
    background: rgba(120, 77, 44, 0.22);
    border-radius: 999px;
}

.category-item {
    margin: 0;
}

.category-link {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 18px;
    text-decoration: none;
    color: #fff;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background-color 0.22s ease;
    background: rgba(0,0,0,0.2);
}

.category-link-all {
    margin-bottom: 12px;
}

.category-icon-shell {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: rgba(0,0,0,0.4);
    color: #ff0055;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

.category-copy {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-copy .name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.4;
    color: inherit;
}

.category-copy small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.78rem;
    color: #a0a5ba;
    line-height: 1.45;
}

.category-link .arrow {
    align-self: center;
    color: #a0a5ba;
    opacity: 0.75;
    transition: transform 0.22s ease, opacity 0.22s ease, color 0.22s ease;
}

.category-link:hover,
.category-link:focus {
    text-decoration: none;
    color: #fff;
    transform: translateY(-2px);
    border-color: #ff0055;
    box-shadow: 0 16px 28px rgba(255,0,85, 0.2);
}

.category-link:hover .arrow,
.category-link:focus .arrow,
.category-link.is-active .arrow {
    transform: translateX(4px);
    opacity: 1;
    color: #fff;
}

.category-link.is-active {
    background: linear-gradient(135deg, #ff0055 0%, #ff7b00 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 18px 34px rgba(47, 27, 20, 0.2);
}

.category-link.is-active .category-copy small {
    color: rgba(255,255,255,0.8);
}

.category-link.is-active .category-icon-shell {
    background: rgba(255, 255, 255, 0.16);
    color: #fff4e6;
}

/* =========================
   SIDEBAR HOT PRODUCT
========================= */
.featured-product-spotlight {
    display: grid;
    gap: 16px;
}

.featured-product-media {
    position: relative;
    overflow: hidden;
    min-height: 220px;
    border-radius: 24px;
    box-shadow: 0 18px 34px rgba(74, 42, 21, 0.14);
}

.featured-product-media img {
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.featured-product-spotlight:hover .featured-product-media img {
    transform: scale(1.04);
}

.featured-product-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 0.48rem 0.9rem;
    border-radius: 999px;
    background: rgba(255,0,85,0.82);
    color: #fff7ef;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    box-shadow: 0 12px 24px rgba(27, 14, 9, 0.2);
    backdrop-filter: blur(10px);
}

.featured-product-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: end;
    justify-content: center;
    padding: 18px;
    background: linear-gradient(180deg, rgba(20, 11, 7, 0.02) 0%, rgba(20, 11, 7, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.featured-product-spotlight:hover .featured-product-overlay {
    opacity: 1;
}

.featured-product-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.05rem;
    border-radius: 999px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 14px 24px rgba(20, 11, 7, 0.22);
}

.featured-product-link:hover,
.featured-product-link:focus {
    color: #fff;
    text-decoration: none;
}

.featured-product-body {
    display: grid;
    gap: 10px;
}

.featured-product-kicker {
    color: #ff0055;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.featured-product-body h3 {
    margin: 0;
    color: #fff;
    font-size: 1.32rem;
    font-weight: 800;
    line-height: 1.25;
}

.featured-product-body p {
    margin: 0;
    color: #a0a5ba;
    font-size: 0.9rem;
    line-height: 1.6;
}

.featured-product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
}

.featured-product-meta strong {
    color: #00d2ff;
    font-size: 1.08rem;
}

.featured-product-meta span {
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: rgba(0,210,255,0.12);
    color: #2a7d2f;
    font-size: 0.74rem;
    font-weight: 700;
}

.featured-product-actions {
    display: grid;
    gap: 10px;
}

.featured-product-action {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 0.92rem;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.featured-product-action:hover,
.featured-product-action:focus {
    transform: translateY(-1px);
}

.featured-product-action-primary {
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    color: #fff;
    box-shadow: 0 16px 28px rgba(47, 27, 20, 0.18);
}

.featured-product-action-primary:hover,
.featured-product-action-primary:focus {
    color: #fff;
}

.featured-product-action-secondary {
    background: #2a3047;
    color: #fff;
    box-shadow: 0 16px 28px rgba(0,0,0, 0.3);
}

.featured-product-action-secondary:hover,
.featured-product-action-secondary:focus {
    color: #fff;
}

.featured-product-buy-form {
    margin: 0;
}

/* =========================
   PRODUCT CARD
========================= */
.product-card {
    border-radius: 16px;
    overflow: hidden;
    transition: 0.3s;
    background: #1e2235;
}

    .product-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 12px 30px rgba(0,0,0,0.1);
    }

/* IMAGE */
.product-img-wrapper {
    position: relative;
    overflow: hidden;
}

    .product-img-wrapper img {
        height: 220px;
        object-fit: cover;
        transition: 0.4s;
    }

.product-card:hover img {
    transform: scale(1.1);
}

/* OVERLAY */
.product-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(35, 21, 18, 0.04) 0%, rgba(35, 21, 18, 0.72) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.3s;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-quick-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.15rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(255, 250, 244, 0.95);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 14px 28px rgba(22, 12, 9, 0.18);
    backdrop-filter: blur(12px);
    transition: transform 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

    .product-quick-view:hover {
        color: #fff;
        background: #2a3047;
        text-decoration: none;
        transform: translateY(-2px);
        box-shadow: 0 16px 34px rgba(22, 12, 9, 0.24);
    }

/* TEXT */
.product-card h6 {
    font-size: 15px;
}

.product-card p {
    font-size: 13px;
}

.price {
    font-weight: bold;
    color: #00d2ff;
}

/* =========================
   QUANTITY
========================= */
.input-group {
    display: flex;
}

.product-quantity-group {
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem;
    border: 1px solid rgba(93, 60, 34, 0.12);
    border-radius: 18px;
    background: #1e2235;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

.product-qty-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 13px;
    background: #2a3047;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(95, 61, 38, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

    .product-qty-btn:hover,
    .product-qty-btn:focus {
        background: #ff0055;
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 12px 20px rgba(53, 33, 29, 0.22);
    }

.product-quantity-group .quantity-input {
    max-width: none;
    flex: 1 1 auto;
    min-width: 56px;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
}

    .product-quantity-group .quantity-input:focus {
        background: transparent;
        box-shadow: none;
        color: #fff;
    }

.quantity-input {
    max-width: 50px;
}

/* =========================
    BUTTON
========================= */
.product-card .d-grid.gap-2 {
    gap: 0.75rem !important;
}

.product-action {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
    border: 1px solid transparent;
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    transition: transform 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

    .product-action:hover,
    .product-action:focus {
        text-decoration: none;
        transform: translateY(-2px);
    }

.product-action-primary {
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    color: #fff;
    box-shadow: 0 14px 26px rgba(47, 27, 20, 0.18);
}

    .product-action-primary:hover,
    .product-action-primary:focus {
        color: #fff;
        box-shadow: 0 16px 30px rgba(47, 27, 20, 0.24);
    }

.product-action-accent {
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    color: #fff;
    box-shadow: 0 14px 28px rgba(218, 159, 91, 0.22);
}

    .product-action-accent:hover,
    .product-action-accent:focus {
        color: #fff;
        box-shadow: 0 16px 32px rgba(218, 159, 91, 0.28);
    }

.product-action-secondary {
    border-color: rgba(93, 60, 34, 0.12);
    background: #2a3047;
    color: #fff;
    box-shadow: 0 10px 22px rgba(95, 61, 38, 0.08);
}

    .product-action-secondary:hover,
    .product-action-secondary:focus {
        background: #3e4766;
        border-color: rgba(218, 159, 91, 0.38);
        color: #fff;
        box-shadow: 0 14px 24px rgba(95, 61, 38, 0.12);
    }

.btn-add-cart {
    border-radius: 16px;
}

/* =========================
   PAGINATION
========================= */
.pagination {
    border-radius: 12px;
    overflow: hidden;
}

.page-link {
    color: #fff;
    border: none;
    padding: 8px 14px;
}

.page-item.active .page-link {
    background: #ff0055;
    color: #fff;
}

.page-link:hover {
    background: #ff4d4f;
    color: #fff;
}

/* =========================
   📱 MOBILE (<576px)
========================= */
@media (max-width: 575px) {

    .d-flex.align-items-center.justify-content-around {
        flex-direction: column;
        align-items: stretch;
    }

    .d-flex.mt-4.align-items-start {
        flex-direction: column;
        padding: 0 12px;
    }

    .d-flex.flex-column.col-lg-3 {
        max-width: 100%;
    }

    .product-img-wrapper img {
        height: 180px;
    }

    .category-header {
        align-items: center;
    }

    form[asp-action="Search"] {
        width: 100%;
    }

        form[asp-action="Search"] input {
            width: 100%;
        }
}

/* =========================
   📲 TABLET
========================= */
@media (min-width: 576px) and (max-width: 991px) {

    .d-flex.mt-4.align-items-start {
        flex-direction: column;
    }

    .d-flex.flex-column.col-lg-3 {
        max-width: 100%;
    }

    .product-img-wrapper img {
        height: 200px;
    }
}

/* =========================
   💻 DESKTOP
========================= */
@media (min-width: 992px) {

    .product-img-wrapper img {
        height: 220px;
    }
}

/* =========================
   🖥️ LARGE SCREEN
========================= */
@media (min-width: 1400px) {

    

    .product-img-wrapper img {
        height: 250px;
    }
}

/* =========================
   FIX LAYOUT GRID
========================= */
.product-layout {
    display: grid;
    grid-template-columns: minmax(290px, 320px) 1fr;
    gap: 30px;
    padding: 0 24px;
}

/* SIDEBAR */
.sidebar {
    width: 100%;
}

.sidebar-stack {
    display: grid;
    gap: 22px;
}

.sidebar-panel {
    position: relative;
}

.sidebar-panel-spotlight {
    padding: 24px;
    border-radius: 28px;
    background: radial-gradient(circle at top right, rgba(244, 208, 154, 0.55), transparent 44%), linear-gradient(180deg, #fff8ef 0%, #f6ebdf 100%);
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 22px 40px rgba(67, 42, 27, 0.08);
}

.sidebar-spotlight-head {
    margin-bottom: 18px;
}

.sidebar-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.8rem;
    border-radius: 999px;
    background: rgba(59, 34, 21, 0.08);
    color: #8a5b3c;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-spotlight-head h2 {
    margin: 0.9rem 0 0.4rem;
    color: #fff;
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.15;
}

.sidebar-spotlight-head p {
    margin: 0;
    color: #a0a5ba;
    font-size: 0.94rem;
    line-height: 1.55;
}

/* =========================
   FIX PRODUCT GRID (QUAN TRỌNG)
========================= */
.products-grid.row.g-4 {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
}

    /* bỏ bootstrap column bó width */
    .products-grid.row.g-4 > div {
        width: 100% !important;
        max-width: 100% !important;
    }

/* =========================
   CARD FIX ĐỀU
========================= */
.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .product-card .card-body {
        display: flex;
        flex-direction: column;
    }

    .product-card p {
        min-height: 40px;
    }

/* =========================
   MOBILE
========================= */
@media (max-width: 768px) {

    .product-layout {
        grid-template-columns: 1fr;
        padding: 0 12px;
    }

    .sidebar-stack {
        gap: 18px;
    }

    .sidebar-panel-spotlight {
        padding: 18px;
    }

    .featured-product-media,
    .featured-product-media img {
        min-height: 200px;
    }
}

/* =========================
   MÀN TO (FIX HẸP)
========================= */
@media (min-width: 1400px) {

    .products-grid.row.g-4 {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}
