/* ===== Detail Page Styles ===== */

.container { max-width: 480px; padding-bottom: 100px; }

.header-title span { background: var(--gradient-1); }

/* Hero */
.product-hero { position: relative; padding: 16px; }

.hero-card {
  background: var(--bg-card); border-radius: 20px; overflow: hidden;
  border: 1px solid var(--border);
}

.hero-banner { position: relative; height: 200px; overflow: hidden; }

.hero-banner img { width: 100%; height: 100%; object-fit: cover; }

.hero-banner-overlay {
  position: absolute; bottom: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(transparent, var(--bg-card));
}

.hero-badge-row { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }

.hero-badge {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
}

.hero-badge.global {
  background: rgba(79, 172, 254, 0.2); color: #4facfe;
  border: 1px solid rgba(79, 172, 254, 0.3);
}

.hero-badge.hot {
  background: #f5576c;
  color:#fff;
  border: 1px solid rgba(245, 86, 108, 0.3);
}

.hero-body { padding: 16px 20px 20px; position: relative; }

.hero-product-icon {
  position: absolute; top: -40px; right: 20px; width: 64px; height: 64px;
  border-radius: 16px; border: 3px solid var(--bg-card); overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.hero-product-icon img { width: 100%; height: 100%; object-fit: cover; }

.hero-game-name { font-size: 24px; font-weight: 800; margin-bottom: 4px; }

.hero-region { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }

.hero-promo {
  background: rgba(108, 92, 231, 0.1); border: 1px solid rgba(108, 92, 231, 0.2);
  border-radius: 12px; padding: 12px 16px; display: flex; align-items: center; gap: 10px;
}

.promo-icon {
  width: 28px; height: 28px; background: var(--gradient-2); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.promo-text { font-size: 13px; color: var(--accent-light); line-height: 1.5; }
.promo-text strong { color: var(--text-primary); }

/* Section */
.section { padding: 0 16px 16px; }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

.section-title { font-size: 17px; font-weight: 700; }

.section-title span {
  background: var(--gradient-1);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Package Grid */
.pkg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.pkg-item {
  position: relative; background: var(--bg-card); border: 2px solid transparent;
  border-radius: 16px; padding: 14px 12px 12px; cursor: pointer; transition: all 0.25s; overflow: hidden;
}

.pkg-item::before {
  content: ''; position: absolute; inset: 0; background: var(--gradient-1);
  opacity: 0; transition: opacity 0.25s;
}

.pkg-item.selected { border-color: var(--accent); box-shadow: 0 4px 18px var(--accent-glow); }
.pkg-item.selected::before { opacity: 0.06; }
.pkg-item:hover:not(.selected) { border-color: rgba(108, 92, 231, 0.4); }

/* Ribbon */
.pkg-ribbon {
  position: absolute; top: 0; right: 0; padding: 3px 10px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.3px;
  border-bottom-left-radius: 10px; z-index: 2;
}

.ribbon-bonus { background: var(--gradient-1); color: #fff; }
.ribbon-sale { background: var(--gradient-2); color: #fff; }
.ribbon-best { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #1a1a2e; }

/* Check */
.pkg-check {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;

    /*position: absolute;
    top: 8px;
    left: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;*/
    background: var(--accent);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.pkg-item.selected .pkg-check { display: flex; }

.pkg-icon {
  width: 36px; height: 36px; border-radius: 10px; object-fit: cover; margin-bottom: 8px;
  display: block; position: relative; z-index: 1;
}

.pkg-name {
  font-size: 13px; font-weight: 700; margin-bottom: 2px; position: relative; z-index: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.pkg-bonus {
  font-size: 11px; color: var(--green); font-weight: 600; margin-bottom: 4px;
  position: relative; z-index: 1;
}

.pkg-price-row { display: flex; align-items: baseline; gap: 5px; position: relative; z-index: 1; }

.pkg-price {
  font-size: 15px; font-weight: 800; background: var(--gradient-1);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.pkg-orig { font-size: 11px; color: var(--text-muted); text-decoration: line-through; }

/* Expand */
.expand-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  margin-top: 10px; padding: 11px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; color: var(--accent-light); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.3s;
}

.expand-btn:hover { background: rgba(108, 92, 231, 0.1); border-color: var(--accent); }

.expand-icon { display: inline-flex; transition: transform 0.3s; }
.expand-btn.expanded .expand-icon { transform: rotate(180deg); }

.extra-pkgs { display: none; }
.extra-pkgs.show { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }

/* Form */
.form-section { padding: 0 16px 16px; }

.form-group { margin-bottom: 14px; }

.form-label {
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}

.form-label .required { color: var(--red); font-size: 10px; }

.form-input {
  width: 100%; padding: 14px 16px; background: var(--bg-input);
  border: 2px solid var(--border); border-radius: 12px; color: var(--text-primary);
  font-size: 14px; outline: none; transition: all 0.3s;
  -webkit-appearance: none; appearance: none;
}

.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-input::placeholder { color: var(--text-muted); }
.form-input.error { border-color: var(--red); box-shadow: 0 0 0 3px rgba(245, 86, 108, 0.2); }

.form-error { font-size: 12px; color: var(--red); margin-top: 6px; display: none; }
.form-error.show { display: block; }

.select-wrapper { position: relative; }

.select-wrapper::after {
  content: ''; position: absolute; right: 16px; top: 50%;
  transform: translateY(-50%); width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid var(--text-secondary); pointer-events: none;
}

/* Order Summary Bar */
.order-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(17, 24, 39, 0.95); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border); padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.order-bar-inner {
  max-width: 480px; margin: 0 auto; display: flex; align-items: center;
  justify-content: space-between;
}

.order-summary { display: flex; flex-direction: column; }

.order-total-label { font-size: 12px; color: var(--text-secondary); }
.order-total-value { font-size: 20px; font-weight: 800; color: var(--gold); }
.order-selected { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.buy-btn {
  padding: 14px 32px; background: var(--gradient-1); border: none; border-radius: 14px;
  color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; transition: all 0.3s;
  box-shadow: 0 6px 20px var(--accent-glow); letter-spacing: 0.5px; white-space: nowrap;
}

.buy-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px var(--accent-glow-strong); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px); display: none; align-items: flex-end; justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal-card {
  background: var(--bg-card); border-radius: 24px 24px 0 0;
  border: 1px solid var(--border); border-bottom: none;
  width: 100%; max-width: 520px; padding: 24px;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }

.modal-title { font-size: 18px; font-weight: 700; }

.modal-close {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: var(--bg-input); color: var(--text-secondary); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.3s;
}

.modal-close:hover { background: var(--red); color: #fff; }

.modal-product { display: flex; gap: 14px; margin-bottom: 20px; }

.modal-product-img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; flex-shrink: 0; }

.modal-product-name { font-size: 16px; font-weight: 700; }
.modal-product-item { font-size: 14px; color: var(--accent-light); font-weight: 600; margin-top: 4px; }
.modal-bonus-row { font-size: 12px; color: var(--green); font-weight: 600; margin-top: 2px; }

.modal-details {
  background: var(--bg-input); border-radius: 14px; padding: 14px 16px; margin-bottom: 20px;
}

.modal-detail-row {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 0;
}

.modal-detail-row:not(:last-child) { border-bottom: 1px solid var(--border); }

.modal-detail-label { font-size: 13px; color: var(--text-secondary); }

.modal-detail-value { font-size: 14px; font-weight: 600; }
.modal-detail-value.price { color: var(--gold); font-size: 20px; font-weight: 900; }
.modal-detail-value.orig {
  text-decoration: line-through; color: var(--text-muted); font-size: 12px;
  margin-right: 6px; font-weight: 400;
}

.modal-warning { font-size: 11px; color: var(--text-muted); text-align: center; margin-bottom: 16px; }
.modal-warning .star { color: var(--red); }

.modal-pay-btn {
  width: 100%; padding: 15px; background: var(--gradient-2); border: none;
  border-radius: 14px; color: #fff; font-size: 17px; font-weight: 700; cursor: pointer;
  transition: all 0.3s; box-shadow: 0 6px 20px rgba(240, 147, 251, 0.3);
}

.modal-pay-btn:hover { transform: translateY(-2px); }

/* Loading */
.loading-overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(10, 14, 26, 0.7);
  backdrop-filter: blur(10px); display: none; align-items: center; justify-content: center;
}

.loading-overlay.show { display: flex; }

.spinner {
  width: 48px; height: 48px; border: 4px solid var(--bg-card);
  border-top: 4px solid var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Toast */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%) translateY(-20px);
  z-index: 250; background: var(--green); color: #fff; padding: 12px 24px; border-radius: 12px;
  font-size: 14px; font-weight: 600; opacity: 0; transition: all 0.3s;
  max-width: 90%; text-align: center; pointer-events: none;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

    .toast.tip {
        opacity: 1;
        background: var(--tip);
        font-weight: normal;
        transform: translateX(-50%) translateY(0);
    }
    .toast.error {
        opacity: 1;
        background: var(--error);
        font-weight: normal;
        transform: translateX(-50%) translateY(0);
    }

/* Responsive */
@media (min-width: 768px) {
  .container { max-width: 720px; }
  .pkg-grid, .extra-pkgs.show { grid-template-columns: repeat(3, 1fr); }
  .hero-banner { height: 280px; }
}

@media (min-width: 1024px) {
  .container { max-width: 800px; }
  .pkg-grid, .extra-pkgs.show { grid-template-columns: repeat(4, 1fr); }
  .order-bar-inner { max-width: 800px; }
  .hero-banner { height: 320px; }
  .modal-overlay { align-items: center; }
  .modal-card { border-radius: 24px; border-bottom: 1px solid var(--border); max-width: 440px; }
}


/* ===== Step Indicator ===== */
.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 10px 16px 8px;
}

.step {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s;
}

    .step.active {
        color: var(--accent-light);
    }

    .step.completed {
        color: var(--success);
    }

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.3s;
}

.step.active .step-num {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.step.completed .step-num {
    background: var(--success);
    border-color: var(--success);
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--bg-card);
    margin: 0 4px;
}

    .step-line.done {
        background: var(--success);
    }