/* GR Build UI Polish */
:root{
  --gr-bg:#f5f7fb;
  --gr-dark:#0f172a;
  --gr-card:#ffffff;
  --gr-line:#e5e7eb;
  --gr-text:#111827;
  --gr-muted:#64748b;
  --gr-blue:#0071e3;
  --gr-blue2:#38bdf8;
  --gr-red:#dc2626;
  --gr-green:#047857;
  --gr-orange:#f97316;
  --gr-shadow:0 18px 50px rgba(15,23,42,.08);
  --gr-radius:24px;
}

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

a{
  transition:.2s ease;
}

a:hover{
  opacity:.82;
}

.site-header,
.grb-header,
.gb2-header{
  box-shadow:0 10px 30px rgba(15,23,42,.08);
  backdrop-filter:blur(16px);
}

.container,
.gb2-container,
.grb-main,
.portal,
.admin-dashboard{
  width:min(1280px, calc(100% - 32px));
  margin-left:auto;
  margin-right:auto;
}

.form-box,
.card,
.gb2-legal-card,
.gb2-detail-section,
.admin-section,
.portal-card,
.dashboard-card,
.member-order-card,
.inquiry-card,
.image-card{
  border:1px solid rgba(15,23,42,.06);
  border-radius:var(--gr-radius);
  box-shadow:var(--gr-shadow);
}

.form-box,
.card,
.gb2-legal-card,
.gb2-detail-section,
.admin-section{
  background:var(--gr-card);
  padding:24px;
}

input,
select,
textarea{
  width:100%;
  border:1px solid var(--gr-line);
  border-radius:14px;
  padding:12px 14px;
  background:#fff;
  color:var(--gr-text);
  outline:none;
  box-sizing:border-box;
}

input:focus,
select:focus,
textarea:focus{
  border-color:var(--gr-blue);
  box-shadow:0 0 0 4px rgba(0,113,227,.12);
}

label{
  display:block;
  margin:12px 0 6px;
  font-weight:900;
  color:#334155;
}

.btn,
.gb2-btn,
.grb-primary,
.grb-secondary,
.gb2-primary,
.gb2-secondary{
  border-radius:999px !important;
  font-weight:900 !important;
  text-decoration:none !important;
  transition:.2s ease !important;
}

.btn:hover,
.gb2-btn:hover,
.grb-primary:hover,
.grb-secondary:hover,
.gb2-primary:hover,
.gb2-secondary:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 26px rgba(15,23,42,.15);
}

.btn-orange,
.gb2-btn.primary,
.grb-primary,
.gb2-primary{
  background:linear-gradient(135deg,var(--gr-blue),var(--gr-blue2)) !important;
  color:#fff !important;
  border:0 !important;
}

.btn-dark{
  background:var(--gr-dark) !important;
  color:#fff !important;
}

.btn-danger{
  background:var(--gr-red) !important;
  color:#fff !important;
}

.admin-table{
  border-radius:18px;
  overflow:hidden;
}

.admin-table th{
  background:#f8fafc !important;
  color:#475569;
}

.admin-table td,
.admin-table th{
  border-color:#e5e7eb !important;
}

.dashboard-hero,
.portal-hero,
.grb-hero{
  position:relative;
  overflow:hidden;
}

.dashboard-hero::after,
.portal-hero::after,
.grb-hero::after{
  content:"";
  position:absolute;
  width:280px;
  height:280px;
  right:-90px;
  top:-120px;
  background:radial-gradient(circle,rgba(56,189,248,.34),transparent 68%);
  pointer-events:none;
}

.dashboard-grid,
.portal-stats{
  align-items:stretch;
}

.dashboard-card,
.portal-stat{
  min-height:112px;
}

.dashboard-card .num,
.portal-stat strong{
  letter-spacing:-.04em;
}

.status-pill,
.member-status,
.gb2-badge,
.portal-card .badge{
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.4);
}

.gb2-product-card{
  border-radius:26px !important;
  border:1px solid rgba(15,23,42,.06);
  box-shadow:var(--gr-shadow);
  overflow:hidden;
  transition:.2s ease;
}

.gb2-product-card:hover{
  transform:translateY(-2px);
  box-shadow:0 24px 70px rgba(15,23,42,.13);
}

.gb2-product-img{
  background:linear-gradient(135deg,#f8fafc,#eef2ff);
}

.gb2-product-price p{
  color:var(--gr-blue);
  font-weight:1000;
}

.portal-grid,
.admin-menu-grid,
.grb-why-grid{
  align-items:stretch;
}

.portal-card,
.admin-menu-card,
.grb-why-grid > div{
  transition:.2s ease;
}

.portal-card:hover,
.admin-menu-card:hover,
.grb-why-grid > div:hover{
  transform:translateY(-2px);
}

.grb-footer{
  margin-top:60px;
  border-top:1px solid rgba(255,255,255,.08);
}

@media(max-width:800px){
  .container,
  .gb2-container,
  .grb-main,
  .portal,
  .admin-dashboard{
    width:min(100% - 20px, 1280px);
  }

  .header-top,
  .grb-header{
    flex-wrap:wrap;
    gap:12px;
  }

  .grb-header nav,
  .gb2-nav{
    overflow-x:auto;
    white-space:nowrap;
    width:100%;
  }
}


/* Cart + layout fixes */
.gb-cart-hero{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:18px;
  background:#fff;
  border-radius:28px;
  padding:28px;
  box-shadow:var(--gr-shadow);
  margin:26px 0;
}

.gb-kicker{
  color:var(--gr-blue);
  font-weight:1000;
  letter-spacing:.12em;
  font-size:12px;
}

.gb-cart-layout{
  display:grid;
  grid-template-columns:1fr 360px;
  gap:22px;
  align-items:start;
}

.gb-cart-item{
  display:grid;
  grid-template-columns:150px 1fr 180px;
  gap:18px;
  background:#fff;
  border-radius:24px;
  padding:18px;
  box-shadow:var(--gr-shadow);
  margin-bottom:16px;
}

.gb-cart-img{
  background:#f8fafc;
  border-radius:18px;
  display:grid;
  place-items:center;
  overflow:hidden;
}

.gb-cart-img img{
  width:100%;
  height:130px;
  object-fit:contain;
}

.gb-cart-body h2{
  margin:0 0 8px;
}

.gb-cart-body p{
  color:#64748b;
}

.gb-cart-side{
  display:grid;
  gap:8px;
  align-content:start;
}

.gb-cart-side strong{
  color:var(--gr-blue);
  font-size:22px;
}

.gb-cart-options{
  background:#f8fafc;
  border-radius:14px;
  padding:10px;
  color:#475569;
  font-size:13px;
}

.gb-cart-summary{
  position:sticky;
  top:18px;
  background:#fff;
  border-radius:24px;
  padding:22px;
  box-shadow:var(--gr-shadow);
  display:grid;
  gap:12px;
}

.gb-cart-summary > div{
  display:flex;
  justify-content:space-between;
  gap:14px;
}

.gb-cart-summary .total{
  border-top:1px solid #e5e7eb;
  padding-top:14px;
  font-size:22px;
}

.gb-cart-coupon{
  display:grid !important;
  gap:8px;
  background:#f8fafc;
  border-radius:18px;
  padding:14px;
}

.form-actions,
.page-actions,
.grb-actions,
.portal-actions,
.preview-actions,
.image-actions,
.inquiry-actions{
  align-items:center;
}

.btn,
.gb2-btn,
.grb-primary,
.grb-secondary{
  display:inline-flex !important;
  justify-content:center;
  align-items:center;
  gap:8px;
  min-height:42px;
  line-height:1.2;
}

@media(max-width:900px){
  .gb-cart-layout{
    grid-template-columns:1fr;
  }

  .gb-cart-item{
    grid-template-columns:1fr;
  }

  .gb-cart-hero{
    display:grid;
  }

  .gb-cart-summary{
    position:static;
  }
}


/* Button alignment final fix */
.btn,
.gb2-btn,
.grb-primary,
.grb-secondary,
.gb2-primary,
.gb2-secondary,
.cart-link{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
  min-height:44px !important;
  padding:11px 18px !important;
  line-height:1.2 !important;
  vertical-align:middle !important;
  white-space:nowrap !important;
  box-sizing:border-box !important;
}

.grb-actions,
.portal-actions,
.preview-actions,
.image-actions,
.inquiry-actions,
.form-actions,
.page-actions{
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:center !important;
  gap:10px !important;
}

.portal-actions,
.inquiry-actions{
  align-items:stretch !important;
}

.portal-actions .btn,
.inquiry-actions .btn,
.image-actions .btn{
  width:auto !important;
}

.header-top{
  display:grid !important;
  grid-template-columns:auto 1fr auto !important;
  align-items:center !important;
  gap:14px !important;
}

.category-nav,
.grb-header nav{
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  flex-wrap:wrap !important;
}

.category-nav a,
.grb-header nav a{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-height:38px !important;
  padding:8px 12px !important;
}

.gb2-product-price{
  display:grid !important;
  gap:10px !important;
  align-content:end !important;
}

.gb2-product-price .gb2-btn,
.gb2-product-price .btn{
  width:100% !important;
}

.gb-cart-summary .btn,
.gb-cart-side .btn{
  width:100% !important;
}

.form-box > .btn,
.form-box > a.btn,
.form-box > button.btn{
  margin:6px 6px 6px 0 !important;
}

@media(max-width:700px){
  .grb-actions,
  .portal-actions,
  .preview-actions,
  .image-actions,
  .inquiry-actions,
  .form-actions,
  .page-actions{
    display:grid !important;
    grid-template-columns:1fr !important;
  }

  .btn,
  .gb2-btn,
  .grb-primary,
  .grb-secondary,
  .gb2-primary,
  .gb2-secondary{
    width:100% !important;
  }

  .header-top{
    grid-template-columns:1fr auto !important;
  }

  .header-top > div:nth-child(2){
    display:none !important;
  }
}


/* Product sales UI */
.product-card-actions{
  display:grid;
  gap:8px;
}

.product-card-actions .gb2-btn{
  width:100% !important;
}

.cart-btn{
  background:#111827 !important;
  color:#fff !important;
  border:0 !important;
  cursor:pointer;
}

.apple-spec-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:20px;
  overflow:hidden;
  box-shadow:var(--gr-shadow);
}

.apple-spec-table th,
.apple-spec-table td{
  padding:14px 16px;
  border-bottom:1px solid #e5e7eb;
  text-align:left;
  vertical-align:top;
}

.apple-spec-table th{
  width:190px;
  background:#f8fafc;
  color:#475569;
  font-weight:900;
}

.apple-spec-table tr:last-child th,
.apple-spec-table tr:last-child td{
  border-bottom:0;
}

@media(max-width:700px){
  .apple-spec-table th,
  .apple-spec-table td{
    display:block;
    width:100%;
  }

  .apple-spec-table th{
    border-bottom:0;
    padding-bottom:4px;
  }

  .apple-spec-table td{
    padding-top:4px;
  }
}


/* Product card click fix */
.gb2-product-card{
  cursor:pointer;
}

.gb2-product-card a,
.gb2-product-card button{
  cursor:pointer;
  position:relative;
  z-index:5;
}




/* Final Product View v2 */

.products-toolbar{
  display:grid;
  gap:14px;
  margin:20px 0 24px;
}

.products-count-card{
  background:#fff;
  border-radius:24px;
  padding:18px 22px;
  border:1px solid #e5e7eb;
  box-shadow:var(--gr-shadow);
}

.products-count-card h2{
  margin:0;
  font-size:24px;
}

.products-count-card p{
  margin:6px 0 0;
  color:#64748b;
}

.view-switch-wrap{
  display:flex;
  justify-content:flex-start;
}

.view-switch{
  display:inline-flex;
  gap:6px;
  padding:6px;
  border-radius:999px;
  background:#e2e8f0;
}

.view-btn{
  border:none;
  border-radius:999px;
  padding:12px 22px;
  font-weight:900;
  cursor:pointer;
  background:transparent;
  color:#475569;
}

.view-btn.active{
  background:#111827;
  color:#fff;
}

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

#product-list.view-list{
  display:grid;
  gap:14px;
}

#product-list.view-list .gb2-product-card{
  display:flex !important;
  gap:20px;
  align-items:center;
  padding:18px;
}

#product-list.view-list .gb2-product-img{
  width:180px;
  min-width:180px;
  height:140px;
}

#product-list.view-list .gb2-product-body{
  flex:1;
}

#product-list.view-list .gb2-product-price{
  width:220px;
  min-width:220px;
  display:grid;
  gap:8px;
}

#product-list.view-list .desc{
  display:none;
}

@media(max-width:1000px){

  #product-list.view-list .gb2-product-card{
    display:grid !important;
  }

  #product-list.view-list .gb2-product-img{
    width:100%;
    height:220px;
  }

  #product-list.view-list .gb2-product-price{
    width:auto;
  }
}


/* Product detail Amazon style */
.apple-detail-hero{
  display:grid;
  grid-template-columns:minmax(320px, 520px) 1fr 320px;
  gap:24px;
  align-items:start;
  margin:28px 0;
}

.apple-detail-image{
  background:#fff;
  border-radius:28px;
  padding:26px;
  box-shadow:var(--gr-shadow);
  position:sticky;
  top:18px;
}

.apple-detail-image img{
  width:100%;
  height:430px;
  object-fit:contain;
}

.apple-detail-panel{
  background:#fff;
  border-radius:28px;
  padding:28px;
  box-shadow:var(--gr-shadow);
}

.apple-detail-panel h1{
  font-size:30px;
  line-height:1.35;
  margin:14px 0;
}

.apple-detail-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.apple-detail-meta span{
  display:inline-flex;
  border-radius:999px;
  padding:7px 12px;
  background:#eef2ff;
  color:#3730a3;
  font-weight:900;
  font-size:13px;
}

.apple-detail-meta .available{
  background:#dcfce7;
  color:#166534;
}

.apple-detail-meta .soldout{
  background:#fee2e2;
  color:#991b1b;
}

.apple-detail-brand{
  color:#64748b;
  font-weight:900;
}

.apple-detail-desc{
  color:#475569;
  line-height:1.8;
}

.apple-detail-buybox{
  background:#fff;
  border-radius:28px;
  padding:24px;
  box-shadow:var(--gr-shadow);
  position:sticky;
  top:18px;
  display:grid;
  gap:14px;
}

.apple-detail-price{
  border-bottom:1px solid #e5e7eb;
  padding-bottom:14px;
}

.apple-detail-price strong{
  display:block;
  color:var(--gr-blue);
  font-size:34px;
  letter-spacing:-.04em;
}

.apple-detail-price span{
  color:#64748b;
}

.apple-detail-actions{
  display:grid;
  gap:10px;
}

.apple-main-btn,
.apple-sub-btn{
  display:flex !important;
  align-items:center;
  justify-content:center;
  min-height:48px;
  border-radius:999px;
  text-decoration:none;
  font-weight:900;
}

.apple-main-btn{
  border:0;
  background:linear-gradient(135deg,var(--gr-blue),var(--gr-blue2));
  color:white;
  cursor:pointer;
}

.apple-main-btn.disabled{
  background:#94a3b8;
  cursor:not-allowed;
}

.apple-sub-btn{
  background:#f1f5f9;
  color:#111827;
}

.apple-mini-note{
  background:#f8fafc;
  border-radius:18px;
  padding:14px;
  color:#475569;
  font-size:13px;
}

.apple-section{
  background:#fff;
  border-radius:28px;
  padding:26px;
  box-shadow:var(--gr-shadow);
  margin:22px 0;
}

.apple-section h2{
  margin-top:0;
}

@media(max-width:1100px){
  .apple-detail-hero{
    grid-template-columns:1fr;
  }

  .apple-detail-image,
  .apple-detail-buybox{
    position:static;
  }
}

@media(max-width:700px){
  .apple-detail-panel h1{
    font-size:24px;
  }

  .apple-detail-image img{
    height:300px;
  }
}


/* Products page redesign */
.products-page{
  width:min(1320px, calc(100% - 32px));
  margin:0 auto;
  padding:28px 0 70px;
}

.products-hero{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:20px;
  background:linear-gradient(135deg,#020617,#111827);
  color:#fff;
  border-radius:34px;
  padding:36px;
  box-shadow:0 22px 70px rgba(15,23,42,.20);
  margin-bottom:22px;
}

.products-hero p{
  margin:0 0 8px;
  color:#38bdf8;
  font-weight:1000;
  letter-spacing:.14em;
}

.products-hero h1{
  margin:0;
  font-size:42px;
  letter-spacing:-.04em;
}

.products-hero span{
  display:block;
  color:#cbd5e1;
  margin-top:10px;
}

.products-search-panel{
  background:#fff;
  border-radius:30px;
  padding:24px;
  box-shadow:var(--gr-shadow);
  border:1px solid #e5e7eb;
  margin-bottom:18px;
}

.products-search-main{
  margin-bottom:18px;
}

.products-search-box{
  display:grid;
  grid-template-columns:1fr 120px;
  gap:12px;
}

.products-filter-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  align-items:end;
}

.stock-check{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  height:46px;
  border:1px solid #e5e7eb;
  border-radius:16px;
  background:#f8fafc;
  margin:0;
}

.stock-check input{
  width:auto;
}

.products-category-chips{
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding:4px 0 18px;
}

.products-category-chips .cat-btn{
  border:1px solid #e5e7eb;
  background:#fff;
  color:#334155;
  border-radius:999px;
  padding:11px 18px;
  font-weight:900;
  white-space:nowrap;
  cursor:pointer;
  box-shadow:0 8px 24px rgba(15,23,42,.06);
}

.products-category-chips .cat-btn.active{
  background:#111827;
  color:#fff;
  border-color:#111827;
}

.products-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  margin:8px 0 22px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:26px;
  padding:16px;
  box-shadow:var(--gr-shadow);
}

.products-count-card{
  background:transparent;
  box-shadow:none;
  border:0;
  padding:0;
}

.products-count-card h2{
  margin:0;
  font-size:22px;
}

.products-count-card p{
  margin:4px 0 0;
  color:#64748b;
}

.view-switch{
  display:flex;
  gap:8px;
  background:#f1f5f9;
  padding:6px;
  border-radius:999px;
  flex-shrink:0;
}

.view-btn{
  border:0;
  border-radius:999px;
  padding:11px 18px;
  background:transparent;
  color:#64748b;
  font-weight:900;
  cursor:pointer;
}

.view-btn.active{
  background:#111827;
  color:#fff;
}

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

.products-list.view-grid .gb2-product-card{
  display:grid;
  grid-template-rows:230px 1fr auto;
  overflow:hidden;
}

.products-list.view-grid .gb2-product-img{
  height:230px;
}

.products-list.view-grid .gb2-product-img img{
  height:100%;
  object-fit:contain;
}

.products-list.view-list{
  display:grid;
  gap:14px;
}

.products-list.view-list .gb2-product-card{
  display:grid !important;
  grid-template-columns:160px 1fr 230px;
  align-items:center;
  gap:18px;
  padding:16px;
}

.products-list.view-list .gb2-product-img{
  height:130px;
  min-height:130px;
}

.products-list.view-list .gb2-product-img img{
  height:130px;
  object-fit:contain;
}

.products-list.view-list .gb2-product-body h2{
  font-size:18px;
  margin-top:0;
}

.products-list.view-list .desc{
  display:none;
}

.products-list.view-list .gb2-specs{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px;
}

.products-list.view-list .gb2-product-price{
  display:grid;
  gap:8px;
  align-content:center;
}

.product-card-actions{
  display:grid;
  gap:8px;
}

.product-card-actions .gb2-btn{
  width:100% !important;
}

.cart-btn{
  background:#111827 !important;
  color:#fff !important;
  border:0 !important;
  cursor:pointer;
}

.more-products-wrap{
  grid-column:1/-1;
  text-align:center;
  padding:30px;
}

.gb2-product-card{
  cursor:pointer;
}

.gb2-product-card a,
.gb2-product-card button{
  position:relative;
  z-index:5;
}

@media(max-width:900px){
  .products-page{
    width:min(100% - 20px, 1320px);
  }

  .products-hero{
    display:grid;
    padding:26px;
  }

  .products-hero h1{
    font-size:32px;
  }

  .products-search-box{
    grid-template-columns:1fr;
  }

  .products-filter-grid{
    grid-template-columns:1fr;
  }

  .products-toolbar{
    display:grid;
  }

  .view-switch{
    width:100%;
  }

  .view-btn{
    flex:1;
  }

  .products-list.view-list .gb2-product-card{
    grid-template-columns:1fr;
  }

  .products-list.view-list .gb2-product-img{
    height:220px;
  }

  .products-list.view-list .gb2-product-img img{
    height:220px;
  }
}


/* Product detail complete pack */
.product-gallery{
  display:grid;
  gap:14px;
}

#galleryMainImage{
  width:100%;
  height:430px;
  object-fit:contain;
}

.gallery-thumbs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.gallery-thumbs button{
  border:1px solid #e5e7eb;
  background:#fff;
  border-radius:14px;
  padding:6px;
  cursor:pointer;
}

.gallery-thumbs img{
  width:76px;
  height:58px;
  object-fit:contain;
}

.product-title-row{
  display:grid;
  gap:12px;
}

.product-title-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.favorite-result{
  color:#0071e3;
  font-weight:900;
}

.review-list{
  display:grid;
  gap:12px;
  margin-bottom:22px;
}

.review-form{
  background:#f8fafc;
  border-radius:22px;
  padding:18px;
}

.related-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(210px,1fr));
  gap:16px;
}

.related-card{
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:22px;
  padding:14px;
  text-decoration:none;
  color:#111827;
}

.related-card div{
  height:130px;
  background:#eef2ff;
  border-radius:16px;
  display:grid;
  place-items:center;
}

.related-card img{
  max-width:100%;
  max-height:120px;
  object-fit:contain;
}

.related-card h3{
  font-size:15px;
  line-height:1.5;
}

.related-card p{
  color:#64748b;
}

.related-card strong{
  color:#0071e3;
  font-size:18px;
}


/* Compare page */
.compare-page{
  width:min(1320px, calc(100% - 32px));
  margin:0 auto;
  padding-bottom:70px;
}

.compare-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:20px 0;
}

.compare-empty{
  background:#fff;
  border-radius:28px;
  padding:30px;
  box-shadow:var(--gr-shadow);
}

.compare-scroll{
  overflow-x:auto;
  background:#fff;
  border-radius:28px;
  box-shadow:var(--gr-shadow);
  border:1px solid #e5e7eb;
}

.compare-table{
  min-width:900px;
  width:100%;
  border-collapse:separate;
  border-spacing:0;
}

.compare-table th,
.compare-table td{
  border-bottom:1px solid #e5e7eb;
  border-right:1px solid #e5e7eb;
  padding:16px;
  vertical-align:top;
  text-align:left;
}

.compare-table th:first-child{
  width:160px;
  background:#f8fafc;
  position:sticky;
  left:0;
  z-index:2;
}

.compare-product-head{
  display:grid;
  gap:10px;
  min-width:220px;
}

.compare-product-head img{
  width:100%;
  height:150px;
  object-fit:contain;
  background:#f8fafc;
  border-radius:16px;
}

.compare-product-head strong{
  line-height:1.5;
}

.compare-product-head span{
  color:#0071e3;
  font-weight:1000;
  font-size:20px;
}


/* Phase1 current bug fixes */
img{
  max-width:100%;
}

.gb2-product-img,
.apple-detail-image,
.img-wrap,
.related-card div,
.compare-product-head img,
.gb-cart-img{
  overflow:hidden;
}

.gb2-product-img img,
.apple-detail-image img,
#galleryMainImage,
.gb2-home-card img,
.related-card img,
.gb-cart-img img,
.compare-product-head img{
  object-fit:contain !important;
}

.apple-detail-image img,
#galleryMainImage{
  width:100% !important;
  max-height:520px !important;
  height:auto !important;
  aspect-ratio:4 / 3;
  object-fit:contain !important;
}

.gb2-product-img img{
  width:100% !important;
  height:100% !important;
  object-fit:contain !important;
}

.header-member-links{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.header-member-links a,
.header-member-links span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding:8px 12px;
  border-radius:999px;
  background:#f1f5f9;
  color:#334155;
  font-weight:900;
  text-decoration:none;
  font-size:13px;
}

.header-member-links .member-name{
  background:#111827;
  color:#fff;
}

@media(max-width:800px){
  .header-member-links{
    grid-column:1/-1;
    overflow-x:auto;
    flex-wrap:nowrap;
  }
}


/* BTO Builder v2 */
.bto-v2-page{
  width:min(1320px, calc(100% - 32px));
  margin:0 auto;
  padding-bottom:70px;
}

.bto-v2-layout{
  display:grid;
  grid-template-columns:1fr 430px;
  gap:22px;
  align-items:start;
}

.bto-v2-config,
.bto-v2-result{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:32px;
  padding:26px;
  box-shadow:var(--gr-shadow);
}

.bto-v2-config h2{
  margin-top:0;
}

.bto-v2-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}

.bto-field{
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:22px;
  padding:14px;
}

.bto-field label{
  margin-top:0;
}

.bto-v2-result{
  position:sticky;
  top:18px;
  display:grid;
  gap:16px;
}

.bto-total-card{
  background:linear-gradient(135deg,#020617,#111827);
  color:#fff;
  border-radius:26px;
  padding:24px;
}

.bto-total-card p{
  color:#38bdf8;
  font-weight:1000;
  margin:0 0 8px;
}

.bto-total-card strong{
  display:block;
  font-size:38px;
  letter-spacing:-.04em;
}

.bto-total-card span{
  color:#cbd5e1;
}

.bto-v2-mini{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
}

.bto-v2-mini div,
.bto-check-card,
.bto-score-card,
.bto-game-card,
.bto-summary-card{
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:22px;
  padding:16px;
}

.bto-v2-mini span{
  display:block;
  color:#64748b;
  font-size:12px;
  font-weight:900;
}

.bto-v2-mini strong{
  display:block;
  margin-top:5px;
}

.compat-message{
  border-radius:14px;
  padding:10px 12px;
  margin:8px 0;
  font-weight:900;
  line-height:1.6;
}

.compat-message.ok{
  background:#dcfce7;
  color:#166534;
}

.compat-message.warning{
  background:#fef3c7;
  color:#92400e;
}

.compat-message.error{
  background:#fee2e2;
  color:#991b1b;
}

.bto-score-table{
  width:100%;
  border-collapse:collapse;
}

.bto-score-table th,
.bto-score-table td{
  padding:8px;
  border-bottom:1px solid #e5e7eb;
}

.score-bar{
  height:10px;
  border-radius:999px;
  background:#e5e7eb;
  overflow:hidden;
  width:100%;
}

.score-bar span{
  display:block;
  height:100%;
  background:linear-gradient(135deg,#0071e3,#38bdf8);
}

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

@media(max-width:1100px){
  .bto-v2-layout{
    grid-template-columns:1fr;
  }

  .bto-v2-result{
    position:static;
  }
}

@media(max-width:700px){
  .bto-v2-page{
    width:min(100% - 20px,1320px);
  }

  .bto-v2-grid{
    grid-template-columns:1fr;
  }

  .bto-v2-mini{
    grid-template-columns:1fr;
  }
}


/* Product variants and tag filter */
.variant-groups{
  display:grid;
  gap:18px;
}

.variant-group{
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:22px;
  padding:16px;
}

.variant-group h3{
  margin-top:0;
}

.variant-buttons{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.variant-btn{
  border:1px solid #dbe3ef;
  background:#fff;
  border-radius:18px;
  padding:12px 16px;
  cursor:pointer;
  display:grid;
  gap:4px;
  min-width:120px;
}

.variant-btn strong{
  color:#111827;
}

.variant-btn span{
  color:#64748b;
  font-size:13px;
}

.variant-btn.active{
  border-color:#0071e3;
  box-shadow:0 0 0 4px rgba(0,113,227,.12);
}

#tagFilter{
  min-width:160px;
}


/* Admin product variants/tags */
.admin-grid-2{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.tag-check-grid{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.tag-check{
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:999px;
  padding:9px 13px;
  font-weight:900;
  margin:0;
}

.tag-check input{
  width:auto;
}

@media(max-width:700px){
  .admin-grid-2{
    grid-template-columns:1fr;
  }
}


/* Product gallery v2 */
.product-gallery-v2{
  display:grid;
  gap:14px;
}

.gallery-main-btn{
  border:0;
  background:#f8fafc;
  border-radius:24px;
  padding:18px;
  cursor:zoom-in;
  width:100%;
}

.gallery-main-btn img{
  width:100%;
  height:460px;
  object-fit:contain;
}

.gallery-thumb-row{
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding-bottom:4px;
}

.gallery-thumb{
  flex:0 0 auto;
  width:82px;
  height:68px;
  border:1px solid #e5e7eb;
  background:#fff;
  border-radius:14px;
  padding:5px;
  cursor:pointer;
}

.gallery-thumb.active{
  border-color:#0071e3;
  box-shadow:0 0 0 4px rgba(0,113,227,.12);
}

.gallery-thumb img{
  width:100%;
  height:100%;
  object-fit:contain;
}

.gallery-note{
  color:#64748b;
  font-size:13px;
  text-align:center;
}

.gallery-modal{
  position:fixed;
  inset:0;
  background:rgba(2,6,23,.82);
  display:none;
  place-items:center;
  z-index:9999;
  padding:24px;
}

.gallery-modal.show{
  display:grid;
}

.gallery-modal img{
  max-width:min(100%,1100px);
  max-height:86vh;
  object-fit:contain;
  background:#fff;
  border-radius:24px;
  padding:20px;
}

.gallery-close{
  position:fixed;
  top:20px;
  right:24px;
  width:46px;
  height:46px;
  border:0;
  border-radius:999px;
  background:#fff;
  color:#111827;
  font-size:28px;
  cursor:pointer;
}

@media(max-width:700px){
  .gallery-main-btn img{
    height:300px;
  }

  .gallery-thumb{
    width:70px;
    height:58px;
  }
}


/* My Page v2 */
.mypage-v2{
  width:min(1320px, calc(100% - 32px));
  margin:0 auto;
  padding-bottom:70px;
}

.mypage-stats{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:14px;
  margin:20px 0;
}

.mypage-stats div{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:24px;
  padding:20px;
  box-shadow:var(--gr-shadow);
}

.mypage-stats span{
  display:block;
  color:#64748b;
  font-weight:900;
  font-size:13px;
}

.mypage-stats strong{
  display:block;
  margin-top:6px;
  font-size:28px;
}

.mypage-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:24px;
  padding:16px;
  box-shadow:var(--gr-shadow);
  margin-bottom:20px;
}

.mypage-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}

.mypage-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:28px;
  padding:24px;
  box-shadow:var(--gr-shadow);
}

.mypage-card.full{
  grid-column:1/-1;
}

.info-list{
  display:grid;
  gap:10px;
}

.info-list p{
  display:grid;
  gap:4px;
  background:#f8fafc;
  border-radius:16px;
  padding:12px;
  margin:0;
}

.info-list span{
  color:#64748b;
  font-weight:900;
  font-size:13px;
}

.mypage-order-row,
.mypage-product-mini{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:14px;
  margin:10px 0;
  color:#111827;
  text-decoration:none;
}

.mypage-order-row p,
.mypage-product-mini p{
  color:#64748b;
  margin:4px 0 0;
}

.mypage-product-mini span{
  font-weight:900;
  color:#0071e3;
}

.order-detail-card{
  background:#f8fafc;
  border-radius:22px;
  padding:18px;
}

@media(max-width:900px){
  .mypage-v2{
    width:min(100% - 20px,1320px);
  }

  .mypage-grid{
    grid-template-columns:1fr;
  }

  .mypage-order-row,
  .mypage-product-mini{
    display:grid;
  }
}


/* Product detail v3 */
.product-detail-tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:12px 0;
}

.product-detail-tags span{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:8px 12px;
  background:#eef2ff;
  color:#3730a3;
  font-weight:900;
  font-size:13px;
}

.product-score-v2{
  display:grid;
  gap:14px;
}

.product-score-row{
  display:grid;
  grid-template-columns:150px 1fr 70px;
  gap:14px;
  align-items:center;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:14px;
}

.product-score-row strong{
  display:block;
}

.product-score-row span{
  display:block;
  color:#64748b;
  font-size:13px;
  margin-top:4px;
}

.product-score-bar{
  height:12px;
  background:#e5e7eb;
  border-radius:999px;
  overflow:hidden;
}

.product-score-bar span{
  display:block;
  height:100%;
  background:linear-gradient(135deg,#0071e3,#38bdf8);
}

.product-score-row b{
  color:#0071e3;
  font-size:22px;
  text-align:right;
}

.related-grid-v3{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:16px;
}

.related-card-v3{
  display:grid;
  gap:12px;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:24px;
  padding:14px;
  color:#111827;
  text-decoration:none;
}

.related-img-v3{
  height:150px;
  display:grid;
  place-items:center;
  background:#eef2ff;
  border-radius:18px;
}

.related-img-v3 img{
  max-width:100%;
  max-height:140px;
  object-fit:contain;
}

.related-card-v3 h3{
  font-size:16px;
  line-height:1.5;
  margin:0;
}

.related-card-v3 p{
  color:#64748b;
  margin:4px 0;
}

.related-card-v3 strong{
  color:#0071e3;
  font-size:20px;
}

@media(max-width:700px){
  .product-score-row{
    grid-template-columns:1fr;
  }

  .product-score-row b{
    text-align:left;
  }
}


/* BTO Builder v4 */
.bto-power-card{
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:22px;
  padding:16px;
}

.power-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.power-grid div{
  background:#fff;
  border-radius:16px;
  padding:12px;
}

.power-grid span{
  display:block;
  color:#64748b;
  font-size:12px;
  font-weight:900;
}

.power-grid strong{
  display:block;
  margin-top:4px;
  font-size:18px;
  color:#111827;
}

@media(max-width:700px){
  .power-grid{
    grid-template-columns:1fr;
  }
}


/* Compare v2 */
.compare-v2-summary{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:14px;
  margin:18px 0;
}

.compare-v2-summary div{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:22px;
  padding:18px;
  box-shadow:var(--gr-shadow);
}

.compare-v2-summary span{
  display:block;
  color:#64748b;
  font-size:13px;
  font-weight:900;
}

.compare-v2-summary strong{
  display:block;
  margin-top:6px;
  font-size:26px;
}

.compare-v2-table .compare-product-actions{
  display:grid;
  gap:8px;
}

.compare-v2-table .compare-product-actions .btn{
  width:100%;
}

.compare-v2-table .diff-row td,
.compare-v2-table .diff-row th{
  background:#f8fafc;
}

.compare-v2-table td.best-cell{
  background:#e0f2fe !important;
  color:#075985;
  font-weight:1000;
}

.compare-note{
  color:#64748b;
  font-size:13px;
  margin-top:12px;
}

@media(max-width:700px){
  .compare-product-head{
    min-width:190px;
  }
}


/* Review management / product reply */
.review-admin-reply{
  margin-top:12px;
  background:#f8fafc;
  border-left:4px solid #0071e3;
  border-radius:14px;
  padding:12px 14px;
}

.review-admin-reply strong{
  display:block;
  color:#0071e3;
  margin-bottom:6px;
}


/* BTO FPS and completion */
.bto-rank-card{
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:22px;
  padding:16px;
}

.bto-rank-card strong{
  display:block;
  font-size:32px;
  letter-spacing:-.04em;
  color:#0071e3;
}

.completion-bar{
  height:12px;
  background:#e5e7eb;
  border-radius:999px;
  overflow:hidden;
  margin:12px 0;
}

.completion-bar span{
  display:block;
  height:100%;
  background:linear-gradient(135deg,#0071e3,#38bdf8);
}

.completion-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}

.completion-list div{
  background:#fff;
  border-radius:12px;
  padding:8px 10px;
  font-weight:900;
}

.completion-list span{
  display:inline-grid;
  place-items:center;
  width:20px;
  height:20px;
  border-radius:999px;
  margin-right:6px;
  font-size:12px;
}

.completion-list .ok span{
  background:#dcfce7;
  color:#166534;
}

.completion-list .ng span{
  background:#fee2e2;
  color:#991b1b;
}

@media(max-width:700px){
  .completion-list{
    grid-template-columns:1fr;
  }
}


/* Related products v1 */
.related-product-grid-v1{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:16px;
}

.related-product-card-v1{
  display:grid;
  gap:12px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:24px;
  padding:14px;
  color:#111827;
  text-decoration:none;
  box-shadow:0 14px 40px rgba(15,23,42,.08);
  transition:.2s ease;
}

.related-product-card-v1:hover{
  transform:translateY(-3px);
  box-shadow:0 20px 55px rgba(15,23,42,.12);
}

.related-product-img-v1{
  height:150px;
  display:grid;
  place-items:center;
  background:#f8fafc;
  border-radius:18px;
}

.related-product-img-v1 img{
  max-width:100%;
  max-height:140px;
  object-fit:contain;
}

.related-product-body-v1 span{
  color:#64748b;
  font-size:12px;
  font-weight:900;
}

.related-product-body-v1 h3{
  font-size:16px;
  line-height:1.5;
  margin:6px 0;
}

.related-product-body-v1 p{
  color:#64748b;
  font-size:13px;
  min-height:20px;
}

.related-product-body-v1 strong{
  display:block;
  color:#0071e3;
  font-size:20px;
}

.related-product-body-v1 small{
  display:inline-flex;
  margin-top:8px;
  background:#eef2ff;
  color:#3730a3;
  border-radius:999px;
  padding:6px 10px;
  font-weight:900;
}


/* Favorites */
#favoriteBtn{
  margin-top:10px;
  width:100%;
}


/* Order progress */
.order-progress{
  display:grid;
  grid-template-columns:repeat(8,1fr);
  gap:8px;
  margin:18px 0;
  position:relative;
}

.order-progress-step{
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:16px;
  padding:12px 8px;
  text-align:center;
}

.order-progress-step span{
  display:inline-grid;
  place-items:center;
  width:28px;
  height:28px;
  border-radius:999px;
  background:#e5e7eb;
  color:#64748b;
  font-weight:1000;
  margin-bottom:6px;
}

.order-progress-step p{
  margin:0;
  font-size:12px;
  font-weight:900;
  color:#64748b;
}

.order-progress-step.done{
  background:#eff6ff;
  border-color:#bfdbfe;
}

.order-progress-step.done span{
  background:#0071e3;
  color:#fff;
}

.order-progress-step.current{
  box-shadow:0 0 0 3px rgba(0,113,227,.15);
}

.order-progress-step.current p{
  color:#0071e3;
}

@media(max-width:900px){
  .order-progress{
    grid-template-columns:repeat(4,1fr);
  }
}

@media(max-width:520px){
  .order-progress{
    grid-template-columns:repeat(2,1fr);
  }
}
