/* ArtVerse — คำสั่งซื้อของฉัน บัญชีผู้ซื้อ และการซื้อของฉัน
   ไฟล์นี้เป็นส่วนหนึ่งของ css/parts/*.css โหลดตามลำดับเลขหน้าไฟล์ (ลำดับมีผล: ไฟล์หลังทับไฟล์ก่อน) */

/* =========================================================
   Buyer orders page — reference layout
   ========================================================= */
body[data-page="orders"]{
  background:#f5f5f5;
  color:#111;
}
body[data-page="orders"] .site-header{
  position:sticky;
  top:0;
  z-index:80;
  background:#fff;
  box-shadow:none;
  border-bottom:1px solid #ececec;
}
body[data-page="orders"] .site-header .wrap{width:min(1290px,calc(100% - 32px))}
body[data-page="orders"] .reference-topbar{
  min-height:64px;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:30px;
  border-bottom:0;
}
body[data-page="orders"] .reference-category-nav{display:none}
body[data-page="orders"] .brand{gap:7px}
body[data-page="orders"] .brand-mark{width:34px;height:34px;font-size:20px;background:#ffdc23;color:#151515;box-shadow:none}
body[data-page="orders"] .brand-name{font-size:27px;color:#171717;letter-spacing:-1.2px}
body[data-page="orders"] .reference-main-nav{justify-content:flex-start;gap:27px;font-size:13px;color:#151515;font-weight:800}
body[data-page="orders"] .reference-main-nav a{opacity:1}
body[data-page="orders"] .reference-actions{gap:7px}
body[data-page="orders"] .reference-actions .pill,
body[data-page="orders"] .reference-actions .icon-link,
body[data-page="orders"] .reference-actions .profile-drawer-btn{height:34px;border:1px solid #ddd;background:#fff;color:#222;box-shadow:none}
body[data-page="orders"] .reference-actions .currency-pill{min-width:66px;padding:0 12px;font-size:11px}
body[data-page="orders"] .reference-actions .icon-link{width:34px;font-size:14px}
body[data-page="orders"] .reference-actions .profile-drawer-btn{min-width:58px;padding:0 8px}
body[data-page="orders"] .reference-actions .profile-drawer-avatar{width:22px;height:22px;font-size:12px}
body[data-page="orders"] .footer{display:none}
#ordersApp.wrap{
  width:min(650px,calc(100% - 28px));
  padding:18px 0 80px;
}
.orders-reference-page{width:100%}
.orders-reference-title-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 305px;
  align-items:center;
  gap:24px;
  margin-bottom:16px;
}
.orders-reference-title-row h1{margin:0;font-size:27px;line-height:1.2;font-weight:900;color:#111;letter-spacing:-.4px}
.orders-search{height:34px;display:grid;grid-template-columns:1fr 34px;border:1px solid #dedede;border-radius:5px;overflow:hidden;background:#fff}
.orders-search input{width:100%;min-width:0;border:0;background:#fff;color:#222;padding:0 12px;font-size:10px;outline:0}
.orders-search input::placeholder{color:#c0c0c0}
.orders-search button{border:0;border-left:1px solid #dedede;background:#fff;color:#444;cursor:pointer;font-size:18px;display:grid;place-items:center}
.orders-tabs{display:flex;align-items:flex-end;gap:28px;border-bottom:1px solid #e9e9e9;overflow-x:auto;scrollbar-width:none;margin-bottom:0}
.orders-tabs::-webkit-scrollbar{display:none}
.orders-tabs a{position:relative;flex:0 0 auto;padding:12px 0 11px;color:#222;font-size:11px;font-weight:700;white-space:nowrap}
.orders-tabs a.active{color:#111}
.orders-tabs a.active::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;background:#2877ed;border-radius:2px}
.orders-content{min-height:250px;padding-top:20px}
.orders-empty-state{min-height:205px;display:grid;place-items:center;align-content:center;gap:9px;color:#aaa}
.orders-empty-state p{margin:0;font-size:12px;color:#aaa}
.orders-empty-icon{position:relative;width:74px;height:62px;display:grid;place-items:center;color:#d5d5d5}
.orders-empty-icon>span{width:50px;height:42px;border-radius:4px 4px 8px 8px;background:#dedede;color:#f3f3f3;display:grid;place-items:center;font-size:25px;box-shadow:inset 0 -7px 0 #d1d1d1}
.orders-empty-icon>i{position:absolute;right:0;top:0;width:28px;height:19px;border-radius:999px;background:#d7d7d7;color:#fff;font-size:9px;font-style:normal;display:grid;place-items:center;letter-spacing:1px}
.orders-pagination{display:flex;align-items:center;justify-content:flex-end;gap:11px;margin-top:14px;color:#999;font-size:11px}
.orders-pagination>a{width:28px;height:28px;display:grid;place-items:center;border-radius:4px;color:#aaa;font-size:18px}
.orders-pagination>a:not(.disabled):hover{background:#fff;color:#2877ed}
.orders-pagination>a.disabled{opacity:.35;pointer-events:none}
.orders-pagination>span{width:28px;height:28px;border-radius:5px;background:#fff;color:#222;display:grid;place-items:center}
.orders-pagination select{height:30px;border:1px solid #d9d9d9;border-radius:5px;background:#fff;color:#333;padding:0 9px;font-size:10px;outline:0}
.buyer-order-list{display:grid;gap:10px}
.buyer-order-card{background:#fff;border:1px solid #ebebeb;border-radius:7px;overflow:hidden}
.buyer-order-card-head{min-height:49px;padding:9px 14px;display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #ededed}
.buyer-order-seller{display:flex;align-items:center;gap:9px;min-width:0}
.buyer-order-avatar{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:#eee;font-size:14px;flex:0 0 auto}
.buyer-order-seller div{display:grid;gap:1px;min-width:0}
.buyer-order-seller strong{font-size:10px;color:#222;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.buyer-order-seller small{font-size:8px;color:#aaa}
.buyer-order-status{font-size:9px;font-weight:700;white-space:nowrap}
.buyer-order-status.pay{color:#ff5a5a}
.buyer-order-status.ship{color:#2877ed}
.buyer-order-status.receive{color:#f59e0b}
.buyer-order-status.done{color:#20a36a}
.buyer-order-status.cancel{color:#999}
.buyer-order-status.refund{color:#9457d6}
.buyer-order-items{display:grid}
.buyer-order-item{display:grid;grid-template-columns:74px minmax(0,1fr) auto;gap:12px;padding:13px 14px;color:#222;border-bottom:1px solid #f1f1f1}
.buyer-order-item:last-child{border-bottom:0}
.buyer-order-item:hover{background:#fafafa}
.buyer-order-item img{width:74px;height:74px;object-fit:cover;border-radius:5px;background:#f2f2f2}
.buyer-order-item-info{min-width:0;display:flex;flex-direction:column;gap:4px;padding-top:2px}
.buyer-order-item-info strong{font-size:10px;line-height:1.45;color:#222;font-weight:700}
.buyer-order-item-info span{font-size:9px;color:#aaa}
.buyer-order-item-info small{font-size:8px;color:#777;margin-top:auto}
.buyer-order-item-price{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:8px;padding-left:10px}
.buyer-order-item-price span{font-size:9px;color:#999}
.buyer-order-item-price strong{font-size:10px;color:#ff5555}
.buyer-order-card-foot{min-height:49px;padding:10px 14px;display:flex;align-items:center;justify-content:space-between;gap:15px;border-top:1px solid #ededed}
.buyer-order-card-foot>span{font-size:8px;color:#aaa}
.buyer-order-card-foot>div{display:flex;align-items:baseline;gap:9px}
.buyer-order-card-foot small{font-size:9px;color:#777}
.buyer-order-card-foot strong{font-size:12px;color:#ff5555}
.buyer-order-card-actions{min-height:52px;padding:10px 14px;display:flex;align-items:center;justify-content:flex-end;border-top:1px solid #ededed;background:#fff}
.buyer-order-cancel-btn{min-width:66px;height:31px;padding:0 18px;border:1px solid #dedede;border-radius:6px;background:#fff;color:#333;font:inherit;font-size:10px;font-weight:700;cursor:pointer;transition:border-color .18s,color .18s,background .18s}
.buyer-order-cancel-btn:hover{border-color:#ff5a5a;color:#e74646;background:#fffafa}
.buyer-order-cancel-btn:disabled{cursor:wait;opacity:.6}
.order-cancel-modal-backdrop{position:fixed;z-index:8000;inset:0;padding:20px;background:rgba(17,24,39,.58);display:none;align-items:center;justify-content:center;overflow-y:auto}
.order-cancel-modal-backdrop.open{display:flex}
.order-cancel-dialog{width:min(480px,100%);max-height:calc(100vh - 40px);overflow-y:auto;border-radius:12px;background:#fff;box-shadow:0 22px 60px rgba(0,0,0,.24);padding:22px 24px;color:#222}
.order-cancel-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:7px}
.order-cancel-dialog-head h2{margin:0;font-size:20px;line-height:1.35;font-weight:900}
.order-cancel-dialog-head button{width:32px;height:32px;border:0;border-radius:50%;background:transparent;color:#777;font-size:25px;line-height:1;cursor:pointer}
.order-cancel-dialog-head button:hover{background:#f3f3f3;color:#222}
.order-cancel-dialog>p{margin:0 0 16px;color:#666;font-size:13px}
.order-cancel-reason-list{margin:0;padding:0;list-style:none;counter-reset:cancel-reason;display:grid;border:1px solid #e6e6e6;border-radius:9px;overflow:hidden}
.order-cancel-reason-list li{counter-increment:cancel-reason;border-bottom:1px solid #ededed}
.order-cancel-reason-list li:last-child{border-bottom:0}
.order-cancel-reason-list label{min-height:48px;padding:9px 13px;display:grid;grid-template-columns:25px 18px minmax(0,1fr);align-items:center;gap:8px;cursor:pointer;font-size:13px}
.order-cancel-reason-list label::before{content:counter(cancel-reason) ".";color:#555;font-weight:700}
.order-cancel-reason-list label:hover{background:#f8fbff}
.order-cancel-reason-list input{width:17px;height:17px;margin:0;accent-color:#2877ed}
.order-cancel-reason-list input:checked+span{color:#146be3;font-weight:700}
.order-cancel-other{display:none;gap:7px;margin-top:12px;font-size:12px;font-weight:700}
.order-cancel-other.open{display:grid}
.order-cancel-other textarea{width:100%;resize:vertical;border:1px solid #ddd;border-radius:7px;padding:10px 11px;color:#222;font:inherit;font-size:12px;outline:0}
.order-cancel-other textarea:focus{border-color:#2877ed;box-shadow:0 0 0 3px rgba(40,119,237,.11)}
.order-cancel-error{min-height:18px;margin-top:8px;color:#dc3434;font-size:11px}
.order-cancel-dialog-actions{display:flex;align-items:center;justify-content:flex-end;gap:9px;margin-top:5px}
.order-cancel-dialog-actions button{height:35px;padding:0 17px;border-radius:7px;font:inherit;font-size:11px;font-weight:800;cursor:pointer}
.order-cancel-dismiss{border:1px solid #ddd;background:#fff;color:#444}
.order-cancel-confirm{border:1px solid #e94e4e;background:#e94e4e;color:#fff}
.order-cancel-confirm:hover{background:#d83f3f}
.order-cancel-confirm:disabled{cursor:wait;opacity:.65}
@media(max-width:900px){body[data-page="orders"] .reference-main-nav{display:none}}
@media(max-width:640px){body[data-page="orders"] .site-header{display:none}
#ordersApp.wrap{width:calc(100% - 20px);padding:18px 0 48px}
.orders-reference-title-row{grid-template-columns:1fr;gap:12px}
.orders-reference-title-row h1{font-size:25px}
.orders-search{width:100%}
.orders-tabs{gap:22px}
.buyer-order-item{grid-template-columns:64px minmax(0,1fr);gap:10px}
.buyer-order-item img{width:64px;height:64px}
.buyer-order-item-price{grid-column:2;flex-direction:row;justify-content:space-between;padding-left:0}
.buyer-order-cancel-btn{min-width:82px}
.order-cancel-modal-backdrop{padding:10px;align-items:flex-end}
.order-cancel-dialog{max-height:90vh;border-radius:14px 14px 0 0;padding:18px 16px}
.order-cancel-dialog-actions button{flex:1}
.orders-pagination{justify-content:center}}
/* Buyer account page — compact Friendii-style account layout */
body[data-page="buyer"]{
  background:#f5f5f5;
}
body[data-page="buyer"] .reference-category-nav{
  display:none;
}
body[data-page="buyer"] #buyerApp{
  width:min(630px, calc(100% - 32px));
  padding:18px 0 68px;
}
body[data-page="buyer"] .account-page{
  gap:10px;
}
body[data-page="buyer"] .account-heading{
  padding:0 0 4px;
}
body[data-page="buyer"] .account-heading h1{
  margin:0 0 13px;
  font-size:25px;
  line-height:1.25;
  letter-spacing:-.2px;
}
body[data-page="buyer"] .account-profile-row{
  gap:12px;
  flex-wrap:nowrap;
}
body[data-page="buyer"] .account-profile-main{
  gap:10px;
  min-width:0;
}
body[data-page="buyer"] .account-avatar{
  width:42px;
  height:42px;
  flex:0 0 42px;
  font-size:19px;
  border:0;
  background:#cfcfcf;
  color:#fff;
}
body[data-page="buyer"] .account-profile-main strong{
  font-size:14px;
  line-height:1.3;
}
body[data-page="buyer"] .account-profile-main span{
  margin-top:2px;
  font-size:11px;
  color:#555;
}
body[data-page="buyer"] .account-profile-actions{
  gap:7px;
  flex:0 0 auto;
}
body[data-page="buyer"] .account-profile-actions .btn{
  min-height:28px;
  padding:4px 10px;
  border-radius:999px;
  box-shadow:none;
  font-size:10px;
  font-weight:700;
}
body[data-page="buyer"] .shopping-panel{
  border-color:#e8e8e8;
  border-radius:7px;
  box-shadow:none;
}
body[data-page="buyer"] .shopping-panel-head{
  padding:11px 18px;
  min-height:42px;
}
body[data-page="buyer"] .shopping-panel-head strong{
  font-size:12px;
}
body[data-page="buyer"] .shopping-panel-head a{
  font-size:9px;
  color:#999;
}
body[data-page="buyer"] .shopping-wallet-grid{
  gap:8px;
  padding:14px 18px 8px;
}
body[data-page="buyer"] .shopping-wallet-card{
  min-height:58px;
  padding:13px 36px 13px 17px;
  border-radius:6px;
  background:#f7f7f7;
  box-shadow:none;
}
body[data-page="buyer"] .shopping-wallet-card span{
  font-size:11px;
  font-weight:700;
}
body[data-page="buyer"] .shopping-wallet-card strong{
  font-size:11px;
}
body[data-page="buyer"] .shopping-wallet-card b{
  right:14px;
  font-size:15px;
}
body[data-page="buyer"] .order-status-grid{
  padding:8px 18px 14px;
  gap:4px;
}
body[data-page="buyer"] .order-status-grid a{
  min-height:68px;
  gap:3px;
  border-radius:7px;
}
body[data-page="buyer"] .order-status-grid .status-icon{
  font-size:18px;
  color:#222;
}
body[data-page="buyer"] .order-status-grid strong{
  font-size:10px;
  font-weight:500;
  color:#222;
}
body[data-page="buyer"] .order-status-grid em{
  top:2px;
  right:calc(50% - 20px);
  min-width:14px;
  height:14px;
  padding:0 4px;
  font-size:8px;
}
body[data-page="buyer"] .account-shortcuts{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
}
body[data-page="buyer"] .account-shortcuts a,
body[data-page="buyer"] .account-shortcuts button{
  min-height:46px;
  grid-template-columns:21px 1fr auto;
  gap:7px;
  padding:7px 12px;
  border-color:#e8e8e8;
  border-radius:6px;
  box-shadow:none;
}
body[data-page="buyer"] .account-shortcuts span{
  font-size:14px;
}
body[data-page="buyer"] .account-shortcuts strong{
  font-size:11px;
  font-weight:650;
}
body[data-page="buyer"] .account-shortcuts b{
  font-size:15px;
}
@media(max-width:620px){body[data-page="buyer"] #buyerApp{
    width:min(100% - 24px,630px);
    padding-top:12px;
  }
body[data-page="buyer"] .account-heading h1{font-size:22px}
body[data-page="buyer"] .account-profile-row{align-items:flex-start;flex-wrap:wrap}
body[data-page="buyer"] .account-profile-actions{width:auto}
body[data-page="buyer"] .account-profile-actions .btn{flex:0 0 auto}
body[data-page="buyer"] .shopping-wallet-grid{grid-template-columns:1fr}
body[data-page="buyer"] .account-shortcuts{grid-template-columns:1fr}}
/* Buyer account header cleanup */
body[data-page="buyer"] .footer{display:none!important;}
body[data-page="buyer"] .reference-actions .profile-drawer-btn{
  height:34px;
  min-width:57px;
  padding:0 8px;
  border:1px solid #dedede;
  border-radius:999px;
  background:#fff;
  color:#1e1e1e;
  box-shadow:none;
}
body[data-page="buyer"] .reference-actions .profile-drawer-btn:hover{
  background:#f8f8f8;
  border-color:#d6d6d6;
}
body[data-page="buyer"] .reference-actions .profile-drawer-avatar{
  width:23px;
  height:23px;
  font-size:12px;
  background:#ececec;
  color:#4b5563;
  border-radius:50%;
}
body[data-page="buyer"] .reference-actions .profile-drawer-divider{
  height:18px;
  background:#e1e1e1;
}
body[data-page="buyer"] .reference-actions .profile-drawer-bars{
  font-size:14px;
  color:#1e1e1e;
}
/* Purchases reference page */
body[data-page="purchases"]{background:#f5f5f5;min-height:100vh}
body[data-page="purchases"] .reference-category-nav{display:none!important}
body[data-page="purchases"] #purchasesApp{width:min(760px,calc(100% - 32px));margin:0 auto;padding:16px 0 70px}
.purchases-reference-page{width:100%}
.purchases-title-row{display:flex;align-items:center;justify-content:space-between;gap:28px;margin:0 0 20px}
.purchases-title-row h1{margin:0;font-size:25px;line-height:1.2;color:#111;font-weight:800;white-space:nowrap}
.purchases-search{height:32px;width:330px;display:grid;grid-template-columns:1fr 34px;background:#fff;border:1px solid #d7d7d7;border-radius:4px;overflow:hidden}
.purchases-search input{border:0;outline:0;padding:0 12px;font:inherit;font-size:11px;color:#222;min-width:0;background:#fff}
.purchases-search input::placeholder{color:#bbb}
.purchases-search button{border:0;border-left:1px solid #d7d7d7;background:#fff;color:#333;font-size:19px;line-height:1;cursor:pointer}
.purchases-browser-alert{min-height:62px;display:flex;align-items:center;gap:13px;padding:12px 18px;margin-bottom:10px;background:#fffbee;border:1px solid #f2cf67;border-radius:8px;color:#2c2c2c}
.purchases-browser-alert p{margin:0;font-size:11px;line-height:1.55}
.purchases-alert-icon{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;flex:0 0 auto;background:#f4a612;color:#fff;font-size:15px;font-weight:900}
.purchases-table-card{background:#fff;border-radius:5px;overflow:hidden}
.purchases-table-head{display:grid;grid-template-columns:1.2fr .55fr .85fr 1fr .8fr;align-items:center;min-height:52px;background:#fafafa;border-bottom:1px solid #e8e8e8}
.purchases-table-head strong{padding:0 15px;font-size:11px;color:#222;line-height:1.2;border-right:1px solid #ededed}
.purchases-table-head strong:last-child{border-right:0}
.purchases-table-body{min-height:155px}
.purchases-table-row{display:grid;grid-template-columns:1.2fr .55fr .85fr 1fr .8fr;align-items:center;min-height:92px;border-bottom:1px solid #eee;color:#333}
.purchases-table-row:last-child{border-bottom:0}
.purchases-table-row>div{padding:12px 15px;font-size:10px}
.purchases-product-cell{display:flex;align-items:center;gap:10px;min-width:0}
.purchases-product-cell img{width:52px;height:52px;border-radius:4px;object-fit:cover;background:#f0f0f0;flex:0 0 auto}
.purchases-product-cell div{min-width:0}
.purchases-product-cell strong,.purchases-product-cell small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.purchases-product-cell strong{font-size:10px;color:#222}
.purchases-product-cell small{font-size:8px;color:#aaa;margin-top:4px}
.purchases-price-cell{color:#ff5353;font-weight:700}
.purchases-license-cell,.purchases-title-cell{color:#666}
.purchases-download-btn{display:inline-flex;align-items:center;justify-content:center;min-width:70px;height:28px;padding:0 10px;border:1px solid #2877ed;border-radius:5px;color:#2877ed;background:#fff;font-size:9px;font-weight:700;text-decoration:none}
.purchases-download-btn:hover{background:#f3f7ff}
.purchases-empty-state{min-height:155px;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#999;gap:7px}
.purchases-empty-box{position:relative;width:52px;height:34px;border:2px solid #dedede;border-radius:3px;color:#d6d6d6;display:grid;place-items:center;font-size:23px;box-shadow:0 5px 9px rgba(0,0,0,.04)}
.purchases-empty-state span{font-size:11px;color:#999}
@media(max-width:720px){body[data-page="purchases"] #purchasesApp{width:min(100% - 20px,760px);padding-top:14px}
.purchases-title-row{align-items:stretch;flex-direction:column;gap:12px}
.purchases-title-row h1{font-size:23px}
.purchases-search{width:100%}
.purchases-browser-alert{align-items:flex-start}
.purchases-table-card{overflow-x:auto}
.purchases-table-head,.purchases-table-row{min-width:690px}}
