/* ========== shop.css ========== */
/* Redesigned to match home.css warm minimal aesthetic */

#screen-shop.active {
  background: linear-gradient(135deg, #f0f0f5 0%, #e8e8ed 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.shop-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* ── Header ── */
.shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid rgba(0, 0, 0, .06);
  flex-shrink: 0;
  box-shadow: 0 1px 8px rgba(0, 0, 0, .03);
}

.shop-back {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}

.shop-back:active {
  background: rgba(0, 0, 0, .05);
}

.shop-back svg {
  width: 20px;
  height: 20px;
  stroke: #3a3a3c;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shop-header-title {
  font-size: 17px;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -.2px;
}

.shop-header-spacer {
  width: 32px;
}

/* ── Tab Bar (Bottom) ── */
.shop-tabbar {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding: 6px 8px calc(env(safe-area-inset-bottom, 4px) + 8px);
  border-top: 0.5px solid rgba(0, 0, 0, .06);
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  flex-shrink: 0;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, .04);
}

.shop-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 6px 14px 4px;
  border-radius: 10px;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.shop-tab:active {
  background: rgba(0, 0, 0, .04);
}

.shop-tab-icon {
  width: 22px;
  height: 22px;
  stroke: #b0b0b5;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .2s;
}

.shop-tab-label {
  font-size: 10px;
  color: #b0b0b5;
  font-weight: 500;
  letter-spacing: .1px;
  transition: color .2s;
  white-space: nowrap;
}

.shop-tab.active .shop-tab-icon {
  stroke: #3a3a3c;
}

.shop-tab.active .shop-tab-label {
  color: #3a3a3c;
  font-weight: 600;
}

.shop-cart-badge {
  position: absolute;
  top: 2px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  background: #3a3a3c;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}

/* ── Panel ── */
.shop-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex-direction: column;
}

.shop-tab-content.active {
  display: flex;
  flex-direction: column;
}

/* ── Search Bar ── */
.shop-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 16px 12px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 11px 15px;
  border: 1px solid rgba(0, 0, 0, .08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .04), 0 1px 0 rgba(255, 255, 255, .8) inset;
  flex-shrink: 0;
}

.shop-search-bar svg {
  width: 17px;
  height: 17px;
  stroke: #b0b0b5;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  flex-shrink: 0;
}

.shop-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: #2C2C2E;
  background: transparent;
  font-family: inherit;
}

.shop-search-input::placeholder { 
  color: #c7c7cc;
  font-weight: 400;
}

/* ── Categories ── */
.shop-categories {
  display: flex;
  gap: 9px;
  padding: 0 16px 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.shop-categories::-webkit-scrollbar { display: none; }

.shop-cat {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #8e8e93;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, .08);
  white-space: nowrap;
  cursor: pointer;
  transition: all .2s ease;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .03);
}

.shop-cat.active {
  background: #3a3a3c;
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .15);
  transform: translateY(-1px);
}

/* ── Product Grid ── */
.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 16px 28px;
}

.shop-product-card {
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0, 0, 0, .06), 0 1px 0 rgba(255, 255, 255, .8) inset;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  border: 1px solid rgba(0, 0, 0, .05);
}

.shop-product-card:active { 
  transform: scale(.97);
  box-shadow: 0 1px 8px rgba(0, 0, 0, .08);
}

.shop-product-img {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f0f5, #e8e8ed);
}

.shop-product-img-ph {
  width: 52px;
  height: 52px;
  stroke: rgba(176, 176, 181, .4);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shop-product-info {
  padding: 11px 12px 13px;
  background: rgba(255, 255, 255, .6);
}

.shop-product-name {
  font-size: 13px;
  font-weight: 600;
  color: #2C2C2E;
  letter-spacing: -.3px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-product-price {
  font-size: 15px;
  font-weight: 700;
  color: #1d1d1f;
  margin-bottom: 5px;
  letter-spacing: -.2px;
}

.shop-product-desc {
  font-size: 11px;
  color: #a0a0a5;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Modal ── */
.shop-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, .25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity .3s ease;
}

.shop-modal-overlay.show { opacity: 1; }

.shop-modal {
  background: #FFFFFF;
  border-radius: 28px 28px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(40px);
  transition: transform .3s cubic-bezier(.32, .72, 0, 1);
  box-shadow: 0 -4px 32px rgba(0, 0, 0, .12);
}

.shop-modal-overlay.show .shop-modal { transform: translateY(0); }

.shop-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(240, 240, 245, .9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  transition: background .2s;
}

.shop-modal-close:active {
  background: rgba(232, 232, 237, .9);
}

.shop-modal-close svg {
  width: 15px;
  height: 15px;
  stroke: #8E8780;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.shop-modal-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f0f5, #e8e8ed);
}

.shop-modal-body {
  padding: 22px 22px 44px;
  background: linear-gradient(to bottom, #FFFFFF, #FDFCFA);
}

.shop-modal-name {
  font-size: 21px;
  font-weight: 700;
  color: #2C2C2E;
  letter-spacing: -.4px;
  margin-bottom: 8px;
}

.shop-modal-price {
  font-size: 24px;
  font-weight: 700;
  color: #1d1d1f;
  margin-bottom: 6px;
  letter-spacing: -.5px;
}

.shop-modal-seller {
  font-size: 12px;
  color: #a0a0a5;
  margin-bottom: 16px;
  font-weight: 500;
}

.shop-modal-desc {
  font-size: 14px;
  color: #6e6e73;
  line-height: 1.65;
  margin-bottom: 26px;
}

.shop-modal-add-btn {
  width: 100%;
  padding: 16px;
  background: #3a3a3c;
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .3px;
  transition: all .2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .15), 0 1px 0 rgba(255, 255, 255, .1) inset;
}

.shop-modal-add-btn:active { 
  opacity: .82;
  transform: scale(.98);
}

/* ── Wallet ── */
.shop-wallet-profile {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 22px 18px 18px;
  background: rgba(255, 255, 255, .5);
}

.shop-wallet-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0f0f5, #e8e8ed);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .08);
}

.shop-wallet-avatar svg {
  width: 29px;
  height: 29px;
  stroke: #b0b0b5;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.shop-wallet-username {
  font-size: 18px;
  font-weight: 700;
  color: #2C2C2E;
  letter-spacing: -.3px;
}

.shop-wallet-email {
  font-size: 12px;
  color: #a0a0a5;
  margin-top: 3px;
}

.shop-section-label {
  padding: 10px 18px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #a0a0a5;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.shop-cards-scroll {
  display: flex;
  gap: 14px;
  padding: 4px 18px 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.shop-cards-scroll::-webkit-scrollbar { display: none; }

.shop-card {
  min-width: 230px;
  border-radius: 20px;
  padding: 22px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .1), 0 1px 0 rgba(255, 255, 255, .2) inset;
  border: 1.5px solid transparent;
}

.shop-card.selected {
  border-color: rgba(44, 44, 46, .3);
  transform: scale(1.02);
  box-shadow: 0 6px 28px rgba(0, 0, 0, .16);
}

.shop-card:active { transform: scale(.97); }

.shop-card-main {
  background: linear-gradient(135deg, #3a3a3c 0%, #2c2c2e 100%);
  color: #fff;
}

.shop-card-bank1 {
  background: linear-gradient(135deg, #f0f0f5, #e8e8ed);
  color: #2C2C2E;
}

.shop-card-bank2 {
  background: linear-gradient(135deg, #e8e8ed, #dcdce1);
  color: #2C2C2E;
}

.shop-card-type {
  font-size: 12px;
  font-weight: 600;
  opacity: .7;
  margin-bottom: 14px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.shop-card-balance {
  font-size: 30px;
  font-weight: 200;
  letter-spacing: -1.2px;
  margin-bottom: 5px;
}

.shop-card-label {
  font-size: 11px;
  opacity: .6;
  font-weight: 500;
}

.shop-card-number {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 2.5px;
  margin-bottom: 18px;
}

.shop-card-row {
  display: flex;
  gap: 28px;
}

.shop-card-field-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .5px;
  opacity: .6;
  margin-bottom: 3px;
}

.shop-card-field-value {
  font-size: 13px;
  font-weight: 500;
}

.shop-add-wallet-btn {
  display: block;
  width: calc(100% - 36px);
  margin: 0 18px 10px;
  padding: 15px;
  border: 1.5px dashed rgba(160, 160, 165, .35);
  border-radius: 16px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #6e6e73;
  cursor: pointer;
  text-align: center;
  transition: all .2s ease;
}

.shop-add-wallet-btn:active { 
  background: rgba(232, 232, 237, .3);
  border-color: rgba(160, 160, 165, .5);
}

.shop-transactions {
  margin: 0 18px 28px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .04), 0 1px 0 rgba(255, 255, 255, .8) inset;
}

.shop-tx {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 15px;
  border-bottom: 0.5px solid rgba(0, 0, 0, .06);
}

.shop-tx:last-child { border-bottom: none; }

.shop-tx-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #f0f0f5, #e8e8ed);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
}

.shop-tx-icon svg {
  width: 17px;
  height: 17px;
  stroke: #8E8780;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shop-tx-info { flex: 1; }

.shop-tx-name {
  font-size: 14px;
  font-weight: 500;
  color: #2C2C2E;
  letter-spacing: -.1px;
}

.shop-tx-date {
  font-size: 11px;
  color: #a0a0a5;
  margin-top: 3px;
}

.shop-tx-amount {
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: -.2px;
}

.shop-tx-in  { color: #2C2C2E; }
.shop-tx-out { color: #6e6e73; }

/* ── Cart ── */
.shop-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 12px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, .5);
}

.shop-cart-title {
  font-size: 24px;
  font-weight: 700;
  color: #2C2C2E;
  letter-spacing: -.4px;
}

.shop-cart-clear-btn {
  background: none;
  border: none;
  font-size: 14px;
  color: #8e8e93;
  cursor: pointer;
  padding: 5px 10px;
  font-weight: 500;
  transition: color .2s;
}

.shop-cart-clear-btn:active {
  color: #6e6e73;
}

.shop-cart-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 18px;
}

.shop-cart-empty {
  text-align: center;
  padding: 80px 20px;
  color: #b0b0b5;
  font-size: 15px;
  font-weight: 400;
}

.shop-cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, .06);
}

.shop-cart-item:last-child { border-bottom: none; }

.shop-cart-item-img {
  width: 68px;
  height: 68px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f0f5, #e8e8ed);
  border: 1px solid rgba(0, 0, 0, .05);
}

.shop-cart-img-ph {
  width: 34px;
  height: 34px;
  stroke: rgba(176, 176, 181, .4);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shop-cart-item-info { flex: 1; min-width: 0; }

.shop-cart-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #2C2C2E;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -.2px;
}

.shop-cart-item-price {
  font-size: 12px;
  color: #a0a0a5;
  margin-bottom: 9px;
}

.shop-cart-qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid rgba(0, 0, 0, .08);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 17px;
  color: #2C2C2E;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 400;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
  transition: all .15s ease;
}

.shop-qty-btn:active { 
  background: rgba(240, 240, 245, .9);
  transform: scale(.95);
}

.shop-qty-val {
  font-size: 15px;
  font-weight: 600;
  color: #2C2C2E;
  min-width: 22px;
  text-align: center;
}

.shop-cart-item-subtotal {
  font-size: 16px;
  font-weight: 700;
  color: #1d1d1f;
  flex-shrink: 0;
  letter-spacing: -.3px;
}

.shop-cart-footer {
  padding: 18px 18px calc(env(safe-area-inset-bottom, 0px) + 18px);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid rgba(0, 0, 0, .06);
  flex-shrink: 0;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, .04);
}

.shop-cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.shop-cart-total-label {
  font-size: 16px;
  color: #8e8e93;
  font-weight: 500;
}

.shop-cart-total-value {
  font-size: 22px;
  font-weight: 700;
  color: #1d1d1f;
  letter-spacing: -.4px;
}

.shop-checkout-btn {
  width: 100%;
  padding: 16px;
  background: #3a3a3c;
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .15), 0 1px 0 rgba(255, 255, 255, .1) inset;
  letter-spacing: .3px;
}

.shop-checkout-btn:active { 
  opacity: .82;
  transform: scale(.98);
}

/* ── Toast ── */
.shop-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(58, 58, 60, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 11px 22px;
  border-radius: 24px;
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}

.shop-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}