/* 공통 스타일 포함 */
@import url("common.css");

/* ========== 모바일 카드형 디자인 시스템 ========== */
:root {
  --bg-0: #e8eef4;
  --bg-1: #f4f7fa;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #0f766e;
  --accent-hover: #0d9488;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --accent-sky: #0369a1;
  --accent-amber: #b45309;
  --danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
  --radius: 16px;
  --radius-sm: 12px;
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: "Outfit", "Pretendard", sans-serif;
  color-scheme: light;
}

* {
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background:
    radial-gradient(ellipse 90% 45% at 0% 0%, rgba(15, 118, 110, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 40% at 100% 0%, rgba(3, 105, 161, 0.1), transparent 50%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 50%, #edf2f7 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-size: 16px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.mobile-page {
  width: 100%;
  min-height: 100vh;
}

.mobile-container {
  max-width: 640px;
  margin: 0 auto;
  background: transparent;
  min-height: 100vh;
  padding: 12px 12px 28px;
  box-shadow: none;
}

/* ========== Header ========== */
.mobile-header {
  background: var(--surface);
  color: var(--ink);
  padding: 22px 20px;
  text-align: left;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.mobile-header::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-sky) 100%);
}

.mobile-brand-mark {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}

.mobile-header h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-shadow: none;
  position: relative;
  z-index: 1;
}

.mobile-subtitle {
  font-size: 0.9rem;
  opacity: 1;
  line-height: 1.5;
  position: relative;
  z-index: 1;
  font-weight: 400;
  color: var(--muted);
  margin: 0;
}

/* ========== Cards ========== */
.mobile-main {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-card,
.mobile-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 0;
  border-bottom: none;
}

.mobile-card-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fafbfc 0%, var(--surface) 100%);
  border-radius: var(--radius) var(--radius) 0 0;
}

.mobile-card-header h2,
.mobile-section h2,
.mobile-results h2,
.mobile-comments-container h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 650;
  margin: 0 0 4px;
  color: var(--ink);
  display: block;
  gap: 0;
  letter-spacing: -0.01em;
}

.mobile-card-header p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.mobile-card-body {
  padding: 16px 18px 18px;
}

.mobile-action-card {
  padding: 14px 16px;
}

.mobile-contract-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ========== Notice ========== */
.mobile-notice-box {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.mobile-notice-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f59e0b;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.mobile-notice-content strong {
  color: #92400e;
  font-size: 0.92rem;
  font-weight: 650;
  display: block;
  margin-bottom: 4px;
}

.mobile-notice-content p {
  color: #78350f;
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0;
}

.mobile-price-notice {
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 10px;
  font-size: 13px;
  color: #075985;
  line-height: 1.4;
}

/* ========== Form ========== */
.mobile-input-group {
  margin-bottom: 16px;
}

.mobile-input-group:last-child {
  margin-bottom: 0;
}

.mobile-input-group > label {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.required {
  color: var(--danger);
  font-weight: 600;
}

.hint-label {
  color: var(--muted);
  font-size: 0.78em;
  font-weight: 500;
  margin-left: 2px;
}

.field-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  vertical-align: middle;
  flex-shrink: 0;
  line-height: 1;
}

.field-tooltip-icon {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
}

.field-tooltip-bubble {
  position: fixed;
  left: 12px;
  top: 0;
  width: min(280px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 10050;
}

.field-tooltip-bubble::before {
  display: none;
}

.field-tooltip-bubble.is-visible {
  opacity: 1;
  visibility: visible;
}

.after-months,
.maintenance-months,
.maintenance-months-price {
  font-size: 0.8em;
  color: var(--muted);
  font-weight: 400;
}

.mobile-input-group input,
.mobile-input-group select,
.mobile-select {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  background: #f8fafc;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
}

.mobile-input-group select,
.mobile-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1.4.3L6 4.9 10.6.3 12 1.7 6 7.7 0 1.7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.mobile-input-group input:focus,
.mobile-input-group select:focus,
.mobile-select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ========== Storage / Carrier options ========== */
.mobile-storage-options,
.mobile-carrier-options {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  width: 100%;
}

.mobile-radio-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  transition: all 0.2s ease;
  background: #f8fafc;
  user-select: none;
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  margin-bottom: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.2;
  -webkit-tap-highlight-color: transparent;
}

.mobile-radio-option:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.mobile-radio-option input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  margin: 0 6px 0 0;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  max-width: 16px;
  max-height: 16px;
  padding: 0;
  border: 2px solid #94a3b8;
  border-radius: 50%;
  background: #fff;
  box-shadow: none;
  accent-color: var(--accent);
  flex-shrink: 0;
  pointer-events: auto;
  transform: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.mobile-radio-option input[type="radio"]:checked {
  border-color: var(--accent);
  background:
    radial-gradient(circle, var(--accent) 0 38%, #fff 42% 100%);
  box-shadow: none;
}

.mobile-radio-option input[type="radio"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.mobile-radio-option .radio-label {
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s ease, font-size 0.15s ease, font-weight 0.15s ease;
  pointer-events: none;
}

.mobile-radio-option input[type="radio"]:checked + .radio-label {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.98rem;
}

.mobile-radio-option:has(input[type="radio"]:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.mobile-radio-option:has(input[type="radio"]:checked) .radio-label {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.98rem;
}

/* ========== Contract cards ========== */
.mobile-contract-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mobile-contract-card::before {
  display: none;
}

.mobile-contract-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.mobile-contract-card.card-selection {
  border-top: 3px solid var(--accent);
}

.mobile-contract-card.card-public {
  border-top: 3px solid var(--accent-sky);
}

.mobile-contract-card.card-budget {
  border-top: 3px solid var(--accent-amber);
}

.mobile-contract-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px 14px 0 0;
}

.mobile-contract-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.card-selection .mobile-contract-badge {
  background: var(--accent);
}

.card-public .mobile-contract-badge {
  background: var(--accent-sky);
}

.card-budget .mobile-contract-badge {
  background: var(--accent-amber);
}

.mobile-contract-icon {
  display: none;
}

.mobile-contract-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 650;
  color: var(--ink);
}

.mobile-contract-card .mobile-input-group {
  margin: 0 16px 14px;
}

.mobile-contract-card .mobile-input-group:first-of-type {
  margin-top: 14px;
}

.mobile-contract-card .device-price-section {
  padding-top: 8px;
}

.mobile-contract-card .mobile-input-group:last-child {
  margin-bottom: 16px;
}

.mobile-input-with-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-input-with-toggle input {
  flex: 1;
}

.mobile-sign-toggle-btn {
  background: var(--ink-soft);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease;
  min-width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.mobile-sign-toggle-btn:hover,
.mobile-sign-toggle-btn:active {
  background: var(--ink);
}

.empty-field {
  width: 100%;
  height: 48px;
  background-color: #f1f5f9;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}

.empty-field::after {
  content: "해당 없음";
}

/* ========== Buttons ========== */
.mobile-calculate-btn,
.mobile-price-info-btn {
  width: 100%;
  padding: 15px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: none;
}

.mobile-calculate-btn::before,
.mobile-price-info-btn::before {
  display: none;
}

.mobile-calculate-btn:hover,
.mobile-price-info-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.28);
}

.mobile-calculate-btn:active,
.mobile-price-info-btn:active {
  transform: translateY(0);
}

.mobile-calculate-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.mobile-calculate-btn.is-calculating .btn-text,
.mobile-calculate-btn.is-price-updating .btn-text {
  display: none;
}

.mobile-calculate-btn.is-calculating .btn-loading,
.mobile-calculate-btn.is-price-updating .btn-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 6px;
  vertical-align: -2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-text {
  font-weight: 650;
}

.btn-loading {
  display: none;
}

/* ========== Results ========== */
.mobile-results {
  padding: 0;
  background: var(--surface);
  border-top: none;
}

.mobile-results .mobile-card-header h2,
.mobile-results h2 {
  text-align: left;
  justify-content: flex-start;
}

.comparison-summary {
  background: white;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: none;
  border: 1px solid var(--border);
}

.comparison-summary h3 {
  font-size: 1.05rem;
  font-weight: 650;
  margin-bottom: 12px;
  color: var(--ink);
  text-align: center;
}

.best-option {
  background: linear-gradient(160deg, #fff7ed 0%, #ffedd5 55%, #fed7aa 100%);
  color: #9a3412;
  border: 1.5px solid #f59e0b;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 700;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
  animation: none;
}

.savings-info {
  background: #ecfdf5;
  color: #065f46;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid #a7f3d0;
}

.comparison-table {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

.comparison-table table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 0;
}

.comparison-table th,
.comparison-table td {
  word-break: keep-all;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  width: 18%;
}

.comparison-table th:not(:first-child),
.comparison-table td:not(:first-child) {
  width: 27.333%;
}

.comparison-table th {
  background: #f1f5f9;
  color: var(--ink-soft);
  font-weight: 650;
  padding: 10px 4px;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.35;
  border-bottom: 1px solid var(--border);
}

.comparison-table td {
  padding: 10px 4px;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.35;
}

.comparison-table .calculation-note {
  display: inline-block;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 400;
  margin-left: 0;
  line-height: 1.3;
  word-break: break-all;
}

.comparison-table tr:last-child td {
  border-bottom: none;
  background: #f8fafc;
  font-weight: 650;
}

.comparison-table .highlight-best {
  background: transparent;
  color: inherit;
  border: none;
  box-shadow: none;
  animation: none;
}

.comparison-table .highlight-best::before {
  content: none;
}

.comparison-table .best-price-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.1em;
  max-width: 100%;
  padding: 0.25em 0.4em;
  border-radius: 999px;
  background: linear-gradient(160deg, #fff7ed 0%, #ffedd5 55%, #fed7aa 100%);
  color: #9a3412;
  font-weight: 800;
  font-size: 0.72rem;
  border: 1.5px solid #f59e0b;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.18);
  white-space: normal;
  line-height: 1.25;
  box-sizing: border-box;
}

.price-cell {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ink);
}

.highlight-blue {
  color: var(--accent-sky);
}

.highlight-good {
  background: #475569;
  color: white;
}

.highlight-normal {
  background: #94a3b8;
  color: white;
}

/* ========== Result actions ========== */
.result-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
  justify-content: center;
  font-family: inherit;
}

.action-btn:hover {
  border-color: var(--border-strong);
  color: var(--ink-soft);
}

.action-btn.like-btn {
  border-color: #f87171;
  color: #ef4444;
}

.action-btn.like-btn:hover,
.action-btn.like-btn.liked {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

.action-btn.share-btn {
  border-color: var(--accent);
  color: var(--accent);
}

.action-btn.share-btn:hover {
  background: var(--accent);
  color: white;
}

.action-btn.copy-btn {
  border-color: var(--accent-sky);
  color: var(--accent-sky);
}

.action-btn.copy-btn:hover {
  background: var(--accent-sky);
  color: white;
}

.btn-icon {
  font-size: 1em;
}

.btn-count {
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 7px;
  border-radius: 8px;
  font-size: 0.78em;
  font-weight: 700;
}

.action-btn.liked .btn-count {
  background: rgba(255, 255, 255, 0.2);
}

/* ========== Ads ========== */
.mobile-ad-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  overflow: hidden;
}

.mobile-results .mobile-ad-in-result {
  margin: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  padding: 14px 16px;
}

.mobile-ad-disclaimer {
  text-align: center;
  margin-top: 10px;
}

.mobile-ad-disclaimer small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.mobile-coupang-ad-container {
  margin: 0;
  padding: 18px;
  background: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.mobile-coupang-ad-container .mobile-ad-header {
  text-align: center;
  margin-bottom: 12px;
}

.mobile-coupang-ad-container .mobile-ad-header h3 {
  color: white;
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
}

.mobile-coupang-ad-container .mobile-ad-header small {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
}

.mobile-coupang-ad-container .mobile-ad-content {
  background: white;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.mobile-coupang-ad-container .mobile-ad-content iframe,
.mobile-coupang-ad-container iframe {
  position: relative !important;
  display: block !important;
  margin: 0 auto !important;
  max-width: 100%;
}

.mobile-coupang-ad-container * {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  z-index: auto !important;
}

.mobile-coupang-ad-container .mobile-ad-disclaimer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.mobile-coupang-ad-container .mobile-ad-disclaimer small {
  color: rgba(255, 255, 255, 0.75);
}

/* ========== Comments ========== */
.mobile-comments-container {
  padding: 0;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-top: 0;
}

.mobile-comments-form {
  background: #f8fafc;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.mobile-rating-section {
  margin-bottom: 12px;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.mobile-rating-stars {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mobile-rating-label {
  font-weight: 650;
  color: var(--ink-soft);
  font-size: 14px;
}

.mobile-stars {
  display: flex;
  gap: 2px;
}

.mobile-stars input[type="radio"] {
  display: none;
}

.mobile-star {
  font-size: 26px;
  color: #e2e8f0;
  cursor: pointer;
  transition: color 0.15s ease;
  user-select: none;
  line-height: 1;
}

.mobile-star:hover,
.mobile-star:hover ~ .mobile-star,
.mobile-stars input[type="radio"]:checked ~ .mobile-star {
  color: #f59e0b;
}

.mobile-stars input[type="radio"]:checked + .mobile-star {
  color: #f59e0b;
}

.mobile-rating-text {
  font-size: 12px;
  color: var(--muted);
  width: 100%;
}

.mobile-comment-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-comment-input-wrapper textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  min-height: 72px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mobile-comment-input-wrapper textarea:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.mobile-comment-submit-btn,
.comment-submit-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease;
  width: 100%;
}

.mobile-comment-submit-btn:hover,
.comment-submit-btn:hover {
  background: var(--accent-hover);
}

.mobile-comments-list,
.comments-list {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.comment-item {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  background: white;
  margin: 0;
  border-radius: 0;
}

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

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.comment-nickname {
  font-weight: 650;
  color: var(--ink-soft);
  font-size: 14px;
}

.comment-date {
  color: var(--muted);
  font-size: 12px;
}

.comment-content {
  color: var(--ink);
  line-height: 1.5;
  font-size: 14px;
  white-space: pre-wrap;
}

.no-comments {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

.delete-comment-btn {
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  cursor: pointer;
}

.load-more-container {
  text-align: center;
  margin: 14px 0 0;
}

.btn-load-more {
  background: var(--ink-soft);
  color: white;
  border: none;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.btn-load-more:hover {
  background: var(--ink);
}

.comments-section {
  margin-top: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.comment-input-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-input-group input,
.comment-input-group textarea {
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
}

.comment-input-group input:focus,
.comment-input-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ========== Footer ========== */
.mobile-footer {
  background: var(--surface) !important;
  color: var(--muted) !important;
  padding: 22px 18px 18px;
  margin-top: 12px;
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color-scheme: light !important;
}

.mobile-footer::before {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .mobile-footer {
    background: var(--surface) !important;
    color: var(--muted) !important;
  }

  .mobile-footer-content h3 {
    color: var(--ink) !important;
  }

  .mobile-footer-content p,
  .mobile-copyright {
    color: var(--muted) !important;
  }

  .mobile-footer-links a {
    color: var(--muted) !important;
    background: #f8fafc !important;
    border-color: var(--border) !important;
  }
}

.mobile-footer-content {
  text-align: center;
}

.mobile-footer-content h3 {
  margin: 0 0 8px;
  color: var(--ink) !important;
  font-size: 1.05rem;
  font-weight: 650;
  font-family: var(--font-display);
}

.mobile-footer-content p {
  margin: 0 0 14px;
  color: var(--muted) !important;
  font-size: 0.9rem;
  line-height: 1.5;
}

.mobile-footer-links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 14px;
}

.mobile-footer-links a,
.mobile-footer-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 44px;
  margin: 0;
  padding: 11px 16px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
}

.mobile-footer-links a {
  color: var(--muted) !important;
  text-decoration: none;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.mobile-footer-share-btn {
  background: var(--accent);
  color: white;
  border: 1px solid transparent;
  cursor: pointer;
  gap: 6px;
}

.mobile-footer-share-btn .btn-text {
  font-size: inherit;
  line-height: inherit;
}

.mobile-footer-share-btn:hover {
  background: var(--accent-hover);
}

.mobile-copyright {
  font-size: 0.78rem;
  color: var(--muted) !important;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin: 0 !important;
}

/* ========== Toast ========== */
.mobile-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--ink);
  color: white;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 1000;
  transition: transform 0.3s ease;
  max-width: calc(100% - 32px);
  text-align: center;
  font-size: 0.92rem;
}

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

.mobile-toast.success {
  background: #059669;
}

.mobile-toast.error {
  background: #dc2626;
}

/* ========== Price popup (shared) ========== */
.price-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.price-popup {
  background: white;
  border-radius: var(--radius);
  max-width: 100%;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
}

.price-popup-header {
  background: var(--ink);
  color: white;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-popup-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
}

.price-popup-content {
  padding: 16px;
  max-height: 60vh;
  overflow-y: auto;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.price-table th,
.price-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.price-table th {
  background: #f8fafc;
  font-weight: 700;
}

/* ========== Small screens ========== */
@media (max-width: 380px) {
  .mobile-container {
    padding: 8px 8px 20px;
  }

  .mobile-header {
    padding: 18px 16px;
  }

  .mobile-header h1 {
    font-size: 1.2rem;
  }

  .mobile-card-header,
  .mobile-card-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .comparison-table th {
    padding: 8px 3px;
    font-size: 0.7rem;
  }

  .comparison-table td {
    padding: 8px 3px;
    font-size: 0.72rem;
  }

  .comparison-table .best-price-badge {
    font-size: 0.68rem;
    padding: 0.2em 0.35em;
  }

  .price-cell {
    font-size: 0.76rem;
  }
}

@media (min-width: 481px) {
  .mobile-container {
    padding: 16px 16px 32px;
  }

  .mobile-header h1 {
    font-size: 1.5rem;
  }

  .mobile-comment-input-wrapper {
    flex-direction: row;
    align-items: flex-end;
  }

  .mobile-comment-submit-btn {
    width: auto;
    min-width: 80px;
  }

  .mobile-footer-links {
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }
}
