*{
    box-sizing:border-box;
    margin:0;
    padding:0;
}

html, body{
    height:100%;
}

body{
    min-height:100vh;
    background:
        radial-gradient(circle at top, #071a3a 0%, #020817 35%, #01040d 100%);
    background-color:#01040d; /* fallback chống trắng */
}

a{
    text-decoration:none;
}

.wrap{
    width:100%;
    max-width:1200px;
    min-height:100%;
    margin:0 auto;
    display:flex;
    flex-direction:column;
}

.top-title{
    flex:0 0 auto;
    font-size:20px;
    font-weight:700;
    margin-bottom:14px;
    color:#dff4ff;
    letter-spacing:.5px;
    text-transform:uppercase;
}

.panel{
    flex:1 1 auto;
    min-height:0;
    display:flex;
    flex-direction:column;
    background: linear-gradient(180deg, rgba(5,17,45,.96) 0%, rgba(4,13,34,.96) 100%);
    border:1px solid rgba(0,170,255,.18);
    border-radius:28px;
    box-shadow:
        0 0 0 1px rgba(0,170,255,.05) inset,
        0 12px 40px rgba(0,0,0,.45);
    padding:20px 16px 18px;
}

.panel-head{
    flex:0 0 auto;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:18px;
}

.panel-head h1{
    font-size:24px;
    line-height:1.2;
    font-weight:800;
    color:#ffffff;
}

.search-form{
    width:320px;
    max-width:100%;
}

.search-box{
    display:flex;
    align-items:center;
    gap:10px;
    border:1px solid rgba(120,160,255,.18);
    background: rgba(10,18,43,.95);
    border-radius:18px;
    padding:12px 14px;
}

.search-box input{
    width:100%;
    border:none;
    outline:none;
    background:transparent;
    color:#fff;
    font-size:14px;
}

.search-box input::placeholder{
    color:#6f7f9f;
}

.catalog-scroll{
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto;
    overflow-x:hidden;
    padding-right:8px;
    scroll-behavior:smooth;
    max-height: 720px;
}

.catalog-scroll::-webkit-scrollbar{
    width:8px;
}

.catalog-scroll::-webkit-scrollbar-track{
    background:rgba(255,255,255,.04);
    border-radius:999px;
}

.catalog-scroll::-webkit-scrollbar-thumb{
    background:rgba(47,200,255,.35);
    border-radius:999px;
}

.catalog-scroll::-webkit-scrollbar-thumb:hover{
    background:rgba(47,200,255,.55);
}

.category-block{
    margin-top:26px;
}

.category-block:first-of-type{
    margin-top:4px;
}

.section-label{
    color:#2fc8ff;
    font-size:14px;
    letter-spacing:4px;
    font-weight:800;
    margin:0 6px 14px;
    text-transform:uppercase;
}

.product-list{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:16px;
}

.product-card{
    position:relative;
    display:flex;
    align-items:center;
    gap:14px;
    background: linear-gradient(90deg, rgba(17,27,58,.98) 0%, rgba(22,27,44,.98) 100%);
    border:1px solid rgba(255,255,255,.05);
    border-radius:24px;
    padding:16px 14px 14px;
    color:#fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
    min-height:116px;
    overflow:visible;
}

.product-card:hover{
    transform:translateY(-2px);
    border-color:rgba(0,212,255,.35);
    box-shadow: 0 10px 28px rgba(0,160,255,.12);
}

.product-popup-trigger{
    cursor:pointer;
}

.discount-badge{
    position:absolute;
    top:-12px;
    left:16px;
    background:#e0001b;
    color:#fff;
    font-size:13px;
    font-weight:800;
    padding:6px 12px;
    border-radius:10px;
    box-shadow:0 8px 18px rgba(224,0,27,.28);
    z-index:3;
    line-height:1;
}

.thumb{
    width:90px;
    height:90px;
    border-radius:18px;
    overflow:hidden;
    background:#111a30;
    flex:0 0 90px;
    border:1px solid rgba(255,255,255,.06);
    display:flex;
    align-items:center;
    justify-content:center;
}

.thumb img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.thumb .no-image{
    font-size:12px;
    color:#7e8aa8;
    text-align:center;
    padding:8px;
}

.info{
    flex:1;
    min-width:0;
}

.name{
    font-size:18px;
    font-weight:800;
    line-height:1.25;
    margin-bottom:8px;
    text-transform:uppercase;
}

.price-row{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
    margin-bottom:8px;
}

.sale-price{
    font-size:17px;
    font-weight:900;
    color:#ff3b30;
    line-height:1.2;
}

.original-price{
    font-size:13px;
    color:#aeb6c7;
    text-decoration:line-through;
    opacity:.9;
    line-height:1.2;
}

.badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:105px;
    padding:8px 14px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
    letter-spacing:.5px;
}

.badge.instock{
    color:#31f0ab;
    background: rgba(24, 124, 87, .25);
    border:1px solid rgba(49, 240, 171, .18);
}

.badge.outstock{
    color:#d4d8e3;
    background: rgba(120, 125, 140, .2);
    border:1px solid rgba(255,255,255,.08);
}

.note{
    color:#98a7c7;
    font-size:13px;
    line-height:1.5;
}

.empty{
    text-align:center;
    color:#8ea0c5;
    padding:30px 10px;
    font-size:14px;
}

/* POPUP */
.product-modal{
    position:fixed;
    inset:0;
    display:none;
    align-items:center;
    justify-content:center;
    z-index:9999;
    padding:20px;
}

.product-modal.show{
    display:flex;
}

.product-modal-backdrop{
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.72);
    backdrop-filter:blur(4px);
}

.product-modal-content{
    position:relative;
    width:100%;
    max-width:920px;
    max-height:90vh;
    overflow:auto;
    background:linear-gradient(180deg, rgba(8,17,40,.98) 0%, rgba(9,16,34,.99) 100%);
    border:1px solid rgba(97,215,255,.16);
    border-radius:28px;
    box-shadow:0 18px 46px rgba(0,0,0,.4);
    z-index:2;
    padding:24px;
}

.product-modal-close{
    position:absolute;
    top:14px;
    right:14px;
    width:42px;
    height:42px;
    border:none;
    border-radius:50%;
    background:rgba(255,255,255,.08);
    color:#fff;
    font-size:28px;
    line-height:1;
    cursor:pointer;
}

.product-modal-inner{
    display:grid;
    grid-template-columns:320px 1fr;
    gap:24px;
    align-items:start;
}

.product-modal-image-wrap{
    width:100%;
    border-radius:22px;
    overflow:hidden;
    background:#101a34;
    border:1px solid rgba(255,255,255,.08);
    min-height:320px;
    display:flex;
    align-items:center;
    justify-content:center;
}

.product-modal-image-wrap img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.product-modal-no-image{
    min-height:320px;
    width:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#8ea0c5;
    font-size:15px;
    text-align:center;
    padding:20px;
}

.product-modal-category{
    color:#2fc8ff;
    font-size:13px;
    letter-spacing:4px;
    font-weight:800;
    text-transform:uppercase;
    margin-bottom:10px;
}

.product-modal-title{
    font-size:30px;
    font-weight:900;
    color:#fff;
    line-height:1.2;
    margin-bottom:14px;
    text-transform:uppercase;
}

.product-modal-price-row{
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
    margin-bottom:14px;
}

.product-modal-sale-price{
    font-size:28px;
    font-weight:900;
    color:#ff3b30;
}

.product-modal-original-price{
    font-size:16px;
    color:#aeb6c7;
    text-decoration:line-through;
}

.product-modal-discount{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:7px 12px;
    border-radius:999px;
    background:#e0001b;
    color:#fff;
    font-size:13px;
    font-weight:800;
}

.product-modal-status{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:8px 14px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
    margin-bottom:14px;
}

.product-modal-status.instock{
    color:#31f0ab;
    background:rgba(24,124,87,.22);
    border:1px solid rgba(49,240,171,.16);
}

.product-modal-status.outstock{
    color:#dbe1eb;
    background:rgba(120,125,140,.18);
    border:1px solid rgba(255,255,255,.08);
}

.product-modal-note{
    color:#d8e6ff;
    font-size:15px;
    line-height:1.6;
    margin-bottom:18px;
}

.product-modal-desc-title{
    color:#ffffff;
    font-size:18px;
    font-weight:800;
    margin-bottom:10px;
}

.product-modal-desc{
    color:#aebddb;
    font-size:15px;
    line-height:1.7;
    white-space:pre-line;
}

body.modal-open{
    overflow:hidden;
}

/* FOOTER */
.footer-box{
    flex:0 0 auto;
    margin-top:16px;
    background:linear-gradient(180deg, rgba(5,17,45,.96) 0%, rgba(4,13,34,.96) 100%);
    border:1px solid rgba(0,170,255,.18);
    border-radius:28px;
    box-shadow:
        0 0 0 1px rgba(0,170,255,.05) inset,
        0 12px 40px rgba(0,0,0,.35);
    padding:26px 22px 18px;
    color:#dbe7ff;
}

.footer-grid{
    display:grid;
    grid-template-columns:1.3fr 1fr 1fr 1fr;
    gap:28px;
}

.footer-col{
    min-width:0;
}

.footer-brand-top{
    display:flex;
    align-items:center;
    gap:14px;
    margin-bottom:14px;
}

.footer-icon-box{
    width:46px;
    height:46px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(9,34,63,.95);
    border:1px solid rgba(47,200,255,.22);
    font-size:22px;
    color:#53d9ff;
    flex:0 0 46px;
}

.footer-brand-title{
    font-size:18px;
    font-weight:800;
    color:#ffffff;
}

.footer-text{
    color:#9fb1d2;
    font-size:15px;
    line-height:1.8;
    max-width:310px;
}

.footer-heading{
    font-size:16px;
    font-weight:800;
    color:#ffffff;
    margin-bottom:14px;
}

.footer-links{
    list-style:none;
    display:flex;
    flex-direction:column;
    gap:12px;
}

.footer-links li{
    position:relative;
    padding-left:14px;
}

.footer-links li::before{
    content:"•";
    color:#2fc8ff;
    position:absolute;
    left:0;
    top:0;
}

.footer-links li a{
    color:#c7d6f3;
    font-size:15px;
    text-decoration:none;
    transition:.15s ease;
}

.footer-links li a:hover{
    color:#45d6ff;
}

.footer-contact-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.footer-contact-item{
    display:flex;
    align-items:center;
    gap:12px;
    color:#dce9ff;
    font-size:15px;
    text-decoration:none;
    transition:.15s ease;
}

.footer-contact-item:hover{
    color:#45d6ff;
}

.footer-contact-icon{
    width:40px;
    height:40px;
    border-radius:12px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(255,255,255,.04);
    border:1px solid rgba(255,255,255,.08);
    font-size:18px;
    flex:0 0 40px;
}

.footer-bottom{
    margin-top:26px;
    padding-top:18px;
    border-top:1px solid rgba(255,255,255,.08);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
    color:#9ca9c3;
    font-size:14px;
}

.footer-credit{
    color:#57ddff;
    font-weight:800;
}

/* TABLET */
@media (min-width: 768px) and (max-width: 1024px){
    body{
        padding:18px 16px;
    }

    .wrap{
        max-width:900px;
    }

    .product-list{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }

    .panel-head h1{
        font-size:22px;
    }

    .name{
        font-size:17px;
    }

    .footer-grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
        gap:24px;
    }
}

/* MOBILE */
@media (max-width: 767px){
    body{
        padding:14px 12px;
        overflow:auto;
    }

    .wrap{
        max-width:520px;
        min-height:auto;
        height:auto;
    }

    .top-title{
        font-size:18px;
        margin-bottom:12px;
    }

    .panel{
        flex:none;
        min-height:auto;
        padding:18px 14px 16px;
        border-radius:24px;
    }

    .panel-head{
        flex-direction:column;
        align-items:stretch;
        gap:12px;
    }

    .panel-head h1{
        font-size:20px;
    }

    .search-form{
        width:100%;
    }

    .section-label{
        font-size:13px;
        letter-spacing:6px;
        margin-bottom:12px;
    }

    .product-list{
        grid-template-columns:1fr;
        gap:14px;
    }

    .product-card{
        padding:16px 12px 12px;
        border-radius:20px;
        min-height:110px;
    }

    .discount-badge{
        top:-9px;
        left:12px;
        font-size:12px;
        padding:5px 10px;
        border-radius:8px;
    }

    .thumb{
        width:76px;
        height:76px;
        flex-basis:76px;
    }

    .name{
        font-size:16px;
    }

    .sale-price{
        font-size:16px;
    }

    .original-price{
        font-size:12px;
    }

    .catalog-scroll{
        min-height:430px;
        max-height:430px;
        overflow-y:auto;
        padding-right:4px;
    }

    .product-modal{
        padding:14px;
    }

    .product-modal-content{
        padding:18px 14px;
        border-radius:22px;
    }

    .product-modal-inner{
        grid-template-columns:1fr;
        gap:16px;
    }

    .product-modal-image-wrap,
    .product-modal-no-image{
        min-height:220px;
    }

    .product-modal-title{
        font-size:22px;
    }

    .product-modal-sale-price{
        font-size:22px;
    }

    .product-modal-original-price{
        font-size:14px;
    }

    .product-modal-desc{
        font-size:14px;
    }

    .footer-box{
        margin-top:14px;
        border-radius:22px;
        padding:20px 16px 16px;
    }

    .footer-grid{
        grid-template-columns:1fr;
        gap:20px;
    }

    .footer-brand-title{
        font-size:17px;
    }

    .footer-text,
    .footer-links li a,
    .footer-contact-item{
        font-size:14px;
    }

    .footer-bottom{
        font-size:13px;
        margin-top:20px;
        padding-top:16px;
    }
}

/* DESKTOP LỚN */
@media (min-width: 1025px){
    .product-list{
        grid-template-columns:repeat(3, minmax(0, 1fr));
    }
}

.topbar-top{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:14px;
}

.topbar-top .top-title{
    margin-bottom:0;
}

.buy-now-top-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:170px;
    height:46px;
    padding:0 22px;
    border-radius:999px;

    background:linear-gradient(180deg, #00ff9c 0%, #00c96b 100%);
    color:#002d1c;

    font-size:14px;
    font-weight:900;
    text-decoration:none;
    white-space:nowrap;
    margin-left:auto;

    box-shadow:0 5px 10px rgb(54 183 142 / 25%);
    transition:.2s cubic-bezier(0.25, 0.1, 0.53, 0.08);
}

/* hiệu ứng khi bấm */
.buy-now-top-btn:active{
    transform:scale(.95);
}

/* MOBILE: nút ngắn, nằm góc trên bên phải */
@media (max-width: 767px){
    .topbar-top{
        display:grid;
        grid-template-columns:1fr auto;
        align-items:start;
        gap:8px 10px;
        margin-bottom:12px;
    }

    .topbar-top .top-title{
        grid-column:1 / 2;
        align-self:center;
        font-size:17px;
        line-height:1.2;
    }

    .buy-now-top-btn{
        grid-column:2 / 3;
        justify-self:end;
        min-width:unset;
        width:auto;
        height:38px;
        padding:0 16px;
        border-radius:14px;
        font-size:13px;
        font-weight:800;
    }
}