/* Modex Real Shopping Cart & Slide-Over Drawer Styles */

/* 1. Backdrop */
.cart-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100010;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cart-drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

/* 2. Slide-over Drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: 440px;
  max-width: 92vw;
  background: #10131B;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.6);
  z-index: 100020;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  visibility: hidden;
}

html[dir="rtl"] .cart-drawer {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.6);
  transform: translateX(-105%);
}

.cart-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}

/* Drawer Header */
.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: #141821;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cart-drawer-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-drawer-title-icon {
  color: #A78BFA;
}

.cart-drawer-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #F3F4F6;
  letter-spacing: -0.01em;
}

.cart-drawer-count-badge {
  background: rgba(139, 92, 246, 0.2);
  color: #C4B5FD;
  border: 1px solid rgba(139, 92, 246, 0.35);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.cart-drawer-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #9CA3AF;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.cart-drawer-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #EF4444;
}

/* Drawer Body */
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

/* Empty State */
.cart-drawer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 50px 20px;
  height: 100%;
}

.cart-empty-art {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #A78BFA;
  margin-bottom: 18px;
}

.cart-drawer-empty h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: #F3F4F6;
}

.cart-drawer-empty p {
  margin: 0 0 24px;
  font-size: 13px;
  color: #9CA3AF;
  line-height: 1.5;
  max-width: 280px;
}

.cart-empty-browse-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
  color: #FFFFFF !important;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cart-empty-browse-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

/* Drawer Items List */
.cart-drawer-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.drawer-item-row:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(139, 92, 246, 0.25);
}

.drawer-item-thumb {
  width: 60px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #0B0D12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

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

.drawer-item-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: #F3F4F6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-item-title a {
  color: inherit;
  text-decoration: none;
}

.drawer-item-title a:hover {
  color: #A78BFA;
}

.drawer-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #9CA3AF;
}

.drawer-item-game {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  color: #D1D5DB;
}

.drawer-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.drawer-item-price {
  font-size: 13px;
  font-weight: 700;
  color: #10B981;
}

.drawer-item-price.is-free {
  color: #A78BFA;
}

.drawer-item-del-btn {
  background: transparent;
  border: none;
  color: #6B7280;
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  transition: color 0.15s ease;
}

.drawer-item-del-btn:hover {
  color: #EF4444;
}

/* Drawer Footer */
.cart-drawer-footer {
  padding: 18px 22px;
  background: #0D1017;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-drawer-subtotal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-drawer-subtotal-label {
  font-size: 14px;
  color: #9CA3AF;
}

.cart-drawer-subtotal-val {
  font-size: 18px;
  font-weight: 800;
  color: #F9FAFB;
  letter-spacing: -0.01em;
}

.cart-drawer-wallet-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(38, 161, 123, 0.08);
  border: 1px solid rgba(38, 161, 123, 0.2);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: #A7F3D0;
}

.cart-drawer-wallet-summary strong {
  color: #FFFFFF;
}

.cart-checkout-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
  color: #FFFFFF !important;
  font-size: 14px;
  font-weight: 700;
  padding: 13px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cart-checkout-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.5);
}

.cart-drawer-alt-actions {
  text-align: center;
}

.cart-view-page-link {
  font-size: 12px;
  color: #9CA3AF;
  text-decoration: none;
  transition: color 0.15s ease;
}

.cart-view-page-link:hover {
  color: #A78BFA;
}

/* 3. Full Cart Page Styling */
.cart-page-container {
  max-width: 1140px;
  margin: 32px auto 60px;
  padding: 0 20px;
}

.cart-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cart-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-title-icon {
  color: #A78BFA;
}

.cart-page-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: #F9FAFB;
  letter-spacing: -0.02em;
}

.cart-page-count-badge {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #C4B5FD;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.cart-clear-btn {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #F87171;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.18s ease;
}

.cart-clear-btn:hover {
  background: rgba(239, 68, 68, 0.18);
}

/* Page Empty State */
.cart-page-empty {
  text-align: center;
  padding: 70px 20px;
  background: #141821;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
}

.cart-empty-icon-wrap {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #A78BFA;
  margin-bottom: 20px;
}

.cart-page-empty h2 {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
  color: #F9FAFB;
}

.cart-page-empty p {
  margin: 0 auto 28px;
  font-size: 14px;
  color: #9CA3AF;
  max-width: 480px;
  line-height: 1.6;
}

.btn-browse-store {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
  color: #FFFFFF !important;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
  transition: all 0.18s ease;
}

.btn-browse-store:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.5);
}

/* Grid Layout */
.cart-page-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 960px) {
  .cart-page-grid {
    grid-template-columns: 1fr;
  }
}

.cart-items-card {
  background: #141821;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 8px 20px;
}

.cart-items-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cart-item-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.cart-item-thumb-wrap {
  width: 90px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: #0B0D12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.cart-item-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.cart-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.cart-item-game-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.15);
  color: #C4B5FD;
}

.cart-item-category {
  font-size: 11px;
  color: #9CA3AF;
}

.cart-item-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.cart-item-title a {
  color: #F3F4F6;
  text-decoration: none;
  transition: color 0.15s ease;
}

.cart-item-title a:hover {
  color: #A78BFA;
}

.cart-item-creator {
  font-size: 12px;
  color: #6B7280;
}

.cart-item-price-col {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.cart-item-price {
  font-size: 16px;
  font-weight: 800;
  color: #10B981;
}

.cart-item-price small {
  font-size: 11px;
  color: #6B7280;
}

.cart-item-free-badge {
  background: rgba(139, 92, 246, 0.15);
  color: #A78BFA;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}

.cart-item-remove-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #9CA3AF;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cart-item-remove-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #EF4444;
}

/* Security Banner */
.cart-security-banner {
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.security-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #A78BFA;
}

.security-item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.security-item strong {
  font-size: 13px;
  color: #E5E7EB;
}

.security-item span {
  font-size: 11.5px;
  color: #9CA3AF;
}

/* Right Summary Card */
.cart-summary-card {
  background: #141821;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 24px;
  position: sticky;
  top: 90px;
}

.summary-card-title {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 800;
  color: #F9FAFB;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-line-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13.5px;
  color: #9CA3AF;
}

.summary-line-row strong {
  color: #F3F4F6;
}

.text-green {
  color: #10B981;
  font-weight: 600;
}

.summary-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 16px 0;
}

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

.summary-total-row span {
  font-size: 15px;
  font-weight: 700;
  color: #E5E7EB;
}

.summary-total-amount {
  font-size: 24px;
  font-weight: 800;
  color: #F9FAFB;
}

.summary-total-amount small {
  font-size: 13px;
  color: #9CA3AF;
  font-weight: 600;
}

/* Summary Wallet Box */
.summary-wallet-box {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-wallet-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.summary-wallet-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(38, 161, 123, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-wallet-title {
  font-size: 11.5px;
  color: #9CA3AF;
}

.summary-wallet-val {
  font-size: 15px;
  font-weight: 800;
  color: #F9FAFB;
}

.balance-status-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  padding: 6px 10px;
  border-radius: 6px;
}

.balance-status-chip.is-sufficient {
  background: rgba(16, 185, 129, 0.12);
  color: #6EE7B7;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.balance-status-chip.is-insufficient {
  background: rgba(239, 68, 68, 0.12);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-checkout-primary {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
  color: #FFFFFF !important;
  font-size: 14px;
  font-weight: 700;
  padding: 13px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
  transition: all 0.18s ease;
}

.btn-checkout-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.5);
}

.btn-topup-cta {
  background: linear-gradient(135deg, #26A17B 0%, #10B981 100%);
  box-shadow: 0 4px 16px rgba(38, 161, 123, 0.35);
}

.btn-topup-cta:hover {
  box-shadow: 0 6px 24px rgba(38, 161, 123, 0.5);
}

.summary-guest-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.summary-guest-box p {
  margin: 0;
  font-size: 13px;
  color: #9CA3AF;
  line-height: 1.5;
}

/* Add to Cart button styles on detail and cards */
.btn-add-to-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(139, 92, 246, 0.12);
  color: #C4B5FD;
  border: 1px solid rgba(139, 92, 246, 0.3);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-add-to-cart:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: #8B5CF6;
  color: #FFFFFF;
}

.btn-add-to-cart.is-added {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6EE7B7;
}

/* Card Quick Add Button */
.btn-card-add-cart {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(11, 13, 18, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #E5E7EB;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-card-add-cart:hover {
  background: #8B5CF6;
  border-color: #8B5CF6;
  color: #FFFFFF;
  transform: scale(1.06);
}

.store-card-bookmark {
  display: flex;
  align-items: center;
  gap: 6px;
}
