/* =========================================================
   Course Manager by KT12Digital — frontend.css (cleaned)
   - Added missing z-index + button rules
   - Removed duplicated TBCM wizard block (was repeated twice)
   - Kept everything else as-is, just organised
   ========================================================= */

/* === KT12: z-index safety for headers + floating carts === */
header{
  position: relative;
  z-index: 99999;
}
#fkcart-floating-toggler{z-index:99999 !important;}

/* Course Manager: "Add another" button styling */
#tbcm-add-another{background:#595959 !important;}


/* =========================
   TBCM — Horizontal wizard layout
   ========================= */

.tbcm-wrap{
  max-width: 100%;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
}

/* Top progress bar */
.tbcm-progress{
  display: flex;
  gap: 10px;
  margin: 0 0 14px 0;
  padding: 10px;
  border-radius: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.tbcm-progress-step{
  flex: 1;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #fff;
  opacity: .55;
}

.tbcm-progress-step .tbcm-num{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  background: #e5e7eb;
}

.tbcm-progress-step .tbcm-label{
  font-weight: bold !important;
  font-size: 13px;
  font-family:'Arial' !important;
  color:black !important;
}
#tbcm-course-title{color:black !important;}

.tbcm-progress-step.is-active{
  opacity: 1;
  border-color: #f97316;
  background: #fff7ed;
}

.tbcm-progress-step.is-active .tbcm-num{
  background: #f97316;
  color: #fff;
}

.tbcm-progress-step.is-done{
  opacity: 1;
  border-color: #86efac;
  background: #f0fdf4;
}

.tbcm-progress-step.is-done .tbcm-num{
  background: #166534;
  color: #fff;
}

/* Main 4-column wizard */
.tbcm-wizard{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

/* Each step becomes a card */
.tbcm-step{
  margin: 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #fff;
  min-height: 190px;
}

.tbcm-step h3{
  margin: 0 0 10px 0;
  font-size: 16px;
}

/* Grid inside each step */
.tbcm-days, .tbcm-slots, .tbcm-levels{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

/* Cards */
.tbcm-card{
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  margin-bottom:10px;
  font-family:'Arial'; font-weight:bold !important;
  font-size:16px !important;
}

.tbcm-card:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.06);
  border-color: #cbd5e1;
}

.tbcm-card.is-active{
  border-color: #f97316;
  background: #fff7ed;
}

.tbcm-card.is-disabled{
  opacity: .5;
  cursor: not-allowed;
}

.tbcm-card-title{
font-family:'Arial'; font-size:18px !important;}

.tbcm-card-sub{
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.tbcm-card-date{
  display:flex;
  align-items:center;
  gap:8px;
  color:#7a7a7a;
  font-size:14px;
}

.tbcm-cal{
  display:inline-flex;
  color:#9aa0a6;
}

.tbcm-level-row{
  display: flex;
  gap: 10px;
  align-items: center;
}

.tbcm-dot{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
}

/* Attendee form */
.tbcm-form{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.tbcm-form label{
  font-weight: 800;
  font-size: 13px;
}

.tbcm-form input{
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.tbcm-btn{
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 900;
  background: #166534;
  color: #fff;
}

.tbcm-btn:disabled{
  opacity: .6;
  cursor: not-allowed;
}

.tbcm-msg{
  display: none;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

.tbcm-msg.is-success{
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}
.tbcm-msg.is-error{
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

/* Empty / loading */
.tbcm-loading, .tbcm-empty{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  background: #fff;
  color: #6b7280;
}

/* Mobile: stack steps */
@media (max-width: 980px){
  .tbcm-wizard{
    grid-template-columns: 1fr;
  }
  .tbcm-progress{
    flex-direction: column;
  }
}

/* Make ALL links inside the booking UI black (incl. visited) */
.tbcm-wrap a,
.tbcm-wrap a:link,
.tbcm-wrap a:visited,
.tbcm-wrap a:hover,
.tbcm-wrap a:active {
  color: #000 !important;
  -webkit-text-fill-color: #000;
  text-decoration: none !important;
}
.tbcm-wrap a * {
  color: inherit !important;
  -webkit-text-fill-color: inherit;
}
.tbcm-wrap a[x-apple-data-detectors],
.tbcm-wrap a[x-apple-data-detectors] * {
  color: #000 !important;
  -webkit-text-fill-color: #000;
  text-decoration: none !important;
}

/* Make selects match input width & style */
.tbcm-form select {
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #dcdfe6;
  font-size: 16px;
  background-color: #fff;
  box-sizing: border-box;
}

/* Match input height exactly */
.tbcm-form input,
.tbcm-form select,
.tbcm-form textarea {
  min-height: 48px !important;
}

/* Optional: nicer focus state */
.tbcm-form select:focus {
  outline: none;
  border-color: #2b7cff;
  box-shadow: 0 0 0 2px rgba(43,124,255,0.15);
}
.tbcm-form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='https://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}

/* Force the wizard to be single-column full width */
#tbcm-wizard{
  display:block !important;
  width:100% !important;
}
#tbcm-wizard .tbcm-step{
  width:100% !important;
  max-width:none !important;
  flex: none !important;
}
#tbcm-days,
#tbcm-slots,
#tbcm-levels,
#tbcm-attendee-step .tbcm-form{
  width:100% !important;
}

/* =========================
   TBCM Attendee step – stylish form controls
   ========================= */

#tbcm-attendee-step .tbcm-form{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 10px;
}

#tbcm-attendee-step .tbcm-form label{
  display:block;
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
  margin: 0 0 8px;
}

#tbcm-attendee-step .tbcm-form input[type="text"],
#tbcm-attendee-step .tbcm-form input[type="number"],
#tbcm-attendee-step .tbcm-form input[type="tel"],
#tbcm-attendee-step .tbcm-form select,
#tbcm-attendee-step .tbcm-form textarea{
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  font-size: 15px;
  line-height: 1.2;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

#tbcm-attendee-step .tbcm-form textarea{
  min-height: 110px;
  resize: vertical;
}

#tbcm-attendee-step .tbcm-form input:focus,
#tbcm-attendee-step .tbcm-form select:focus,
#tbcm-attendee-step .tbcm-form textarea:focus{
  border-color: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,.15);
}

/* =========================
   Cart / Checkout meta toggle styling (Course items)
   ========================= */

.hthc-cart-meta { margin-top: 10px; }
.hthc-cart-meta summary { cursor:pointer; font-weight:600; list-style:none; }
.hthc-cart-meta summary::-webkit-details-marker { display:none; }

.hthc-cart-meta .hthc-hide { display:none; }
.hthc-cart-meta[open] .hthc-show { display:none; }
.hthc-cart-meta[open] .hthc-hide { display:inline; }

.hthc-cart-meta__inner {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 8px;
}

.hthc-meta-row { padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,0.06); }
.hthc-meta-row:last-child { border-bottom: 0; }
.hthc-meta-name { font-weight: 700; }

/* Checkout: slight tightening */
.woocommerce-checkout .hthc-cart-meta summary{ padding: 8px 0; }
.woocommerce-checkout .hthc-cart-meta__inner{ background: #fff; }


/* =========================
   NAVIGATION
   ========================= */

/* Default state */
.desktop-nav { display: block; }
.mobile-nav { display: none; }

/* Switch EXACTLY at 1170px */
@media (max-width: 1170px) {
  .desktop-nav { display: none !important; }
  .mobile-nav { display: block !important; }
}


/* Location info toggle (Cart & Checkout) */
.htc-cm-loc-wrap .htc-cm-loc-extra { display: none; }
.htc-cm-loc-wrap.is-open .htc-cm-loc-extra { display: block; }
.htc-cm-loc-wrap .htc-cm-loc-toggle { text-decoration: underline; cursor: pointer; }


/* =========================================================
   TBCM — Centre-screen wait modal (DOM overlay)
   Popup-blocker safe because it's not a browser popup.
   ========================================================= */

#tbcm-wait-modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 999999; /* above Divi headers/floating buttons */
}
#tbcm-wait-modal.is-open{display:block;}

#tbcm-wait-modal .tbcm-wait-modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}

#tbcm-wait-modal .tbcm-wait-modal__panel{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100% - 34px));
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 18px 45px rgba(0,0,0,.20);
  padding: 18px 18px 16px;
  text-align: center;
}

#tbcm-wait-modal .tbcm-wait-modal__spinner{
  width: 44px;
  height: 44px;
  margin: 6px auto 12px;
  border-radius: 999px;
  border: 4px solid rgba(0,0,0,.10);
  border-top-color: rgba(0,0,0,.55);
  animation: tbcmSpin 0.9s linear infinite;
}

#tbcm-wait-modal .tbcm-wait-modal__title{
  font-weight: 800;
  font-size: 18px;
  color: #111;
  margin: 0 0 6px;
}

#tbcm-wait-modal .tbcm-wait-modal__text{
  font-size: 14px;
  color: rgba(0,0,0,.75);
  margin: 0;
}

@keyframes tbcmSpin{
  from{ transform: rotate(0deg); }
  to{ transform: rotate(360deg); }
}
