/* ==========================================================================
   MyoGlow Flag Presell - Clean & High Converting Style
   Based on modern editorial/flag selector model
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --bg-page: #f1f4f8;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --primary: #f43f5e;
  --primary-hover: #e11d48;
  --primary-light: #fff1f2;
  --border-card: #e2e8f0;
  --border-item: #e9eef4;
  --border-item-hover: #cbd5e1;
  --shadow-main:
    0 20px 40px -15px rgba(15, 23, 42, 0.07), 0 0 1px 1px rgba(15, 23, 42, 0.02);
  --shadow-item: 0 2px 6px rgba(15, 23, 42, 0.03);
  --shadow-item-hover:
    0 12px 24px -6px rgba(15, 23, 42, 0.1),
    0 4px 8px -2px rgba(15, 23, 42, 0.06);
  --radius-card: 28px;
  --radius-item: 16px;
  --radius-flag: 6px;
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Plus Jakarta Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 16px;
  padding-top: max(32px, env(safe-area-inset-top));
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Touch & tap responsiveness */
button,
a,
.country-item,
.seo-toggle-link {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Outer Container */
.presell-wrapper {
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto 0;
}

/* Main White Card */
.presell-card {
  background: var(--card-bg);
  width: 100%;
  border-radius: var(--radius-card);
  padding: 48px 40px 44px;
  box-shadow: var(--shadow-main);
  border: 1px solid rgba(226, 232, 240, 0.8);
  text-align: center;
  animation: fadeIn 0.4s ease-out;
  box-sizing: border-box;
}

/* Brand Logo */
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  text-decoration: none;
}

.brand-logo-img {
  max-height: 42px;
  max-width: 240px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Heading & Subtitle */
.card-title {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 12px;
  letter-spacing: -0.4px;
}

.card-subtitle {
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 24px;
  font-weight: 700;
}

/* Product Spotlight (Hero Device Preview for Instant Congruence) */
.product-spotlight {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
}

.product-image-wrap {
  width: 154px;
  height: 154px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    circle,
    rgba(241, 245, 249, 0.95) 0%,
    rgba(255, 255, 255, 0) 70%
  );
  border-radius: 50%;
  margin-bottom: 10px;
}

.product-hero-img {
  max-height: 170px;
  max-width: 160px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 12px rgba(49, 79, 148, 0.12));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-spotlight:hover .product-hero-img {
  transform: translateY(-4px) scale(1.04);
}

.product-spotlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 30px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.product-spotlight-badge .pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  display: inline-block;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Flags Grid - 4 items (2x2) */
.flags-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

/* Country Flag Button Item */
.country-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 26px 20px 22px;
  background: #ffffff;
  border: 1.5px solid var(--border-item);
  border-radius: var(--radius-item);
  text-decoration: none;
  box-shadow: var(--shadow-item);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.country-item:hover,
.country-item:focus-visible {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-item-hover);
  transform: translateY(-3px);
  outline: none;
}

.country-item:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

/* Flag Icon Container - ENLARGED */
.flag-box {
  width: 92px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.12),
    0 0 1px rgba(0, 0, 0, 0.18);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8fafc;
  flex-shrink: 0;
  transition: transform 0.22s ease;
}

.country-item:hover .flag-box {
  transform: scale(1.04);
}

.flag-box svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Country Name */
.country-name {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.2px;
  transition: color 0.2s ease;
}

.country-item:hover .country-name {
  color: #0f172a;
}

/* SEO Product Review Collapsible Section */
.seo-review-wrapper {
  margin-top: 10px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 18px;
  width: 100%;
}

.seo-toggle-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.seo-toggle-link:hover {
  color: #0f172a;
  background-color: #f1f5f9;
}

.seo-toggle-icon {
  font-size: 11px;
  transition: transform 0.3s ease;
}

.seo-toggle-link.active .seo-toggle-icon {
  transform: rotate(180deg);
}

.seo-review-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s ease;
  text-align: left;
}

.seo-review-content.expanded {
  max-height: 2500px;
  opacity: 1;
  margin-top: 18px;
}

.review-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px 22px;
  font-size: 13.5px;
  line-height: 1.65;
  color: #334155;
}

.review-box h2 {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
}

.review-box h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: #1e293b;
  margin: 16px 0 6px;
}

.review-box p {
  margin-bottom: 12px;
}

.review-highlights {
  list-style: none;
  margin: 12px 0 16px;
  padding: 0;
}

.review-highlights li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
}

.review-highlights li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: #059669;
  font-weight: bold;
}

.review-cta-wrapper {
  margin-top: 18px;
  text-align: center;
}

.review-cta-button {
  display: inline-block;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.review-cta-button:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

/* Review Badge */
.review-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  padding: 6px 14px;
  border-radius: 30px;
  margin-bottom: 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
}

.review-badge .stars {
  color: #f59e0b;
}

/* Specs Table */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 18px;
  font-size: 12.5px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.specs-table th,
.specs-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #eef2f6;
}

.specs-table th {
  background: #f1f5f9;
  font-weight: 700;
  color: #1e293b;
  width: 38%;
}

.specs-table td {
  color: #475569;
}

.specs-table tr:last-child td,
.specs-table tr:last-child th {
  border-bottom: none;
}

/* FAQ Accordion in Review */
.review-faq {
  margin: 16px 0 12px;
}

.review-faq details {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 10px 14px;
}

.review-faq summary {
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  outline: none;
  font-size: 13px;
  user-select: none;
}

.review-faq details[open] summary {
  margin-bottom: 8px;
  color: #0284c7;
}

.review-faq p {
  font-size: 12.5px;
  line-height: 1.55;
  color: #475569;
  margin-bottom: 0;
}

/* Micro-badge for Free Shipping / Stock (optional, clean) */
.country-tag {
  font-size: 11px;
  font-weight: 600;
  color: #059669;
  background: #ecfdf5;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 6px;
  letter-spacing: 0.1px;
}

/* Footer Section */
.presell-footer {
  margin-top: 32px;
  text-align: center;
  width: 100%;
  max-width: 580px;
  padding: 0 12px;
}

.footer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.footer-nav a {
  color: #334155;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-nav a:hover {
  color: #0f172a;
  text-decoration: underline;
}

.footer-nav .nav-sep {
  color: #94a3b8;
  font-weight: 400;
}

.footer-disclaimer {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.footer-disclaimer p {
  margin-bottom: 8px;
}

.footer-disclaimer p:last-child {
  margin-bottom: 0;
}

.footer-disclaimer strong {
  color: #475569;
  font-weight: 600;
}

.footer-contact {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.footer-contact a {
  color: #2563eb;
  text-decoration: underline;
}

.footer-copy {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 8px;
}

/* Modals for Terms & Privacy */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-window {
  background: #ffffff;
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modalScale 0.25s ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover {
  color: #0f172a;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 13.5px;
  line-height: 1.65;
  color: #334155;
}

.modal-body h4 {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  margin: 16px 0 6px;
}

.modal-body h4:first-child {
  margin-top: 0;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalScale {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==========================================================================
   Mobile & Responsive Optimization
   ========================================================================== */

/* Touch & Mobile Active States */
@media (hover: none) {
  .country-item:hover {
    transform: none;
    box-shadow: var(--shadow-item);
    border-color: var(--border-item);
  }

  .country-item:hover .flag-box {
    transform: none;
  }

  .product-spotlight:hover .product-hero-img {
    transform: none;
  }

  .country-item:active {
    transform: scale(0.97);
    background-color: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  }

  .review-cta-button:active {
    transform: scale(0.98);
    background: #020617;
  }

  .seo-toggle-link:active {
    background-color: #e2e8f0;
  }
}

/* Tablets & Small Laptops (max-width: 640px) */
@media (max-width: 640px) {
  body {
    padding: 24px 14px;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .presell-card {
    padding: 36px 24px 32px;
    border-radius: 22px;
  }

  .flags-grid {
    gap: 14px;
  }

  .country-item {
    padding: 22px 12px 18px;
  }

  .flag-box {
    width: 80px;
    height: 52px;
    margin-bottom: 12px;
  }
}

/* Standard Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {
  body {
    padding: 16px 10px;
    padding-top: max(14px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .presell-card {
    padding: 26px 16px 24px;
    border-radius: 18px;
    box-shadow: 0 10px 25px -10px rgba(15, 23, 42, 0.08);
  }

  .brand-logo {
    margin-bottom: 16px;
  }

  .brand-logo-img {
    max-height: 36px;
    max-width: 190px;
  }

  .card-title {
    font-size: 21px;
    letter-spacing: -0.3px;
    margin-bottom: 8px;
    line-height: 1.25;
  }

  .card-subtitle {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
    padding: 0 2px;
  }

  /* Product spotlight mobile */
  .product-spotlight {
    margin-bottom: 22px;
  }

  .product-image-wrap {
    width: 124px;
    height: 124px;
    margin-bottom: 8px;
  }

  .product-hero-img {
    max-height: 120px;
    max-width: 114px;
  }

  .product-spotlight-badge {
    font-size: 11px;
    padding: 5px 12px;
    max-width: 100%;
    line-height: 1.35;
    text-align: center;
    box-sizing: border-box;
  }

  /* Flags Grid: 2 columns with equal-height cards */
  .flags-grid {
    gap: 10px;
    margin-bottom: 20px;
  }

  .country-item {
    padding: 16px 8px 14px;
    min-height: 108px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .flag-box {
    width: 70px;
    height: 45px;
    margin-bottom: 9px;
    border-radius: 6px;
  }

  .country-name {
    font-size: 13.5px;
    line-height: 1.25;
    text-align: center;
    word-break: break-word;
  }

  /* Collapsible Review & SEO Information */
  .seo-review-wrapper {
    margin-top: 6px;
    padding-top: 14px;
  }

  .seo-toggle-link {
    font-size: 12.5px;
    padding: 10px 12px;
    width: 100%;
    justify-content: center;
    min-height: 44px;
    box-sizing: border-box;
  }

  .seo-review-content.expanded {
    margin-top: 14px;
  }

  .review-box {
    padding: 16px 12px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.6;
  }

  .review-badge {
    font-size: 11.5px;
    padding: 5px 10px;
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 3px;
    width: 100%;
    box-sizing: border-box;
  }

  .review-box h2 {
    font-size: 15px;
    line-height: 1.35;
    margin-bottom: 10px;
  }

  .review-box h3 {
    font-size: 13.5px;
    margin: 14px 0 6px;
  }

  /* Specs Table on Mobile */
  .specs-table {
    margin: 12px 0 16px;
    font-size: 11.5px;
  }

  .specs-table th,
  .specs-table td {
    padding: 8px 10px;
    font-size: 11.5px;
    line-height: 1.4;
  }

  .specs-table th {
    width: 44%;
  }

  .review-highlights li {
    padding-left: 20px;
    font-size: 12.5px;
    line-height: 1.55;
    margin-bottom: 8px;
  }

  .review-faq details {
    padding: 9px 12px;
  }

  .review-faq summary {
    font-size: 12.5px;
    line-height: 1.4;
  }

  .review-faq p {
    font-size: 12px;
    line-height: 1.5;
  }

  .review-cta-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    font-size: 13.5px;
    min-height: 48px;
    border-radius: 10px;
    text-align: center;
    box-sizing: border-box;
  }

  /* Footer on Mobile */
  .presell-footer {
    margin-top: 24px;
    padding: 0 6px;
  }

  .footer-nav {
    gap: 12px;
    font-size: 11.5px;
    flex-wrap: wrap;
    margin-bottom: 14px;
  }

  .footer-nav a {
    padding: 4px 6px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
  }

  .footer-disclaimer {
    font-size: 11px;
    line-height: 1.55;
    margin-bottom: 12px;
  }

  .footer-contact,
  .footer-copy {
    font-size: 11px;
  }

  /* Modals on Mobile */
  .modal-overlay {
    padding: 12px;
    align-items: flex-end;
  }

  .modal-window {
    max-height: 88vh;
    border-radius: 18px 18px 12px 12px;
  }

  .modal-header {
    padding: 14px 18px;
  }

  .modal-title {
    font-size: 16px;
  }

  .modal-close {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
  }

  .modal-body {
    padding: 16px 18px;
    font-size: 12.5px;
    line-height: 1.6;
  }

  .modal-body h4 {
    font-size: 13.5px;
    margin: 14px 0 5px;
  }
}

/* Compact Mobile Devices (max-width: 360px, e.g. iPhone SE, Galaxy Fold outer) */
@media (max-width: 360px) {
  body {
    padding: 12px 8px;
  }

  .presell-card {
    padding: 22px 12px 20px;
    border-radius: 16px;
  }

  .card-title {
    font-size: 19px;
  }

  .card-subtitle {
    font-size: 14px;
    margin-bottom: 16px;
  }

  .product-image-wrap {
    width: 108px;
    height: 108px;
  }

  .product-hero-img {
    max-height: 102px;
    max-width: 98px;
  }

  .product-spotlight-badge {
    font-size: 10px;
    padding: 4px 8px;
  }

  .flags-grid {
    gap: 8px;
  }

  .country-item {
    padding: 14px 6px 12px;
    min-height: 98px;
  }

  .flag-box {
    width: 58px;
    height: 38px;
    margin-bottom: 8px;
  }

  .country-name {
    font-size: 12px;
  }

  .seo-toggle-link {
    font-size: 11.5px;
    padding: 8px 10px;
  }

  /* Table stacked view on ultra-narrow screens */
  .specs-table th,
  .specs-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .specs-table th {
    background: #f1f5f9;
    padding: 6px 10px;
    font-size: 11px;
    border-bottom: none;
  }

  .specs-table td {
    padding: 4px 10px 8px;
    font-size: 11px;
    border-bottom: 1px solid #e2e8f0;
  }
}

/* Shared Legal Container (Terms & Privacy pages) */
.legal-container {
  background: #fff;
  max-width: 720px;
  margin: 40px auto;
  padding: 40px;
  border-radius: 20px;
  box-shadow: var(--shadow-main);
  line-height: 1.7;
  color: #334155;
  box-sizing: border-box;
}

@media (max-width: 560px) {
  .legal-container {
    padding: 22px 16px;
    margin: 12px auto;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.6;
  }

  .legal-container h1 {
    font-size: 21px;
    margin-bottom: 14px;
  }

  .legal-container h2 {
    font-size: 15px;
    margin: 18px 0 8px;
  }
}
