/* Matagi custom UI
   - cleaned / merged
   - auth layout works when .matagi-auth exists
   - payment / submit area included
*/

/* =========================
   Fonts
   ========================= */
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-v9-latin-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-v9-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-v9-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* =========================
   Misc UI
   ========================= */
.alert.matagi-login-status {
  font-size: 20px;
  font-weight: 600;
  padding: 14px 18px;
}
.matagi-login-status i {
  font-size: 20px;
  vertical-align: -2px;
  margin-right: 8px;
}

.matagi-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.matagi-title .header-logo {
  width: 270px !important;
  height: auto !important;
}
.matagi-title h2 {
  margin: 0;
  padding: 0;
  font-size: 36px;
}

.header-order-history {
  margin-right: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
}

/* Member No card */
.matagi-member-no-card {
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.matagi-member-no-label {
  font-weight: 700;
  margin-bottom: 6px;
}
.matagi-member-no-value {
  font-size: 18px;
  letter-spacing: 0.5px;
}

/* =========================
   Card
   ========================= */
.card {
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 22px rgba(17,24,39,.05);
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid #eef0f3;
}
.card-body {
  padding: 18px;
}

/* =========================
   Sidebar menu
   ========================= */
.sidebar-menu li a span {
  font-size: 17px;
  font-weight: 500;
}
.sidebar-menu .menu-header {
  font-size: 15px !important;
  font-weight: 700 !important;
}

/* =========================
   Form
   ========================= */
.form-control {
  border-radius: 8px;
  border: 1px solid #c9ccd0;
  padding: 10px 12px;
  font-size: 16px !important;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14,165,233,.18);
}

/* Order form table header */
#order-form thead th {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
#order-form thead th code {
  font-size: 14px;
  color: #d33;
  font-weight: 700;
}

.form-group label {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 6px;
}

/* =========================
   Button
   ========================= */
.btn {
  border-radius: 8px;
  font-weight: 700;
  padding: 10px 18px;
  font-size: 15px !important;
  transition: box-shadow .15s ease, transform .05s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: #111827;
  border-color: #111827;
}

/* =========================
   Helper / Table / Misc
   ========================= */
.text-muted {
  color: #6b7280 !important;
  font-size: 13px;
}

.table {
  font-size: 14px;
}
.table th {
  background: #f6f7f9;
  font-weight: 600;
}

.matagi-soft {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.invoice .invoice-detail-item .invoice-detail-name {
  font-size: 16px;
}

/* =========================
   Theme overrides – Card
   ========================= */
html body.wp-theme-matagi-shopping .card {
  border: 1px solid rgba(0,0,0,.10) !important;
  border-radius: 14px !important;
  box-shadow: 3px 3px 10px rgb(225,225,225) !important;
  background: #fff !important;
}
html body.wp-theme-matagi-shopping .card .card-header {
  padding: 16px 18px !important;
  border-bottom: 1px solid rgba(0,0,0,.08) !important;
  background: #fafafa !important;
}

/* =========================
   Theme overrides – Auth buttons
   (single source of truth)
   ========================= */
html body.wp-theme-matagi-shopping .matagi-auth-actions a.btn-primary {
  background: linear-gradient(180deg,#3bb2e6,#2ea3db) !important;
  border: 1px solid #2ea3db !important;
  color: #fff !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  box-shadow: 3px 3px 8px rgba(0,0,0,.12) !important;
  transition: all .15s ease !important;
}
html body.wp-theme-matagi-shopping .matagi-auth-actions a.btn-primary:hover {
  background: linear-gradient(180deg,#1d4ed8,#1e40af) !important;
  border-color: #1e40af !important;
  color: #fff !important;
  box-shadow: 2px 2px 7px rgba(0,0,0,.20) !important;
  transform: translateY(-1px) !important;
}
html body.wp-theme-matagi-shopping .matagi-auth-actions a.btn-outline {
  background: #29A7A9 !important;
  border: 1px solid #29A7A9 !important;
  color: #fff !important;
  box-shadow: 2px 2px 7px rgba(0,0,0,.20) !important;
  transition: all .15s ease !important;
}
html body.wp-theme-matagi-shopping .matagi-auth-actions a.btn-outline:hover {
  background: #4f5ece !important;
  border-color: #4f5ece !important;
  color: #fff !important;
  box-shadow: 2px 2px 7px rgba(0,0,0,.20) !important;
  transform: translateY(-1px);
}
html body.wp-theme-matagi-shopping .matagi-auth-actions a.btn-outline:active,
html body.wp-theme-matagi-shopping .matagi-auth-actions a.btn-primary:active {
  transform: translateY(0) !important;
  box-shadow: 0 4px 10px rgba(0,0,0,.12) !important;
}

/* =========================
   Payment section
   ========================= */
.section-title {
  margin-bottom: 18px !important;
}
.section-lead {
  margin-top: 0 !important;
  color: #60686f;
  font-size: 16px;
  line-height: 1.8;
}

.matagi-payment-text {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.8;
  color: #60686f;
}
.matagi-payment-text:last-child {
  margin-bottom: 0;
}

.matagi-payment-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  margin: 20px 0;
}
.matagi-payment-icons img {
  height: 38px;
  width: auto;
  max-width: 60px;
  object-fit: contain;
  display: inline-block;
}

/* =========================
   Submit button area
   ========================= */
.matagi-submit-area {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  margin-bottom: 50px;
}
html body.wp-theme-matagi-shopping .matagi-submit-btn.btn.btn-primary {
  padding: 14px 60px !important;
  font-size: 18px !important;
  border-radius: 10px !important;
}

/* =========================
   SWPM Account page
   ========================= */
.swpm-edit-profile-form-inner,
.swpm-edit-profile-form-inner .swpm-form-row,
.swpm-edit-profile-form-inner .swpm-form-label-wrap label,
.swpm-edit-profile-form-inner .swpm-form-input-wrap,
.swpm-edit-profile-form-inner .swpm-form-desc,
.swpm-edit-profile-submit-section {
  font-size: 17px !important;
  line-height: 1.7 !important;
}
.swpm-edit-profile-form-inner input,
.swpm-edit-profile-form-inner select {
  font-size: 17px !important;
  line-height: 1.5 !important;
  padding: 10px 12px !important;
}
.swpm-edit-profile-form-inner .swpm-form-username-input-wrap,
.swpm-edit-profile-form-inner .swpm-form-membership-level-input-wrap {
  font-size: 17px !important;
  line-height: 1.7 !important;
}
.swpm-edit-profile-submit-section .swpm-submit,
.swpm-edit-profile-submit-section .swpm-profile-submit-button {
  font-size: 17px !important;
  padding: 12px 28px !important;
  min-width: 160px;
}
.swpm-membership-level-row {
  display: none !important;
}
.swpm-edit-profile-form-inner .swpm-form-row {
  margin-bottom: 16px !important;
}
.swpm-submit-section {
  margin-top: 40px !important;
}

/* Back to Home link */
.matagi-back-home a {
  display: inline-block;
  margin-top: 10px;
  font-size: 15px;
  color: #60686f;
  text-decoration: none;
}
.matagi-back-home a:hover {
  text-decoration: underline;
}

/* =========================
   Legal pages
   ========================= */
.legal-page {
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.9;
  font-size: 16px;
  color: #333;
}
.legal-title {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 24px;
}
.legal-lead {
  font-size: 18px;
  margin: 0 0 20px;
}
.legal-section {
  margin: 0 0 32px;
}
.legal-heading {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 14px;
}
.legal-text {
  margin: 0 0 14px;
}
.legal-list {
  margin: 0 0 14px 22px;
  padding: 0;
}
.legal-list li {
  margin: 0 0 8px;
}

.legal-dl {
  display: grid;
  grid-template-columns: 220px 1fr;
  margin-top: 20px;
}
.legal-dl dt,
.legal-dl dd {
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
}
.legal-dl dt {
  font-weight: 700;
  color: #374151;
}
.legal-dl dd {
  margin: 0;
  color: #111827;
}

/* =========================
   Order footer info
   ========================= */
.matagi-order-legal {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  text-align: center;
}
.matagi-order-agree {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.7;
  color: #60686f;
}
.matagi-order-legal-links {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: #6b7280;
}
.matagi-order-legal-links a {
  color: #6b7280;
}
.matagi-order-legal-links a:hover {
  text-decoration: underline;
}

.matagi-shipping-note {
  text-align: center;
  font-size: 16px;
  color: #6b7280;
  margin: 10px 0 18px;
  line-height: 1.6;
}

/* =========================
   Auth pages
   ========================= */

/* Hide theme chrome on auth pages */
body:has(.matagi-auth) .navbar-bg,
body:has(.matagi-auth) .navbar,
body:has(.matagi-auth) .main-sidebar,
body:has(.matagi-auth) .main-footer,
body:has(.matagi-auth) .section-header,
body:has(.matagi-auth) .breadcrumb,
body:has(.matagi-auth) .page-title,
body:has(.matagi-auth) .section-header-breadcrumb,
body:has(.matagi-auth) .card .card-header {
  display: none !important;
}

/* Strip layout spacing on auth pages */
body:has(.matagi-auth) .main-content,
body:has(.matagi-auth) .main-wrapper {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  min-height: auto !important;
}

body:has(.matagi-auth) .section,
body:has(.matagi-auth) .section-body,
body:has(.matagi-auth) .row,
body:has(.matagi-auth) .col-12,
body:has(.matagi-auth) .col-lg-12,
body:has(.matagi-auth) .container,
body:has(.matagi-auth) .container-fluid {
  margin: 0 !important;
  padding: 0 !important;
  min-height: auto !important;
  overflow: visible !important;
}

body:has(.matagi-auth) .main-content > section.section,
body:has(.matagi-auth) .main-content > section.section > .section-body,
body:has(.matagi-auth) .main-content > section.section .card,
body:has(.matagi-auth) .main-content > section.section .card .card-body {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* Auth fullscreen overlay */
body:has(.matagi-auth) .matagi-auth,
body:has(.matagi-auth) .matagi-auth * {
  visibility: visible !important;
}
body:has(.matagi-auth) .matagi-auth {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
  width: 100% !important;
  min-height: 100vh !important;
  padding: 48px 16px 18px !important;
  overflow: auto !important;
  background: #f4f6f9 !important;
}
body.admin-bar:has(.matagi-auth) .matagi-auth {
  padding-top: 80px !important;
}

/* Top page variant */
body:has(.matagi-auth) .matagi-auth-top {
  justify-content: center !important;
  align-items: flex-start !important;
}

/* Inner containers */
body:has(.matagi-auth) .matagi-auth-top-inner {
  width: 100% !important;
  max-width: 420px !important;
  margin: 0 auto !important;
}
body:has(.matagi-auth) .matagi-auth-card {
  width: 100% !important;
  max-width: 420px !important;
  margin: 0 auto !important;
}

/* Auth card component */
.matagi-auth-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  overflow: hidden;
}
.matagi-auth-card-inner {
  padding: 22px 22px 18px;
}
.matagi-auth-logo {
  text-align: center;
  margin: 6px 0 14px;
}
.matagi-auth-logo img {
  max-width: 260px;
  width: 100%;
  height: auto;
}
.matagi-auth-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  margin: 10px 0 8px;
  text-align: center;
}
.matagi-auth-desc {
  color: #666 !important;
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 14px;
  text-align: center;
}

/* Auth action buttons layout */
.matagi-auth-actions {
  display: flex;
  gap: 10px;
  margin: 10px 0 18px;
}
.matagi-auth-actions a {
  flex: 1;
  display: inline-block;
  text-align: center;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
}
.matagi-auth-actions-3 {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.matagi-auth-actions-3 a {
  flex: 1 1 130px;
}

/* System notice */
.matagi-system-notice {
  margin: 0 0 10px;
  padding: 18px 22px;
  border-radius: 10px;
  background: #fff7d6;
  border: 1px solid #f2d37a;
  color: #5a4b00;
  font-size: 17px;
  line-height: 1.7;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.10);
}
.matagi-system-notice strong {
  display: block;
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .6px;
}
.matagi-system-notice i {
  margin-right: 6px;
}

/* Auth footer links */
.matagi-contact-note {
  margin: 18px 0 20px;
  font-size: 16px;
  color: #6b7280;
  text-align: center;
  line-height: 1.6;
}
.matagi-contact-note a {
  font-weight: 600;
}
.matagi-legal-links {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.8;
  text-align: center;
  color: #6b7280;
}
.matagi-legal-links a {
  color: #6b7280;
}
.matagi-legal-links a:hover {
  text-decoration: underline;
}
.matagi-auth-footer {
  text-align: center;
  color: #8a8a8a;
  font-size: 12px;
  margin-top: 18px;
}

/* Auth form inputs */
.matagi-auth-card .swpm-login-widget-form label,
.matagi-auth-card form label {
  font-weight: 700;
  font-size: 16px;
}
.matagi-auth-card input[type="text"],
.matagi-auth-card input[type="email"],
.matagi-auth-card input[type="tel"],
.matagi-auth-card input[type="password"],
.matagi-auth-card select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.22);
  padding: 10px 12px;
  font-size: 15px;
  box-sizing: border-box;
}
.matagi-auth-card button,
.matagi-auth-card input[type="submit"] {
  width: 100%;
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 16px;
  border: 2px solid #bcbcbc;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 767px) {
  .matagi-payment-icons {
    gap: 8px 10px;
  }
  .matagi-payment-icons img {
    height: 24px;
    max-width: 46px;
  }
  .matagi-payment-text,
  .section-lead {
    font-size: 16px;
    line-height: 1.75;
  }
  html body.wp-theme-matagi-shopping .matagi-submit-btn.btn.btn-primary {
    padding: 12px 28px !important;
    font-size: 15px !important;
  }
}

@media (max-width: 640px) {
  /* Legal */
  .legal-dl {
    grid-template-columns: 1fr;
  }
  .legal-dl dt {
    margin-top: 12px;
  }

  /* Auth overlay */
  body:has(.matagi-auth) .matagi-auth {
    padding: 32px 10px 100px !important;
  }
  body.admin-bar:has(.matagi-auth) .matagi-auth {
    padding-top: 72px !important;
  }
  body:has(.matagi-auth) .matagi-auth-top-inner,
  body:has(.matagi-auth) .matagi-auth-card {
    max-width: none !important;
  }

  /* Auth card */
  .matagi-auth-card-inner {
    padding: 18px 16px 16px;
  }
  .matagi-auth-logo {
    margin: 0 0 8px;
  }
  .matagi-auth-logo img {
    max-width: 230px;
  }
  .matagi-auth-title {
    font-size: 22px;
    margin: 6px 0 8px;
  }
  .matagi-auth-desc {
    font-size: 16px !important;
    line-height: 1.55;
    margin: 0 0 12px;
  }

  /* System notice */
  .matagi-system-notice {
    font-size: 15px;
    line-height: 1.65;
    padding: 14px;
    margin: 0 0 10px;
  }
  .matagi-system-notice strong {
    font-size: 18px;
    margin-bottom: 8px;
  }

  /* Auth actions */
  .matagi-auth-actions {
    gap: 8px;
    margin: 10px 0 14px;
  }
  .matagi-auth-actions a {
    font-size: 15px;
    padding: 11px 12px;
  }
  .matagi-auth-actions-3 {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .matagi-auth-actions-3 a {
    flex: none;
    width: 100%;
  }

  /* Auth footer */
  .matagi-contact-note {
    margin: 18px 0 18px;
    font-size: 16px;
  }
  .matagi-legal-links {
    font-size: 15px;
    line-height: 1.9;
  }
  .matagi-auth-footer {
    margin-top: 15px;
    font-size: 13px;
  }

  /* Auth form inputs */
  .matagi-auth-card input[type="text"],
  .matagi-auth-card input[type="email"],
  .matagi-auth-card input[type="tel"],
  .matagi-auth-card input[type="password"],
  .matagi-auth-card select {
    font-size: 16px;
    padding: 12px 12px;
  }
  .matagi-auth-card button,
  .matagi-auth-card input[type="submit"] {
    font-size: 16px;
    padding: 13px 14px;
  }
}

/* =========================================================
   Cloudflare Turnstile (bot protection)
   - OrderフォームのTurnstileウィジェット配置
   - Submitボタンの上に表示
   ========================================================= */
.matagi-turnstile-wrap{
  margin:18px 0 12px;
  display:flex;
  justify-content:center;
}

/* =========================================================
   SWPM success message
   ========================================================= */
.swpm_success{
  font-size:16px;
  margin-bottom:30px;
  padding:14px 16px;
  border-radius:8px;
  background:#ecfdf5;
  border:1px solid #10b981;
  color:#065f46;
  font-weight:600;
}