@property --rotate {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f4f4f4;
}


/* Header */
.canvas {
    background: linear-gradient(to right, #551b6a, #01b2ce); /* tím -> xanh dương */
    background-size: cover;
    background-position: center;
    border-bottom-left-radius: 200px;
    border-bottom-right-radius: 200px;
    position: relative;
    z-index: 1;
}

.header {   
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 40px;

    background-color: transparent;
    
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
}

.header.scrolled,
.header-mobile.scrolled  {
    background: linear-gradient(90deg, rgba(134, 155, 249, 0.4), rgba(102, 198, 255, 0.4));
    backdrop-filter: blur(14px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    margin-left: 20px;
}

.logo {
    width: 50px;
    height: auto;
    border-radius: 50%;
    animation: fadeZoom 1s ease forwards;
}

.dropdown {
    position: relative;
    cursor: pointer;
}

.dropdown-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    font-weight: bold;
    color: white;

}

.icon-down {
    transition: transform 0.3s ease;
}

.dropdown-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    /* background-color: rgba(255, 255, 255, 0.8); */
    /* background: rgba(202, 210, 244, 0.8); */
    background: rgba(68, 96, 132, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 160px;
    z-index: 1000;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    perspective: 600px;
}

.dropdown-menu a {
    opacity: 0;
    transform: rotateX(-90deg);
    animation: dropdown3D 1s forwards;
    animation-delay: calc(var(--i) * 0.1s);
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: rgb(255, 255, 255);
    font-size: 16px;
    transition: background 0.3s, transform 0.3s;
    border-radius: 6px;
    transform-origin: top center;
    font-weight: bold;
}

.dropdown-menu a:hover {
    background: rgba(134, 155, 249, 0.2);
    transform: translateX(6px) rotateX(0deg);
    color: #000;
}

.dropdown:hover .dropdown-menu {
    display: flex;
}

.dropdown:hover .icon-down {
    transform: rotate(180deg);
}

@keyframes dropdown3D {
    to {
        opacity: 1;
        transform: rotateX(0deg);
    }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-right: 20px;
}

.header-right a {
    font-weight: bold;
    text-decoration: none;
    color: white;
    transition: color 0.3s ease;
    opacity: 0;
    transform: translateY(-30px) rotateX(45deg);
    animation: fadeDrop 1s forwards;
    padding: 10px 20px;
    border-radius: 5px;
}

.header-right a:not(.login-btn):hover {
    background: rgba(238, 238, 238, 0.5);
    color: #000;
}


.header-right a:nth-child(1) {
    animation-delay: 0.2s;
}

.header-right a:nth-child(2) {
    animation-delay: 0.3s;
}

.header-right .flag {
    width: 20px;
    height: 20px;
    animation: fadeZoom 1s forwards;
    animation-delay: 0.4s;
    opacity: 0;
    transform: scale(0.8);
}

.login-btn {
    background-color: #ff7b7b;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.login-btn:hover {
    background: linear-gradient(135deg, #ff7b7b, #ffb88c);
    color: white;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}




/* Banner */
.banner {
    min-height: 460px;
    display: flex;
    align-items: center;
    justify-content: center; /* Căn giữa ngang */
    padding: 100px 40px 80px 40px;
    margin-bottom: 50px;
    border-bottom-left-radius: 200px;
    border-bottom-right-radius: 200px;
    /* background: none; → không cần nếu không có sẵn */
}

.banner-content {
    color: white;
    max-width: 700px;
    text-align: center; /* Căn giữa nội dung */
}

.banner h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
    opacity: 0;
    transform: translateX(-100px) rotateY(-15deg);
    animation: slideTitle 1s ease-out forwards;
    animation-delay: 0.2s;
}

.banner p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0;
    transform: translateX(-30px) rotateY(-10deg);
    animation: slideParagraph 1s ease-out forwards;
    animation-delay: 0.4s;
}

.cta-button {
    background-color: #869bf9;
    color: white;
    font-weight: bold;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    opacity: 0;
    transform: scale(0.8) rotateX(60deg);
    animation: bounceFade 1s ease-out forwards;
    animation-delay: 0.7s;
}

.cta-button:hover {
    background-color: #6c83f2;
}


/* Keyframes */
@keyframes fadeDrop {
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}

@keyframes fadeZoom {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideTitle {
    to {
        opacity: 1;
        transform: translateX(0) rotateY(0deg);
    }
}

@keyframes slideParagraph {
    to {
        opacity: 1;
        transform: translateX(0) rotateY(0deg);
    }
}

@keyframes bounceFade {
    0% {
        opacity: 0;
        transform: scale(0.8) rotateX(60deg);
    }

    60% {
        opacity: 1;
        transform: scale(1.05) rotateX(10deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotateX(0deg);
    }
}

/* Tìm kiếm và all product */
.search-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: 20px auto;
    width: 80%;
    max-width: 1000px;
}

.search-form {
    flex: 7;
    display: flex;
    border: 1px solid #ccc;
    border-radius: 40px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-input {
    flex: 1;
    padding: 10px 20px;
    border: none;
    outline: none;
    font-size: 16px;
}

.search-button {
    padding: 10px 25px;
    background-color: #1889b3;
    color: #fff;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background-color: #0056b3;
}

.all-products-btn {
    padding: 12px 20px;
    border-radius: 30px;
    background-color: #1889b3;
    color: white;
    text-align: center;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
    transition: background-color 0.3s ease;
}

.all-products-btn:hover {
    background-color: #0056b3;
}

/* Responsive */
@media (max-width: 768px) {
    .search-area {
        flex-direction: column;
        width: 100%;
    }

    .search-form, .all-products-btn {
        flex: none;
        width: 100%;
    }

    .search-button {
        width: 30%;
    }
}



/* Reponsive Main Content */
@media (max-width: 1024px) {
    ul.products li {
        flex-basis: 33.33%;
    }
}

@media (max-width: 768px) {
    ul.products {
        justify-content: center;
    }

    ul.products li {
        flex-basis: 45%;
        padding-left: 10px;
        padding-right: 10px;
    }

    .category {
        font-size: 16px;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    ul.products li {
        flex-basis: 50%;
        padding-left: 5px;
        padding-right: 5px;
    }

    .product-info {
        padding: 6px 0;
    }

        .category {
        font-size: 14px;
    }
}

/* Footer */
.footer {
    background: linear-gradient(to right, #551b6a, #01b2ce); /* tím -> xanh dương */
    background-size: cover;
    background-position: center;
    position: relative;
    z-index: 1;
}


.footer-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section {
    flex: 1;
    min-width: 250px;
    margin: 10px;
}

.footer h2 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 12px;
}

.footer p,
.footer li,
.footer a {
    font-size: 16px;
    line-height: 1.6;
    color: white;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.quick-links ul {
    list-style: none;
    padding: 0;
}

.quick-links li {
    margin-bottom: 6px;
}

.social-media a {
    margin-right: 10px;
    color: white;
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
    font-size: 14px;
}

/* Chuông */
.notif-panel {
    position: fixed;
    top: 0;
    right: -800px;
    width: 800px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    padding: 15px;
    z-index: 9999;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.notif-panel.show {
    right: 0;
}

.notif-header {
    border-bottom: 1px solid #ddd;
    margin-bottom: 10px;
}

.nav-tabs {
    display: flex;
    width: 100%;
    border-bottom: 1px solid #ddd;
}

.nav-tabs .nav-item {
    flex: 1;
    text-align: center;
}

.nav-tabs .nav-link {
    width: 100%;
    border: none;
    border-radius: 0;
    color: #333;
    background: #fff;
    transition: background 0.2s, color 0.2s;
}

.nav-tabs .nav-link:hover {
    background: #f1f1f1;
}

.nav-tabs .nav-link.active {
    background: #0d6efd;
    color: white;
    font-weight: bold;
}

#follow-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #eee;
    background: #fff;
    transition: background 0.2s;
    cursor: pointer;
}

/* Chưa đọc */
#follow-list li.unread {
    background: #e7f3ff; /* xanh nhạt cho chưa đọc */
    font-weight: 500;
}

/* Hover cho tất cả */
#follow-list li:hover {
    background: #f8f8f8;
}

#follow-list li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-decoration: none;
    color: #333 !important;
}

#follow-list img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

#follow-list .notif-text strong {
    font-weight: 600;
    color: #000;
}

#follow-list .notif-text small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #888;
}

#markAllFollowRead {
    font-size: 13px;
    padding: 4px 8px;
}

/* Thêm CSS cho sản phẩm */
#product-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #eee;
    background: #fff;
    transition: background 0.2s;
    cursor: pointer;
}

/* Chưa đọc */
#product-list li.unread {
    background: #e7f3ff; /* xanh nhạt cho chưa đọc */
    font-weight: 500;
}

/* Hover cho tất cả */
#product-list li:hover {
    background: #f8f8f8;
}

#product-list li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-decoration: none;
    color: #333 !important;
}

#product-list img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

#product-list .notif-text strong {
    font-weight: 600;
    color: #000;
}

#product-list .notif-text small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #888;
}

#markAllProductRead {
    font-size: 13px;
    padding: 4px 8px;
}

/* Comment list (giống follow/product) */
#comment-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #eee;
    background: #fff;
    transition: background 0.2s;
    cursor: pointer;
}
#comment-list li.unread {
    background: #e7f3ff;
    font-weight: 500;
}
#comment-list li:hover {
    background: #f8f8f8;
}
#comment-list li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-decoration: none;
    color: #333 !important;
}
#comment-list img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
#comment-list .notif-text strong {
    font-weight: 600;
    color: #000;
}
#comment-list .notif-text em {
    font-style: normal;
    color: #555;
    background: #f2f2f2;
    padding: 0 3px;
    border-radius: 3px;
    margin-left: 3px;
    font-size: 13px;
}
#comment-list .notif-text small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #888;
}
#markAllCommentRead {
    font-size: 13px;
    padding: 4px 8px;
}
#message-list li {
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px;
    border-bottom:1px solid #eee;
    background:#fff;
    transition:background .2s;
    cursor:pointer;
}
#message-list li.unread { background:#e7f3ff; font-weight:500; }
#message-list li:hover { background:#f8f8f8; }
#message-list li>a {
    display:flex;
    align-items:center;
    gap:10px;
    width:100%;
    text-decoration:none;
    color:#333!important;
}
#message-list img {
    width:40px;
    height:40px;
    border-radius:50%;
    object-fit:cover;
}
#message-list .notif-text strong { font-weight:600; color:#000; }
#message-list .notif-text em {
    font-style:normal;
    color:#555;
    background:#f2f2f2;
    padding:0 3px;
    border-radius:3px;
    margin-left:3px;
    font-size:13px;
}
#message-list .notif-text small {
    display:block;
    margin-top:2px;
    font-size:12px;
    color:#888;
}
#markAllMessageRead { font-size:13px; padding:4px 8px; }

/* Ẩn header desktop trên mobile */
@media (max-width: 991.98px) {
  #mainHeader { display: none !important; }
}

/* Header mobile */
.header-mobile {
       background: transparent; 

  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  height: 56px;
  padding: 0 8px;
}
.brand-center {
  font-weight: 800; font-size: 18px; color: #fff; text-decoration: none;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; text-decoration: none;
}
.icon-btn:hover { background: rgba(255,255,255,.6); }

/* Hamburger */
.hamburger {
  width: 40px; height: 40px; border: none; background: transparent;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.hamburger svg { color: #fff; }
.hamburger span {
  display: block; width: 22px; height: 2px; background: #111;
  margin: 3px 0; transition: .25s;
}
.hamburger.active span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* Drawer */
.mobile-drawer {
  position: fixed; top: 0; left: 0; height: 100vh; width: 82vw; max-width: 360px;
  background: #fff; transform: translateX(-100%);
  transition: transform .28s ease; z-index: 12000;
  display: flex; flex-direction: column; box-shadow: 2px 0 16px rgba(0,0,0,.15);
}
.mobile-drawer.open { transform: translateX(0); }
.drawer-header {
  height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; border-bottom: 1px solid #eee;
  background: linear-gradient(90deg,#cbd8f6,#b1dbf9);
}
.drawer-header button {
  border: 0; background: transparent; font-size: 28px; line-height: 1;
}
.drawer-nav { padding: 10px; }
.drawer-nav a {
  display: block; padding: 10px 8px; border-radius: 8px;
  color: #111; text-decoration: none; font-weight: 600;
}
.drawer-nav a:hover { background: #f5f7ff; }
.drawer-section {
  margin-top: 8px; margin-bottom: 4px;
  font-size: 12px; text-transform: uppercase; color: #666;
}

.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.25); opacity: 0; visibility: hidden;
  transition: .2s; z-index: 900;
}
.drawer-backdrop.show { opacity: 1; visibility: visible; }

/* Đẩy nội dung xuống dưới header mobile */
@media (max-width: 991.98px) {
  .box, .container.mt-5.pt-5 { margin-top: 68px !important; }
}

/* Desktop: hiện carousel, ẩn banner mobile */
.desktop-only { display: block; }
@media (max-width: 991.98px) {
  .desktop-only { display: none !important; }
  #searchForm{display: none;}
  .all-products-btn{display: none;}
}


/* ========== Banner mobile giống Chợ Tốt ========== */
.banner-mobile{ position:relative; margin-bottom:28px; z-index:1; }
.banner-mobile-bg{
  min-height:160px;
  padding:64px 16px 56px;            /* chừa đỉnh cho header + đáy cho ô search */
  text-align:left;
  color:#fff;
   background: linear-gradient(to right, #551b6a, #01b2ce);  /* thay bằng ảnh nếu muốn */
  border-bottom-left-radius:28px;
  border-bottom-right-radius:28px;
}

/* Tiêu đề trong banner */
.bm-title{ font-size:20px; font-weight:800; line-height:1.25; margin:0; }
.bm-sub{ font-size:13px; opacity:.9; margin-top:6px; }

/* Ô search nổi, nằm chạm mép dưới banner */
.search-mobile{
  position:absolute; left:50%; bottom:-24px; transform:translateX(-50%);
  width: calc(100% - 24px); max-width: 560px;
  display:flex; align-items:center; gap:8px;
  padding:10px 12px;
  background:#fff; border-radius:999px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index:2;
}
.search-mobile input{
  flex:1; border:0; outline:0;
  font-size:15px; padding:6px 6px 6px 10px; color:#333;
}
.search-mobile button{
  border:0; background:#2b74d2; width:40px; height:40px; border-radius:50%;
  display:grid; place-items:center; font-size:18px; color:#000;
}
.search-mobile button:hover{ filter: brightness(0.95); }

/* Đảm bảo header mobile không che chữ banner */
.header-mobile{ z-index:10000; }

/* Panel mặc định */
.notif-panel {
  position: fixed;
  top: 0;
  right: -800px;      /* ẩn đi */
  width: 800px;
  height: 100vh;
  background: #fff;
  box-shadow: -2px 0 8px rgba(0,0,0,0.1);
  padding: 15px;
  z-index: 11000;
  transition: right .3s ease;
  overflow-y: auto;
}
.notif-panel.show { right: 0; }

/* Mobile: rộng toàn màn */
@media (max-width: 991.98px){
  .notif-panel { width: 100vw; right: -100vw; }
  .notif-panel.show { right: 0; }
}

/* Backdrop */
#notifBackdrop.show { opacity:1; visibility:visible; }
