/* product-page.css — หน้า Microsoft 365 Family (page-microsoft-365-family.php) */

body.page-microsoft-365-family,
body.page-check { background: #ffffff; }

.mspage-hero-sm .mspage-hero-inner { padding: 40px 24px 32px; }

#mspage { max-width: var(--max-w); margin: 0 auto; padding: 0 24px 100px; }

.mspage-hero {
  background: linear-gradient(160deg, #ffffff 0%, #fffbeb 60%, #ffffff 100%);
  margin: 0 calc(50% - 50vw);
  padding-top: var(--nav-h);
}
.mspage-hero-inner { max-width: var(--max-w); margin: 0 auto; padding: 40px 24px 48px; text-align: center; }
.mspage-hero .art-breadcrumb { justify-content: center; margin-bottom: 20px; }
.mspage-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.mspage-sub { color: var(--muted); font-size: 1rem; }

.mspage-section { padding: 48px 0; border-top: 1px solid var(--border); }
.mspage-section:first-of-type { border-top: none; }
.mspage-section .section-label { text-align: left; }

/* ── Gallery / Reviews shared carousel shell ── */
.ms-gallery, .ms-reviews { position: relative; display: flex; align-items: center; gap: 8px; }

.ms-gallery-track, .ms-reviews-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px;
  flex: 1;
}
.ms-gallery-track::-webkit-scrollbar, .ms-reviews-track::-webkit-scrollbar { display: none; }
.ms-gallery-track, .ms-reviews-track { scrollbar-width: none; }

.ms-gallery-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow, 0 10px 34px rgba(15,23,42,.07));
}
.ms-gallery-slide img { width: 100%; height: auto; display: block; }

.ms-gallery-nav {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text2);
  font-size: 1rem;
  cursor: pointer;
  transition: 0.15s;
}
.ms-gallery-nav:hover { background: var(--primary); border-color: var(--primary); color: #111; }

/* ── Supported platforms ── */
.ms-platforms { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; }
.ms-platform {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1rem; color: var(--text2);
}
.ms-platform svg { width: 28px; height: 28px; fill: var(--primary); }

/* ── Reviews ── */
.ms-review-card {
  flex: 0 0 min(320px, 82vw);
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: var(--card-shadow, 0 10px 34px rgba(15,23,42,.07));
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ms-review-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ms-review-name { font-weight: 700; font-size: 0.92rem; color: var(--text); }
.ms-review-stars { color: var(--yellow-d); font-size: 0.85rem; letter-spacing: 1px; }
.ms-review-text { font-size: 0.9rem; color: var(--text2); line-height: 1.6; }
.ms-review-source { text-align: center; margin-top: 20px; font-size: 0.85rem; color: var(--muted); }
.ms-review-source a { color: var(--primary-d); font-weight: 600; }

/* ── Videos ── */
.ms-videos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.ms-video-wrap { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.ms-video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

/* ── FAQ (native <details>/<summary>) ── */
.ms-faq { display: flex; flex-direction: column; gap: 10px; }
.ms-faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  background: #fff;
}
.ms-faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ms-faq-item summary::-webkit-details-marker { display: none; }
.ms-faq-item summary::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--primary-d);
  transition: transform 0.2s;
}
.ms-faq-item[open] summary::after { transform: rotate(45deg); }
.ms-faq-answer { margin-top: 12px; font-size: 0.92rem; color: var(--text2); line-height: 1.7; }
.ms-faq-answer a { color: var(--primary-d); font-weight: 600; }

/* ── CTA banner ── */
.ms-cta {
  display: block;
  position: relative;
  min-height: 240px;
  border-radius: var(--radius);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  text-decoration: none;
}
.ms-cta-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(15,23,42,.75), rgba(15,23,42,.35));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; text-align: center; padding: 24px;
}
.ms-cta-title { color: #fff; font-size: 1.4rem; font-weight: 700; }
.ms-cta-btn {
  display: inline-flex; align-items: center;
  background: var(--primary); color: #111;
  font-weight: 700; padding: 12px 28px;
  border-radius: 999px; transition: 0.15s;
}
.ms-cta:hover .ms-cta-btn { background: var(--primary-d); color: #fff; }

@media (max-width: 720px) {
  .ms-videos { grid-template-columns: 1fr; }
  .ms-platforms { gap: 24px; }
}

/* ── Checker (หน้าเช็ควันหมดอายุ) ── */
.checker { max-width: 560px; margin: 0 auto 28px; text-align: center; }
.checker-box { display: flex; justify-content: center; gap: 0; margin-bottom: 20px; }
.checker-box input {
  height: 52px;
  width: 320px;
  padding: 0 18px;
  font-size: 1rem;
  font-family: var(--font);
  border: 1.5px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.checker-box button {
  height: 52px;
  padding: 0 28px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font);
  background: var(--primary);
  color: #111;
  border: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  transition: background 0.15s;
}
.checker-box button:hover { background: var(--primary-d); color: #fff; }

.checker-note { font-size: 0.85rem; color: var(--muted); margin: 4px auto; max-width: 560px; text-align: center; line-height: 1.6; }
.checker-note-danger { color: var(--red-d, #dc2626); }

#result { margin-top: 24px; }
#result p { color: var(--muted); }

/* Loading: โลโก้วิ่งส่ายซ้าย-ขวาพร้อมกระเด้ง ระหว่างรอผลค้นหา */
.checker-loading { display: flex; justify-content: center; padding: 20px 0; overflow: hidden; }
.checker-loading img {
  width: 64px;
  height: auto;
  animation: checkerRun 0.9s ease-in-out infinite;
}
@keyframes checkerRun {
  0%   { transform: translateX(-36px) translateY(0)    rotate(-8deg); }
  25%  { transform: translateX(-12px) translateY(-14px) rotate(6deg); }
  50%  { transform: translateX(12px)  translateY(0)    rotate(-8deg); }
  75%  { transform: translateX(36px)  translateY(-14px) rotate(6deg); }
  100% { transform: translateX(-36px) translateY(0)    rotate(-8deg); }
}

.table-desktop {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--card-shadow, 0 10px 34px rgba(15,23,42,.07));
}
.table-desktop th {
  background: linear-gradient(135deg, var(--yellow-d), var(--yellow));
  color: #fff;
  padding: 16px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.table-desktop td { padding: 18px 16px; text-align: center; border-bottom: 1px solid var(--border-l); color: var(--text2); font-size: 1rem; }
.table-desktop tr:nth-child(even) td { background: var(--bg2); }
.table-desktop tr:last-child td { border-bottom: none; }
.table-desktop td:first-child { font-weight: 700; color: var(--text); }
/* คอลัมน์ "เหลือ (วัน)" ให้เด่นเป็นพิเศษ */
.table-desktop td:last-child { font-weight: 800; font-size: 1.15rem; }
.table-desktop td.danger, .table-desktop td.safe {
  display: inline-block;
  margin: 8px 0;
  padding: 4px 16px;
  border-radius: 999px;
}
.table-desktop td.danger { background: rgba(220, 38, 38, 0.1); color: var(--red-d, #dc2626); }
.table-desktop td.safe   { background: rgba(6, 95, 70, 0.1); color: #065f46; }

.cards { display: none; flex-direction: column; gap: 14px; }
.card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; text-align: left; background: #fff; }
.card-row { display: flex; justify-content: space-between; margin-bottom: 8px; }
.card-row:last-child { margin-bottom: 0; }
.card-label { color: var(--muted); font-size: 0.88rem; }
.card-value { font-weight: 700; color: var(--text); font-size: 0.92rem; }

.danger { color: var(--red-d, #dc2626); }
.safe { color: #065f46; }

@media (max-width: 640px) {
  .checker-box { flex-direction: column; }
  .checker-box input,
  .checker-box button { width: 100%; border-radius: var(--radius-sm); }
  .checker-box input { border-right: 1.5px solid var(--border); margin-bottom: 10px; }
  .table-desktop { display: none; }
  .cards { display: flex; }
}

/* ── Setup page (page-setup.php) — แท็บติดตั้งใช้งาน ── */
.ms-tabs-bar {
  display: flex; gap: 4px; overflow-x: auto; margin-bottom: 32px;
  border-bottom: 1.5px solid var(--border); scrollbar-width: none;
}
.ms-tabs-bar::-webkit-scrollbar { display: none; }
.ms-tab-btn {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 12px 20px; border: none; background: transparent; cursor: pointer;
  font-family: var(--font); font-size: 0.92rem; font-weight: 700; color: var(--muted);
  border-bottom: 3px solid transparent; transition: 0.15s; white-space: nowrap;
}
.ms-tab-btn svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.ms-tab-btn:hover { color: var(--primary-d); }
.ms-tab-btn.active { color: var(--primary-d); border-bottom-color: var(--primary); }

.ms-tab-panel { display: none; }
.ms-tab-panel.active { display: block; animation: msTabFade 0.25s ease; }
@keyframes msTabFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.setup-callout {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px;
  font-size: 0.92rem; line-height: 1.7; font-weight: 600;
}
.setup-callout.danger  { background: rgba(220,38,38,.08);  border-left: 4px solid var(--red-d);  color: var(--red-d); }
.setup-callout.info    { background: rgba(37,99,235,.08);  border-left: 4px solid var(--blue-d); color: var(--blue-d); }
.setup-callout.success { background: rgba(16,124,16,.08);  border-left: 4px solid #107c10;       color: #0d5e0d; }
.setup-callout.purple  { background: rgba(135,100,184,.1); border-left: 4px solid #8764b8;       color: #5b3d84; }

.setup-figure { margin: 0 0 24px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.setup-figure img { width: 100%; height: auto; display: block; }

.setup-install-btn {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 28px;
  background: var(--primary); color: #111; font-weight: 700; padding: 12px 24px;
  border-radius: 999px; transition: 0.15s;
}
.setup-install-btn:hover { background: var(--primary-d); color: #fff; }

.setup-block { margin-bottom: 32px; }
.setup-block-title { font-weight: 700; font-size: 1.02rem; color: var(--text); margin-bottom: 14px; }

.setup-shots { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 8px; scrollbar-width: none; }
.setup-shots::-webkit-scrollbar { display: none; }
.setup-shots img { flex: 0 0 min(260px, 72vw); scroll-snap-align: start; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* sub-tabs ในแท็บ "การลงชื่อเข้าใช้งาน" */
.ms-subtabs-bar { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.ms-subtab-btn {
  padding: 8px 20px; border: 1.5px solid var(--border); border-radius: 999px; background: #fff;
  font-family: var(--font); font-weight: 700; font-size: 0.86rem; color: var(--text2); cursor: pointer; transition: 0.15s;
}
.ms-subtab-btn.active, .ms-subtab-btn:hover { background: var(--primary); border-color: var(--primary); color: #111; }
.ms-subtab-panel { display: none; }
.ms-subtab-panel.active { display: block; animation: msTabFade 0.25s ease; }

.step-card {
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 14px; overflow: hidden; box-shadow: var(--card-shadow, 0 10px 34px rgba(15,23,42,.05));
}
.step-header { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: var(--bg2); border-bottom: 1px solid var(--border); }
.step-num {
  width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #111;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; flex-shrink: 0;
}
.step-header h3 { font-weight: 700; font-size: 0.94rem; color: var(--text); }
.step-body { padding: 16px 20px; }
.step-body p { color: var(--text2); font-size: 0.9rem; margin-bottom: 8px; line-height: 1.7; }
.step-body p:last-child { margin-bottom: 0; }

.method-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.method-item { display: flex; gap: 10px; align-items: flex-start; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.method-item .method-icon { font-size: 1.2rem; flex-shrink: 0; line-height: 1; }
.method-item strong { display: block; color: var(--text); font-size: 0.86rem; margin-bottom: 2px; }
.method-item span { font-size: 0.8rem; color: var(--muted); line-height: 1.6; }

.setup-lang-card { max-width: 420px; }

@media (max-width: 640px) {
  .ms-tab-btn { padding: 10px 14px; font-size: 0.82rem; }
  .setup-shots img { flex-basis: 80vw; }
}

/* ── Contact page (page-contact.php) ── */
.contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.contact-link-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 28px; border-radius: 999px; border: 1.5px solid var(--border);
  background: #fff; color: var(--text); font-weight: 700; font-size: 0.98rem;
  transition: 0.15s; box-shadow: var(--card-shadow, 0 10px 34px rgba(15,23,42,.05));
}
.contact-link-btn svg { width: 22px; height: 22px; fill: #1877f2; flex-shrink: 0; }
.contact-link-btn.line svg { fill: #06c755; }
.contact-link-btn:hover { background: var(--bg2); border-color: var(--primary); }

/* ── About page (page-about.php) ── */
.about-content { max-width: 720px; margin: 0 auto; text-align: center; }
.about-content p { color: var(--text2); font-size: 1.02rem; line-height: 1.9; }

/* ── WooCommerce cart / my-account (page-cart.php, page-my-account.php) ── */
body.woocommerce-cart .mspage-section,
body.woocommerce-account .mspage-section { max-width: 960px; margin: 0 auto; }
