/* MythicMaster Store Theme */

body.store-page {
  --store-purple: #6a0dad;
  --store-purple-dark: #4a148c;
  --store-purple-soft: rgba(106, 13, 173, 0.08);
  --store-gold: #ffd700;
  --store-gold-soft: rgba(255, 215, 0, 0.18);
  --store-surface: rgba(255, 255, 255, 0.92);
  --store-surface-strong: #ffffff;
  --store-border: rgba(74, 20, 140, 0.14);
  --store-text: #35204d;
  --store-muted: #6d5b84;
  background:
    radial-gradient(circle at top left, rgba(255, 215, 0, 0.22), transparent 30%),
    radial-gradient(circle at top right, rgba(106, 13, 173, 0.18), transparent 34%),
    linear-gradient(180deg, #fffdf7 0%, #faf7ff 48%, #f7f2ff 100%);
  color: var(--store-text);
}

body.store-page main {
  position: relative;
  padding-bottom: 56px;
}

.store-maintenance-banner {
  max-width: 1240px;
  margin: 22px auto 4px;
  padding: 18px 20px;
  border-radius: 24px;
  text-align: center;
  font-size: clamp(2.4rem, 6vw, 5.6rem);
  line-height: 0.92;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #ffffff;
  background: linear-gradient(135deg, #c62828, #ff1744 58%, #8e0000);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 20px 48px rgba(198, 40, 40, 0.32);
  text-shadow: 0 4px 14px rgba(70, 0, 0, 0.32);
  transform: translateZ(0);
  animation: maintenancePulse 2s ease-in-out infinite;
}

@keyframes maintenancePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 20px 48px rgba(198, 40, 40, 0.32);
  }
  50% {
    transform: scale(1.01);
    box-shadow: 0 24px 60px rgba(198, 40, 40, 0.42);
  }
}

body.store-page main::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.55), transparent 28%),
    radial-gradient(circle at 20% 10%, rgba(255, 215, 0, 0.08), transparent 20%),
    radial-gradient(circle at 80% 18%, rgba(106, 13, 173, 0.08), transparent 24%);
  z-index: 0;
}

body.store-page .hero,
body.store-page .services-section,
body.store-page .checkout-modal,
body.store-page footer {
  position: relative;
  z-index: 1;
}

body.store-page .hero {
  max-width: 1220px;
  margin: 28px auto 18px;
  padding: 78px 26px 70px;
  border-radius: 28px;
  text-align: center;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(74, 20, 140, 0.96), rgba(106, 13, 173, 0.92)),
    radial-gradient(circle at top right, rgba(255, 215, 0, 0.2), transparent 36%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 60px rgba(74, 20, 140, 0.24);
  overflow: hidden;
}

body.store-page .hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 215, 0, 0.22), transparent 16%),
    radial-gradient(circle at 84% 28%, rgba(255, 255, 255, 0.16), transparent 20%),
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.08), transparent 40%);
  pointer-events: none;
}

body.store-page .hero h1 {
  position: relative;
  margin: 0 0 14px;
  font-size: clamp(2.7rem, 5vw, 4.6rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-shadow: 0 8px 32px rgba(25, 8, 48, 0.3);
}

body.store-page .hero p {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  font-size: clamp(1.02rem, 1.7vw, 1.18rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.88);
}

body.store-page .services-section {
  padding: 10px 18px 42px;
}

body.store-page .services-container {
  max-width: 1240px;
  margin: 0 auto;
}

#store-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

#store-products {
  min-width: 0;
}

.store-filter {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.store-filter button {
  border: 1px solid rgba(74, 20, 140, 0.18);
  background: rgba(255, 255, 255, 0.82);
  color: var(--store-purple-dark);
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 24px rgba(74, 20, 140, 0.08);
  transition: transform 0.24s ease, background 0.24s ease, color 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.store-filter button:hover,
.store-filter button.active {
  background: linear-gradient(135deg, var(--store-purple), var(--store-purple-dark));
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 12px 28px rgba(74, 20, 140, 0.22);
  transform: translateY(-1px);
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.product-item {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250, 246, 255, 0.96));
  border: 1px solid var(--store-border);
  border-radius: 22px;
  box-shadow: 0 16px 36px rgba(74, 20, 140, 0.08);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.product-item::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--store-purple), var(--store-gold));
}

.product-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 46px rgba(74, 20, 140, 0.14);
  border-color: rgba(74, 20, 140, 0.22);
}

.product-image {
  position: relative;
  width: 100%;
  min-height: 172px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #fff;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.25), transparent 24%),
    linear-gradient(135deg, rgba(74, 20, 140, 0.96), rgba(106, 13, 173, 0.92));
}

.product-image .product-img {
  width: 100%;
  height: 172px;
  object-fit: cover;
  display: block;
}

.product-image .product-emoji {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #fff;
}

.product-image::after {
  content: '';
  position: absolute;
  inset: auto 18px 18px auto;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.35), rgba(255, 215, 0, 0));
  filter: blur(1px);
}

.product-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 18px 20px;
}

.product-name {
  margin: 0 0 8px;
  color: var(--store-text);
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.product-desc {
  flex: 1;
  margin: 0 0 14px;
  color: var(--store-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.product-price {
  margin-bottom: 14px;
  color: var(--store-purple-dark);
  font-size: 1.45rem;
  font-weight: 900;
}

.product-qty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.qty-box {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(74, 20, 140, 0.16);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}

.qty-box button {
  width: 36px;
  height: 36px;
  border: 0;
  background: #f2ebff;
  color: var(--store-purple-dark);
  font-weight: 900;
  transition: background 0.2s ease, color 0.2s ease;
}

.qty-box button:hover {
  background: #e4d4ff;
}

.qty-box input {
  width: 46px;
  height: 36px;
  border: 0;
  text-align: center;
  color: var(--store-text);
  background: #fff;
  font-weight: 800;
}

.btn-add-cart,
.btn-checkout,
.btn-pay,
.cookie-btn.accept,
.btn.cta-btn {
  border: 0;
  background: linear-gradient(135deg, var(--store-purple), var(--store-purple-dark));
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(74, 20, 140, 0.22);
}

.btn-add-cart {
  width: 100%;
  padding: 13px 16px;
  border-radius: 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.btn-add-cart:hover,
.btn-checkout:hover:not(:disabled),
.btn-pay:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 16px 30px rgba(74, 20, 140, 0.28);
}

.btn-add-cart:hover {
  background: linear-gradient(135deg, #5c179c, #3e0f70);
}

.store-sidebar {
  position: sticky;
  top: 96px;
  height: fit-content;
}

.cart-card {
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(74, 20, 140, 0.14);
  box-shadow: 0 20px 46px rgba(74, 20, 140, 0.1);
  backdrop-filter: blur(10px);
}

.cart-header {
  margin-bottom: 18px;
  color: var(--store-purple-dark);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.cart-list {
  max-height: 410px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 14px;
}

.cart-list::-webkit-scrollbar {
  width: 6px;
}

.cart-list::-webkit-scrollbar-thumb {
  background: rgba(74, 20, 140, 0.28);
  border-radius: 999px;
}

.cart-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
  padding: 12px 12px 11px;
  background: linear-gradient(180deg, #fff, #faf6ff);
  border: 1px solid rgba(74, 20, 140, 0.08);
  border-radius: 16px;
}

.cart-item-name {
  flex: 1;
  color: var(--store-text);
  font-weight: 800;
  line-height: 1.35;
}

.cart-item-qty {
  color: var(--store-muted);
  font-size: 0.84rem;
}

.cart-item-price {
  min-width: 66px;
  text-align: right;
  color: var(--store-purple-dark);
  font-weight: 900;
}

.cart-item-remove {
  border: 0;
  background: transparent;
  color: #a78fbf;
  transition: color 0.2s ease, transform 0.2s ease;
}

.cart-item-remove:hover {
  color: #c0392b;
  transform: translateY(-1px);
}

.empty-cart {
  padding: 24px 10px;
  text-align: center;
  color: var(--store-muted);
  background: rgba(106, 13, 173, 0.04);
  border: 1px dashed rgba(74, 20, 140, 0.14);
  border-radius: 18px;
}

.cart-summary {
  display: none;
  margin: 12px 0 14px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #faf6ff, #f5edff);
  border: 1px solid rgba(74, 20, 140, 0.1);
}

.summary-line,
.summary-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.96rem;
}

.summary-line {
  color: var(--store-muted);
  margin-bottom: 8px;
}

.summary-total {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(74, 20, 140, 0.12);
  color: var(--store-text);
  font-size: 1.08rem;
  font-weight: 900;
}

.coupon-box {
  margin-bottom: 14px;
}

.coupon-input,
.form-group input,
.checkout-box input,
.checkout-box textarea,
.checkout-box select {
  width: 100%;
  border: 1px solid rgba(74, 20, 140, 0.16);
  background: rgba(255, 255, 255, 0.96);
  color: var(--store-text);
  border-radius: 14px;
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.coupon-input:focus,
.form-group input:focus,
.checkout-box input:focus,
.checkout-box textarea:focus,
.checkout-box select:focus {
  outline: none;
  border-color: rgba(106, 13, 173, 0.5);
  box-shadow: 0 0 0 4px rgba(106, 13, 173, 0.12);
  background: #ffffff;
}

.coupon-btn,
.btn-cancel {
  width: 100%;
  border-radius: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(74, 20, 140, 0.14);
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.coupon-btn {
  background: #f4e9ff;
  color: var(--store-purple-dark);
  box-shadow: none;
}

.coupon-btn:hover {
  background: #ead7ff;
  transform: translateY(-1px);
}

.btn-checkout {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.btn-checkout:disabled {
  background: linear-gradient(135deg, #d8cbe8, #cdbfe0);
  color: rgba(53, 32, 77, 0.6);
  cursor: not-allowed;
  box-shadow: none;
}

.checkout-modal {
  display: block;
  position: fixed;
  inset: 0;
  padding: 0;
  background: rgba(20, 8, 35, 0.42);
  backdrop-filter: blur(6px);
  overflow: hidden;
  z-index: 1300;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 0s linear 220ms;
}

.checkout-modal .overlay-click-catcher {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.checkout-modal .checkout-box {
  position: fixed;
  right: 0;
  top: 0;
  z-index: 1;
  height: 100vh;
  width: min(420px, 96%);
  max-width: 420px;
  overflow: auto;
  padding: 22px;
  border-radius: 12px 0 0 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,246,255,0.98));
  border-left: 1px solid rgba(74,20,140,0.06);
  box-shadow: -20px 30px 80px rgba(18,6,35,0.4);
  transform: translateX(105%);
  transition: transform 320ms cubic-bezier(.2,.9,.2,1), box-shadow 240ms ease;
  pointer-events: auto;
}

.checkout-modal.active {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transition: opacity 220ms ease;
}

.checkout-modal.active .checkout-box { transform: translateX(0); }

body.drawer-open {
  overflow: hidden;
}

body.drawer-open .cart-badge {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
}

.checkout-box h2 {
  margin: 0 0 18px;
  color: var(--store-purple-dark);
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  padding-left: 44px;
}

.checkout-close {
  position: sticky;
  left: 12px;
  top: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(74, 20, 140, 0.06);
  color: var(--store-purple-dark);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.checkout-close:hover { background: rgba(74,20,140,0.12); transform: rotate(4deg); }

.login-warning {
  display: none;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffaf0, #fff4dc);
  border: 1px solid rgba(255, 215, 0, 0.32);
  color: var(--store-text);
  text-align: center;
}

.login-warning a {
  color: var(--store-purple-dark);
  font-weight: 800;
  text-decoration: none;
}

.checkout-section {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(74, 20, 140, 0.06);
}

.checkout-section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}

.checkout-section h3 {
  margin: 0 0 14px;
  color: var(--store-text);
  font-size: 1.12rem;
  font-weight: 900;
}

.order-review {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #faf6ff, #f5edff);
  border: 1px solid rgba(74, 20, 140, 0.08);
}

.order-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  color: var(--store-text);
  font-size: 0.95rem;
}

.order-item:not(:last-child) {
  border-bottom: 1px solid rgba(74, 20, 140, 0.08);
}

.total-amount {
  margin: 8px 0 0;
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--store-purple-dark);
}

.payment-methods {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.payment-option {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(74, 20, 140, 0.14);
  background: linear-gradient(180deg, #fff, #faf6ff);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.payment-option:hover,
.payment-option.selected {
  transform: translateY(-1px);
  border-color: rgba(106, 13, 173, 0.34);
  box-shadow: 0 12px 26px rgba(74, 20, 140, 0.08);
}

.payment-option input {
  display: none;
}

.checkbox-agree {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.checkbox-agree input {
  width: auto;
  margin-top: 4px;
  accent-color: var(--store-purple);
}

.checkbox-agree label {
  margin: 0;
  color: var(--store-text);
  line-height: 1.5;
}

.checkbox-agree a {
  color: var(--store-purple-dark);
  font-weight: 800;
  text-decoration: none;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 12px;
  margin-top: 22px;
  position: sticky;
  bottom: 0;
  padding: 12px 0 4px;
  background: linear-gradient(180deg, rgba(255,255,255,0.65), rgba(255,255,255,0.98) 55%);
  border-top: 1px solid rgba(74, 20, 140, 0.06);
}

/* Toast notifications */
.store-toast {
  position: fixed;
  top: 88px;
  right: 20px;
  padding: 12px 14px;
  border-radius: 16px;
  z-index: 2000;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, var(--store-purple), var(--store-purple-dark));
  box-shadow: 0 18px 46px rgba(74,20,140,0.22);
  animation: storeToastIn 220ms ease-out;
}

.store-toast--error {
  background: linear-gradient(135deg, #c62828, #ff1744 70%, #8e0000);
  box-shadow: 0 18px 46px rgba(198, 40, 40, 0.25);
}

@keyframes storeToastIn {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Order review variants */
.order-item--discount { color: #2e7d32; font-weight: 800; }
.order-item--total {
  font-weight: 900;
  color: var(--store-purple-dark);
  border-top: 1px solid rgba(74, 20, 140, 0.12);
  margin-top: 10px;
  padding-top: 12px;
}

.btn-pay {
  border-radius: 18px;
  padding: 14px 18px;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.btn-cancel {
  background: #f3edf8;
  color: var(--store-purple-dark);
}

.btn-cancel:hover {
  background: #e8dff1;
}

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

.form-group {
  grid-column: 1 / -1;
}

.form-group.half {
  grid-column: span 1;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--store-muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.cart-summary,
.cart-card,
.checkout-box,
.product-item,
.store-filter button,
.btn-add-cart,
.coupon-btn,
.btn-checkout,
.btn-pay,
.btn-cancel,
.payment-option,
.order-review,
.form-group input,
.coupon-input {
  backdrop-filter: blur(6px);
}

.store-filter button:focus-visible,
.btn-add-cart:focus-visible,
.coupon-btn:focus-visible,
.btn-checkout:focus-visible,
.btn-pay:focus-visible,
.btn-cancel:focus-visible,
.checkout-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.18), 0 12px 28px rgba(74, 20, 140, 0.18);
}

@media (max-width: 1100px) {
  #store-main {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

@media (max-width: 940px) {
  #store-main {
    grid-template-columns: 1fr;
  }

  .store-sidebar {
    position: static;
  }

  .store-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body.store-page .hero {
    margin: 16px 10px 14px;
    padding: 52px 18px 44px;
    border-radius: 22px;
  }

  body.store-page .services-section {
    padding-left: 10px;
    padding-right: 10px;
  }

  #store-main {
    gap: 18px;
  }

  .store-filter {
    gap: 10px;
  }

  .store-filter button {
    flex: 1 1 calc(50% - 10px);
    padding: 11px 14px;
  }

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

  .cart-card,
  .checkout-box {
    padding: 18px;
    border-radius: 22px;
  }

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

  .form-group.half {
    grid-column: 1 / -1;
  }
}

/* Floating cart badge */
.cart-badge {
  position: fixed;
  right: 20px;
  top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--store-purple), var(--store-purple-dark));
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 18px 40px rgba(74,20,140,0.18);
  z-index: 1200;
  cursor: pointer;
  border: 0;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.cart-badge:hover { transform: translateY(-4px); box-shadow: 0 22px 54px rgba(74,20,140,0.22); }

.cart-badge .cart-icon { font-size: 1.2rem; }
.cart-badge .cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: var(--store-purple-dark);
  font-weight: 900;
  font-size: 0.85rem;
  box-shadow: inset 0 -2px 6px rgba(0,0,0,0.06);
}

.cart-badge .cart-total { font-weight: 800; font-size: 0.95rem; opacity: 0.95; }

@media (max-width: 720px) {
  .cart-badge { right: 12px; top: 12px; padding: 8px 10px; gap:6px; }
  .cart-badge .cart-total { display: none; }
}
