
:root {
    --blue: #2c5f8a;
    --blue-dark: #1e3f5c;
    --accent: #e8a020;
    --aside-bg: #eef2f7;
    --main-bg: #f9fafb;
    --border: #cdd8e3;
    --text: #2c3e50;
    --text-muted: #6b7c93;
    --radius: 8px;
}

/* —— Header: logo trái, menu giữa, đăng nhập phải —— */
.site-header {
      margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
    background: var(--blue-dark);
    border-radius: 0 0 10px 10px;
    box-sizing: border-box;
}

.header-logo a,
.header-nav a,
.header-auth a {
    display: inline-block;
    padding: 13px 16px;
    color: #c8daea;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.header-logo a:hover,
.header-nav a:hover,
.header-auth a:hover {
    background: var(--accent);
    color: #fff;
}

.header-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
}

.header-logo {
    flex-shrink: 0;
}

.header-auth {
    flex-shrink: 0;
}

/* —— Thanh tìm kiếm & lọc full width —— */
.search-bar {
    max-width: 1200px;
    margin: 16px auto 0;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
}

.search-bar-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
    background: #fff;
}

.search-bar input:focus {
    border-color: var(--blue);
}

.aside-left h3 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--blue);
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--accent);
}

.aside-left ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.aside-left ul li {
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    color: var(--text-muted);
}

.aside-left ul li:last-child {
    border-bottom: none;
}

/* —— Lưới: sidebar + sản phẩm —— */
.layout {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 16px 24px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: start;
    box-sizing: border-box;
}

.aside-left {
    background: var(--aside-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.product-main {
    min-width: 0;
    background: var(--main-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* —— Thẻ lật 3D —— */
.card {
    perspective: 1000px;
    height: 360px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.65s ease;
    transform-style: preserve-3d;
}

.card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    box-sizing: border-box;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.card-back {
    transform: rotateY(180deg);
}

.card-front .card-img-wrap {
    flex-shrink: 0;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    background: #e8edf3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-front h3 {
    margin: 12px 0 auto;
    font-size: 1rem;
    text-align: center;
    line-height: 1.35;
    color: var(--text);
}

.card-back .card-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text);
}

.card-back .card-details p {
    margin: 0;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
}

.card-actions button {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.card-actions .btn-cart {
    background: var(--aside-bg);
    color: var(--blue-dark);
    border: 1px solid var(--border);
}

.card-actions .btn-cart:hover {
    background: #e2e8f0;
}

.card-actions .btn-buy {
    background: var(--accent);
    color: #fff;
}

.card-actions .btn-buy:hover {
    filter: brightness(1.05);
}

.no-results {
    grid-column: 1 / -1;
    margin: 0;
    padding: 2rem 1rem;
    text-align: center;
    font-size: 1rem;
    color: var(--text-muted);
    background: #fff;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.addaction {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.addaction .btn-title {
    background: var(--text-muted);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.addaction .btn-title:hover {
    filter: brightness(1.05);
}


.hidden {
    display: none !important;
}

body.detail-open {
    overflow: hidden;
}

.detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(12, 21, 32, 0.7);
    padding: 24px;
    overflow: auto;
}

.detail-page {
    max-width: 1100px;
    margin: 0 auto;
    background: #fff;
    border: 2px solid #1f2937;
    border-radius: 12px;
    padding: 20px;
}

.detail-close {
    margin-bottom: 16px;
    border: 1px solid var(--border);
    background: #f3f4f6;
    color: var(--text);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
}

.detail-top {
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 16px;
}

.detail-left {
    border: 2px solid #1f2937;
    border-radius: 10px;
    padding: 12px;
}

.detail-image-wrap {
    border: 2px solid #1f2937;
    border-radius: 10px;
    overflow: hidden;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
}

.detail-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.detail-actions button {
    flex: 1;
    border-radius: 8px;
    padding: 10px 12px;
    border: none;
    cursor: pointer;
}

.detail-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-info,
.detail-summary {
    border: 2px solid #1f2937;
    border-radius: 10px;
    padding: 12px;
    min-height: 130px;
}

.detail-info p,
.detail-summary p {
    margin: 0 0 8px;
}

.suggest-title {
    text-align: center;
    margin: 20px 0 12px;
}

.suggest-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}

.suggest-card {
    border: 2px solid #1f2937;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggest-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.suggest-card h4 {
    margin: 0;
    font-size: 0.92rem;
    min-height: 42px;
}

@media (max-width: 768px) {
    .detail-top {
        grid-template-columns: 1fr;
    }
}