:root{
      --primary:#ff6600;
      --primary-dark:#e95400;
      --danger:#d32f2f;
      --success:#16823b;
      --blue:#087eff;
      --text:#222;
      --muted:#666;
      --surface:#fff;
      --background:#f4f4f4;
      --border:#e8e8e8;
      --shadow:0 4px 14px rgba(0,0,0,.12);
    }

    *{
      margin:0;
      padding:0;
      box-sizing:border-box;
      font-family:Arial,sans-serif;
    }

    body{
      background:var(--background);
      color:var(--text);
    }

    button,
    input,
    textarea{
      font:inherit;
    }

    button{
      cursor:pointer;
    }

    body.modal-open{
      overflow:hidden;
    }

    /* HEADER */
    header{
      position:sticky;
      top:0;
      z-index:500;
      display:flex;
      align-items:center;
      gap:18px;
      padding:16px 20px;
      color:#fff;
      background:var(--primary);
      box-shadow:0 2px 8px rgba(0,0,0,.2);
    }

    .logo{
      flex-shrink:0;
      font-size:30px;
      font-weight:800;
    }

    .menu{
      display:flex;
      justify-content:center;
      gap:18px;
      flex:1;
    }

    .menu a{
      color:#fff;
      text-decoration:none;
      font-size:18px;
      font-weight:700;
    }

    .cartBtn{
      flex-shrink:0;
      padding:10px 14px;
      border:0;
      border-radius:10px;
      color:var(--primary);
      background:#fff;
      font-weight:800;
    }

    #cartCount{
      display:inline-flex;
      min-width:22px;
      height:22px;
      margin-left:4px;
      align-items:center;
      justify-content:center;
      padding:0 6px;
      color:#fff;
      background:red;
      border-radius:999px;
      font-size:13px;
    }

    /* HERO */
    .banner{
      margin:20px;
      padding:30px 20px;
      color:#fff;
      text-align:center;
      background:linear-gradient(90deg,var(--primary),#ff2d55);
      border-radius:20px;
    }

    .banner h1{
      margin-bottom:10px;
      font-size:38px;
    }

    .banner p{
      font-size:21px;
    }

    /* SEARCH + CATEGORY */
    .search{
      display:flex;
      width:min(95%,800px);
      margin:20px auto 0;
    }

    .search input{
      flex:1;
      min-width:0;
      height:54px;
      padding:0 15px;
      border:1px solid transparent;
      border-radius:12px 0 0 12px;
      outline:none;
      font-size:18px;
    }

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

    .search button{
      width:90px;
      border:0;
      border-radius:0 12px 12px 0;
      color:#fff;
      background:var(--primary);
      font-size:20px;
    }

    .category{
      display:flex;
      justify-content:center;
      flex-wrap:wrap;
      gap:12px;
      margin:24px 15px;
    }

    .category button{
      padding:11px 21px;
      border:0;
      border-radius:30px;
      background:#fff;
      box-shadow:0 2px 8px rgba(0,0,0,.12);
      font-size:16px;
      font-weight:700;
    }

    .category button.active,
    .category button:hover{
      color:#fff;
      background:var(--primary);
    }

    .title{
      margin:25px 0 20px;
      text-align:center;
      font-size:28px;
      font-weight:800;
    }

    /* PRODUCTS */
    #products{
      display:grid;
      grid-template-columns:repeat(2,minmax(0,1fr));
      gap:14px;
      width:min(100%,1100px);
      margin:auto;
      padding:12px;
    }

    .card{
      position:relative;
      overflow:hidden;
      background:#fff;
      border-radius:17px;
      box-shadow:var(--shadow);
      transition:transform .2s;
    }

    .card:hover{
      transform:translateY(-4px);
    }

    .cardImageButton{
      display:block;
      width:100%;
      border:0;
      background:none;
    }

    .cardImage{
      display:block;
      width:100%;
      height:210px;
      object-fit:cover;
      background:#eee;
    }

    .badge{
      position:absolute;
      top:12px;
      left:12px;
      z-index:2;
      padding:7px 12px;
      color:#fff;
      border-radius:999px;
      font-size:14px;
      font-weight:800;
    }

    .badge.sale{background:#e60012}
    .badge.hot{background:#ff6600}
    .badge.new{background:#2196f3}
    .badge.best{background:#4caf50}

    .info{
      padding:15px;
    }

    .name{
      display:-webkit-box;
      min-height:50px;
      overflow:hidden;
      -webkit-box-orient:vertical;
      -webkit-line-clamp:2;
      font-size:19px;
      font-weight:800;
      line-height:1.35;
    }

    .oldPrice{
      min-height:20px;
      margin-top:7px;
      color:#888;
      text-decoration:line-through;
      font-size:14px;
    }

    .price{
      margin-top:3px;
      color:#e60012;
      font-size:27px;
      font-weight:900;
    }

    .stockStatus{
      min-height:21px;
      margin-top:6px;
      color:var(--success);
      font-size:15px;
      font-weight:800;
    }

    .stockStatus.outOfStock{
      color:var(--danger);
    }

    .viewBtn{
      width:100%;
      height:44px;
      margin-top:12px;
      border:0;
      border-radius:9px;
      color:#fff;
      background:var(--primary);
      font-size:16px;
      font-weight:800;
    }

    .viewBtn:disabled,
    #buyBtn:disabled,
    #submitOrderBtn:disabled{
      cursor:not-allowed;
      opacity:.55;
    }

    .emptyState,
    .loadingState,
    .errorState{
      grid-column:1/-1;
      padding:35px 20px;
      text-align:center;
      background:#fff;
      border-radius:14px;
      line-height:1.6;
    }

    .errorState{color:var(--danger)}

    /* COMMON MODAL */
    .modal{
      display:none;
      position:fixed;
      inset:0;
      z-index:1000;
      align-items:center;
      justify-content:center;
      padding:14px;
      background:rgba(0,0,0,.74);
    }

    .modal.show{
      display:flex;
    }

    .modalBox{
      position:relative;
      width:100%;
      max-height:94vh;
      overflow-y:auto;
      background:#fff;
      border-radius:20px;
      box-shadow:var(--shadow);
    }

    .closeBtn{
      position:sticky;
      top:10px;
      z-index:20;
      float:right;
      display:flex;
      width:42px;
      height:42px;
      margin:10px 10px 0 0;
      align-items:center;
      justify-content:center;
      border:0;
      border-radius:50%;
      background:rgba(255,255,255,.95);
      box-shadow:0 2px 9px rgba(0,0,0,.2);
      font-size:30px;
      font-weight:800;
    }

    /* PRODUCT DETAIL */
    .productBox{
      max-width:680px;
      padding:20px;
    }

    #bigImage{
      display:block;
      width:100%;
      height:390px;
      object-fit:cover;
      background:#eee;
      border-radius:14px;
    }

    #thumbs{
      display:flex;
      gap:9px;
      margin-top:12px;
      overflow-x:auto;
    }

    #thumbs button{
      flex-shrink:0;
      width:82px;
      height:82px;
      padding:0;
      overflow:hidden;
      border:2px solid transparent;
      border-radius:9px;
      background:none;
    }

    #thumbs button.active{
      border-color:var(--primary);
    }

    #thumbs img{
      width:100%;
      height:100%;
      object-fit:cover;
    }

    #video{
      display:none;
      width:100%;
      max-height:360px;
      margin-top:18px;
      border-radius:12px;
      background:#000;
    }

    #description{
      margin-top:18px;
    }

    .detailName{
      margin:12px 0 8px;
      font-size:36px;
      line-height:1.25;
    }

    .detailOldPrice{
      color:#999;
      text-decoration:line-through;
      font-size:21px;
    }

    .detailPrice{
      margin:5px 0 15px;
      color:#e60012;
      font-size:38px;
      font-weight:900;
    }

    .detailTags{
      display:flex;
      flex-wrap:wrap;
      gap:8px;
      margin-bottom:16px;
    }

    .detailTag{
      padding:7px 11px;
      border-radius:8px;
      background:#f4f4f4;
      font-size:15px;
      font-weight:700;
    }

    .detailDescription{
      white-space:pre-line;
      color:#333;
      font-size:21px;
      line-height:1.75;
    }

    .buy{
      position:sticky;
      bottom:-20px;
      display:flex;
      gap:10px;
      margin-top:20px;
      padding:12px 0 4px;
      background:#fff;
    }

    .buy button{
      flex:1;
      min-height:58px;
      border:0;
      border-radius:12px;
      color:#fff;
      font-size:19px;
      font-weight:900;
    }

    .order{background:var(--primary)}
    .zalo{background:#0084ff}

    /* CART */
    .cartBox{
      max-width:540px;
      padding:20px;
    }

    .cartBox h2,
    .checkoutBox h2,
    .promotionTitle,
    .contactBox h2{
      clear:both;
      padding:5px 45px 15px;
      text-align:center;
    }

    .cartItem{
      display:flex;
      gap:12px;
      padding:14px 0;
      border-bottom:1px solid var(--border);
    }

    .cartItem img{
      width:82px;
      height:82px;
      flex-shrink:0;
      object-fit:cover;
      border-radius:10px;
      background:#eee;
    }

    .cartItemInfo{
      flex:1;
      min-width:0;
    }

    .cartItemInfo b{
      display:block;
      line-height:1.35;
    }

    .cartItemPrice{
      margin-top:5px;
      color:#e60012;
      font-weight:800;
    }

    .quantityRow{
      display:flex;
      align-items:center;
      flex-wrap:wrap;
      gap:8px;
      margin-top:10px;
    }

    .quantityRow button{
      min-width:35px;
      height:35px;
      border:0;
      border-radius:8px;
      background:#eee;
      font-size:18px;
      font-weight:800;
    }

    .quantityRow .removeBtn{
      width:auto;
      padding:0 11px;
      color:#fff;
      background:var(--danger);
      font-size:14px;
    }

    .voucherBox{
      margin-top:18px;
      padding:15px;
      background:#fff7f0;
      border:1px solid #ffd2b3;
      border-radius:14px;
    }

    .voucherBox label{
      display:block;
      margin-bottom:9px;
      font-weight:800;
    }

    .voucherInput,
    .promotionPhoneRow{
      display:flex;
      gap:8px;
    }

    .voucherInput input,
    .promotionPhoneRow input{
      flex:1;
      min-width:0;
      height:47px;
      padding:0 12px;
      border:1px solid #ccc;
      border-radius:10px;
      outline:none;
      font-size:16px;
    }

    .voucherInput button,
    .promotionPhoneRow button{
      height:47px;
      padding:0 15px;
      border:0;
      border-radius:10px;
      color:#fff;
      background:var(--primary);
      font-weight:800;
    }

    #voucherMessage,
    #promotionVoucherResult,
    #memberRegisterResult,
    #orderMessage{
      margin-top:12px;
      line-height:1.55;
    }

    .voucherSuccess{color:var(--success);font-weight:800}
    .voucherError{color:var(--danger);font-weight:800}

    .priceSummary{
      margin-top:18px;
      padding:15px;
      background:#fafafa;
      border-radius:14px;
    }

    .summaryRow{
      display:flex;
      justify-content:space-between;
      gap:15px;
      margin-bottom:11px;
      font-size:17px;
    }

    .discountRow{color:#e65100}

    .totalRow{
      margin:14px 0 0;
      padding-top:14px;
      color:var(--danger);
      border-top:1px solid #ddd;
      font-size:21px;
      font-weight:900;
    }

    .checkoutBtn,
    #submitOrderBtn,
    .showRegisterBtn,
    #memberRegisterBtn{
      width:100%;
      min-height:53px;
      margin-top:16px;
      border:0;
      border-radius:11px;
      color:#fff;
      background:var(--primary);
      font-size:18px;
      font-weight:900;
    }

    /* CHECKOUT */
    .checkoutBox{
      max-width:560px;
      padding:22px;
    }

    .checkoutItem{
      display:flex;
      justify-content:space-between;
      gap:12px;
      padding:10px 0;
      border-bottom:1px solid var(--border);
      line-height:1.45;
    }

    .checkoutPrice{
      margin:17px 0;
      padding:15px;
      background:#fff7f0;
      border-radius:12px;
    }

    .checkoutPrice > div{
      display:flex;
      justify-content:space-between;
      gap:10px;
      margin-bottom:9px;
    }

    .checkoutPrice .checkoutTotal{
      margin-bottom:0;
      padding-top:12px;
      color:var(--danger);
      border-top:1px solid #ddd;
      font-size:20px;
      font-weight:900;
    }

    .checkoutBox input,
    .checkoutBox textarea,
    #memberRegisterForm input{
      width:100%;
      margin-top:11px;
      padding:13px;
      border:1px solid #ccc;
      border-radius:10px;
      outline:none;
      font-size:16px;
    }

    .checkoutBox textarea{
      min-height:88px;
      resize:vertical;
    }

    /* PROMOTION */
    .promotionBox{
      max-width:680px;
      padding:20px;
      background:#f7f7f7;
    }

    .promotionTitle{
      color:var(--primary-dark);
      font-size:27px;
    }

    .promotionSection{
      margin-top:15px;
      padding:17px;
      background:#fff;
      border-radius:15px;
      box-shadow:0 2px 10px rgba(0,0,0,.07);
    }

    .promotionSection h3{
      margin-bottom:13px;
      font-size:21px;
    }

    .promotionOffer{
      display:flex;
      gap:12px;
      padding:12px 0;
      border-bottom:1px solid #eee;
    }

    .promotionOffer:last-child{border-bottom:0}
    .promotionOffer > span{font-size:27px}
    .promotionOffer b{display:block;margin-bottom:4px;font-size:17px}
    .promotionOffer p,.promotionHint{color:var(--muted);line-height:1.5}
    .promotionHint{margin-bottom:10px}

    .memberRegisterSection{
      background:linear-gradient(135deg,#fff7ed,#fff);
      border:1px solid #ffd1ad;
    }

    .memberRegisterIntro{
      display:flex;
      align-items:flex-start;
      gap:13px;
    }

    .registerGift{
      display:flex;
      width:52px;
      height:52px;
      flex-shrink:0;
      align-items:center;
      justify-content:center;
      color:#fff;
      background:var(--primary);
      border-radius:50%;
      font-size:26px;
    }

    #memberRegisterForm{
      display:none;
      margin-top:15px;
      padding-top:8px;
      border-top:1px solid #ffd5b8;
    }

    .messageBox{
      padding:15px;
      border-radius:12px;
    }

    .messageSuccess{
      color:#176b35;
      background:#edfff2;
      border:1px solid #a8e8bb;
    }

    .messageWarning{
      color:#7a4700;
      background:#fff6e8;
      border:1px solid #ffd08c;
    }

    .messageError{
      color:#c62828;
      background:#fff0f0;
    }

    .promotionDiscount{
      margin:8px 0;
      color:var(--primary-dark);
      font-size:48px;
      font-weight:900;
    }

    .memberLevels{
      display:grid;
      grid-template-columns:repeat(3,1fr);
      gap:9px;
    }

    .memberLevel{
      display:flex;
      flex-direction:column;
      align-items:center;
      gap:7px;
      padding:13px 7px;
      text-align:center;
      background:#fff8f2;
      border:1px solid #ffd5b8;
      border-radius:12px;
    }

    .memberLevel span{font-size:30px}
    .memberLevel strong{color:var(--primary-dark)}

    #saleProducts{
      display:grid;
      grid-template-columns:repeat(2,minmax(0,1fr));
      gap:11px;
    }

    .saleProductCard{
      overflow:hidden;
      border:1px solid #eee;
      border-radius:12px;
      background:#fff;
    }

    .saleProductCard button{
      width:100%;
      border:0;
      text-align:left;
      background:none;
    }

    .saleProductCard img{
      display:block;
      width:100%;
      aspect-ratio:1/1;
      object-fit:cover;
      background:#eee;
    }

    .saleProductInfo{padding:10px}
    .saleProductName{min-height:41px;font-weight:800;line-height:1.3}
    .saleOldPrice{margin-top:6px;color:#999;text-decoration:line-through;font-size:13px}
    .saleNewPrice{margin-top:3px;color:#e60012;font-size:20px;font-weight:900}

    /* CONTACT */
    .contactBox{
      max-width:610px;
      padding:22px;
    }

    .contactBox h2{
      color:var(--primary-dark);
      font-size:27px;
    }

    .contactIntro{
      margin-bottom:17px;
      color:var(--muted);
      text-align:center;
      line-height:1.55;
    }

    .contactItem{
      display:flex;
      align-items:center;
      gap:12px;
      margin-top:11px;
      padding:14px;
      border:1px solid #eee;
      border-radius:13px;
      background:#fafafa;
    }

    .contactIcon{
      display:flex;
      width:47px;
      height:47px;
      flex-shrink:0;
      align-items:center;
      justify-content:center;
      background:#fff0e5;
      border-radius:50%;
      font-size:24px;
    }

    .contactInfo{
      flex:1;
      min-width:0;
    }

    .contactInfo b{display:block;margin-bottom:4px;font-size:17px}
    .contactInfo span{display:block;color:var(--muted);line-height:1.4}

    .contactItem button{
      min-height:41px;
      padding:0 12px;
      border:0;
      border-radius:9px;
      color:#fff;
      background:var(--primary);
      font-weight:800;
    }

    @media(max-width:768px){
      header{
        flex-wrap:wrap;
        gap:10px;
        padding:12px;
      }

      .logo{
        font-size:24px;
      }

      .menu{
        order:3;
        width:100%;
        justify-content:space-around;
        gap:6px;
      }

      .menu a{
        font-size:14px;
      }

      .cartBtn{
        margin-left:auto;
      }

      .banner{
        margin:12px;
        padding:22px 12px;
      }

      .banner h1{font-size:28px}
      .banner p{font-size:17px}

      #products{
        gap:9px;
        padding:9px;
      }

      .cardImage{height:155px}
      .info{padding:11px}
      .name{min-height:39px;font-size:15px}
      .oldPrice{font-size:12px}
      .price{font-size:20px}
      .stockStatus{font-size:13px}
      .viewBtn{height:38px;font-size:14px}

      #bigImage{height:310px}
      .detailName{font-size:30px}
      .detailPrice{font-size:34px}
      .detailDescription{font-size:19px}
    }

    @media(max-width:480px){
      .modal{padding:8px}
      .productBox,.cartBox,.checkoutBox,.promotionBox,.contactBox{padding:14px}
      #bigImage{height:275px}
      .detailName{font-size:27px}
      .detailPrice{font-size:31px}
      .detailDescription{font-size:18px}
      .buy button{min-height:54px;font-size:16px}
      .voucherInput,.promotionPhoneRow{flex-direction:column}
      .voucherInput button,.promotionPhoneRow button{width:100%}
      .memberLevels{grid-template-columns:1fr}
      .contactItem{align-items:flex-start;flex-wrap:wrap}
      .contactItem button{width:100%}
    }
/* Cloudflare bản tách riêng */
.contactItem a{
  min-height:41px;
  padding:0 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:9px;
  color:#fff;
  background:var(--primary);
  font-weight:800;
  text-decoration:none;
}
@media(max-width:480px){
  .contactItem a{width:100%}
}

