/**
 * UCM Size Charts – Frontend Styles
 *
 * @package UCM_Size_Charts
 */

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --ucm-black:      #2B2926;
  --ucm-yellow:     #F5C518;
  --ucm-white:      #FFFFFF;
  --ucm-g100:       #F2F1EE;
  --ucm-g200:       #E4E2DC;
  --ucm-g400:       #B5B1A8;
  --ucm-g600:       #6B6860;
  --ucm-yellow-bg:  #FFFADF;
  --ucm-f:          'UCMSans', system-ui, -apple-system, sans-serif;
  --ucm-r-sm:       4px;
  --ucm-r-md:       6px;
  --ucm-r-lg:       10px;
}

/* ============================================================
   RESET (scoped)
   ============================================================ */
.ucm-overlay *,
.ucm-overlay *::before,
.ucm-overlay *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ============================================================
   TRIGGER BUTTON
   ============================================================ */
.ucm-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--ucm-f);
  font-size: 13px;
  font-weight: 500;
  color: var(--ucm-black);
  background: none;
  border: none;
  border-bottom: 1px solid var(--ucm-black);
  padding: 0 0 1px;
  cursor: pointer;
  line-height: 1;
  margin-top: 8px;
}

.ucm-trigger svg {
  flex-shrink: 0;
}

.ucm-trigger:hover {
  opacity: 0.7;
}

/* ============================================================
   OVERLAY
   ============================================================ */
.ucm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 41, 38, 0.70);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overscroll-behavior: contain;
  animation: ucmFade 200ms ease-out;
}

.ucm-overlay[hidden] {
  display: none;
}

@keyframes ucmFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   MODAL
   ============================================================ */
.ucm-modal {
  background: var(--ucm-white);
  border-radius: var(--ucm-r-lg);
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 20px 60px rgba(43, 41, 38, 0.25);
  animation: ucmSlide 220ms ease-out;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

@keyframes ucmSlide {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- HEADER ---- */
.ucm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--ucm-g200);
  position: sticky;
  top: 0;
  background: var(--ucm-white);
  z-index: 2;
  flex-shrink: 0;
}

.ucm-header-l {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ucm-logo {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.ucm-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ucm-title {
  font-family: var(--ucm-f);
  font-size: 18px;
  font-weight: 700;
  color: var(--ucm-black);
  line-height: 1.2;
}

.ucm-sub {
  font-family: var(--ucm-f);
  font-size: 11px;
  font-weight: 400;
  color: var(--ucm-g600);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

.ucm-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ucm-close svg {
  width: 14px;
  height: 14px;
  stroke: var(--ucm-black);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---- TABS ---- */
.ucm-tabs {
  display: flex;
  padding: 0 28px;
  border-bottom: 1px solid var(--ucm-g200);
  flex-shrink: 0;
}

.ucm-tab {
  font-family: var(--ucm-f);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ucm-g600);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0 !important;
  padding: 14px 0;
  margin-right: 24px;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 120ms, border-color 120ms;
}

.ucm-tab.is-active {
  color: var(--ucm-black);
  border-bottom-color: var(--ucm-yellow);
  font-weight: 700;
  border-radius: 0 !important;
}

/* ---- BODY ---- */
.ucm-body {
  padding: 28px;
  flex: 1;
}

.ucm-panel {
  display: none;
}

.ucm-panel.is-active {
  display: block;
}

/* ============================================================
   LAYOUT: Tabuľka celý riadok, kroky pod ňou vedľa seba
   ============================================================ */
.ucm-layout {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.ucm-tbl-section {
  width: 100%;
}

/* ---- MERANIE – kroky vedľa seba ---- */
.ucm-measure-lbl {
  font-family: var(--ucm-f);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ucm-black);
  margin-bottom: 12px;
}

.ucm-measure-section {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.ucm-measure-illus {
  flex-shrink: 0;
  width: 160px;
}

.ucm-measure-illus-bg {
  background: var(--ucm-g100);
  border-radius: var(--ucm-r-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ucm-measure-illus-bg svg {
  width: 100%;
  max-width: 130px;
}

.ucm-measure-steps {
  flex: 1;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.ucm-measure-step {
  flex: 1;
  min-width: 160px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.ucm-measure-step-n {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ucm-f);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.n-y { background: var(--ucm-yellow); color: var(--ucm-black); }
.n-b { background: var(--ucm-black); color: var(--ucm-white); }
.n-g { background: var(--ucm-g400); color: var(--ucm-white); }
.n-d { background: var(--ucm-g200); color: var(--ucm-black); }

.ucm-measure-step-txt {
  font-family: var(--ucm-f);
  font-size: 12px;
  font-weight: 400;
  color: var(--ucm-black);
  line-height: 1.55;
}

.ucm-measure-step-txt strong {
  display: block;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1px;
}

.ucm-tip {
  background: var(--ucm-yellow-bg);
  border-left: 3px solid var(--ucm-yellow);
  border-radius: 0 var(--ucm-r-sm) var(--ucm-r-sm) 0;
  padding: 10px 14px;
  font-family: var(--ucm-f);
  font-size: 12px;
  font-weight: 400;
  color: var(--ucm-black);
  line-height: 1.5;
  margin-top: 16px;
}

.ucm-tip strong {
  font-weight: 700;
}

/* ============================================================
   TABUĽKA
   ============================================================ */
.ucm-tbl-lbl {
  font-family: var(--ucm-f);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ucm-black);
  margin-bottom: 14px;
}

.ucm-tbl-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--ucm-g200);
  border-radius: var(--ucm-r-md);
}

.ucm-tbl {
  width: 100%;
  border-collapse: collapse;
  min-width: 300px;
}

.ucm-tbl thead tr {
  background: var(--ucm-black);
}

.ucm-tbl thead th {
  font-family: var(--ucm-f);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ucm-white);
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
}

.ucm-tbl thead th:not(:first-child) {
  text-align: center;
}

.ucm-tbl tbody tr {
  border-bottom: 1px solid var(--ucm-g200);
}

.ucm-tbl tbody tr:last-child {
  border-bottom: none;
}

.ucm-tbl tbody td {
  font-family: var(--ucm-f);
  font-size: 14px;
  font-weight: 400;
  color: var(--ucm-black);
  padding: 12px 14px;
  text-align: center;
  height: 48px;
  vertical-align: middle;
}

.ucm-tbl tbody td:first-child {
  text-align: left;
  font-weight: 700;
  font-size: 15px;
}

.ucm-tbl-note {
  font-family: var(--ucm-f);
  font-size: 11px;
  font-weight: 400;
  color: var(--ucm-g600);
  margin-top: 10px;
  line-height: 1.55;
}

/* ============================================================
   FOOTER
   ============================================================ */
.ucm-footer {
  border-top: 1px solid var(--ucm-g200);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
  background: var(--ucm-white);
}

.ucm-footer-txt {
  font-family: var(--ucm-f);
  font-size: 12px;
  font-weight: 400;
  color: var(--ucm-g600);
  line-height: 1.5;
  max-width: 460px;
}

.ucm-footer-txt a {
  color: var(--ucm-black);
  font-weight: 700;
}

.ucm-footer-btn {
  font-family: var(--ucm-f);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--ucm-black);
  color: var(--ucm-white);
  border: none;
  padding: 10px 20px;
  border-radius: var(--ucm-r-sm);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============================================================
   RESPONZIVITA
   ============================================================ */
@media (max-width: 700px) {
  .ucm-measure-section {
    flex-direction: column;
  }

  .ucm-measure-illus {
    width: 100%;
  }

  .ucm-measure-steps {
    flex-direction: column;
  }

  .ucm-measure-step {
    min-width: unset;
  }

  .ucm-header {
    padding: 16px 20px;
  }

  .ucm-tabs {
    padding: 0 20px;
  }

  .ucm-body {
    padding: 20px;
  }

  .ucm-footer {
    padding: 16px 20px;
  }

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

  .ucm-modal {
    max-height: 95vh;
  }
}
