/* ===== PLUGIN CSS CUSTOM PROPERTIES ===== */
/* Only values without a Bricks equivalent. Colors/fonts/borders use Bricks globals. */
:root{
  --kurzy-dropdown-shadow:0 8px 24px rgba(0,0,0,.12);
  --kurzy-input-height:42px;
  --kurzy-input-padding:8px 10px;
  --kurzy-input-disabled-bg:#f5f5f5;
  --kurzy-soldout-bg:#e74c3c;
}

/* ===== SHARED ROW LAYOUT ===== */
.kurzy-row{
  display:flex !important;
  align-items:center;
  justify-content:space-between;
  padding:16px 0;
  border-bottom:2px solid var(--bricks-color-eqcrjq);
  gap:16px;
  min-height:0;
  line-height:1.3;
}

.kurzy-row__label{
  font-weight:700;
  font-size:1.1em;
  line-height:1.3;
}

.kurzy-row__value{
  font-weight:700;
  font-size:1.2em;
  flex-shrink:0;
  line-height:1.3;
}

.kurzy-row--total{
  border-top:2px solid var(--bricks-color-eqcrjq);
  border-bottom:none;
  margin-top:24px;
}

.kurzy-row--total .kurzy-row__value{
  font-size:1.5em;
}

/* ===== DROPDOWN TERM SELECTOR ===== */
#course-term-selector.kurzy-term-selector{
  margin:0;
  position:relative;
}

#course-term-selector .kurzy-term-selector__row{
  display:flex !important;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px 0;
  cursor:pointer;
  border-top:2px solid var(--bricks-color-eqcrjq);
  border-bottom:2px solid var(--bricks-color-eqcrjq);
}

#course-term-selector .kurzy-term-selector__label{
  font-weight:700;
  font-size:1.1em;
  flex-shrink:0;
}

#course-term-selector .kurzy-term-selector__dropdown{
  position:relative;
}

#course-term-selector .kurzy-term-selector__toggle{
  display:inline-flex !important;
  align-items:center;
  gap:8px;
  background:none !important;
  border:none !important;
  cursor:pointer;
  font-size:1.05em;
  font-weight:600;
  color:inherit;
  padding:6px 0;
  transition:opacity .15s ease;
}

#course-term-selector .kurzy-term-selector__toggle:hover{
  opacity:.7;
}

#course-term-selector .kurzy-term-selector__toggle.has-value{
  font-style:italic;
  font-weight:700;
}

svg.kurzy-term-selector__arrow{
  display:inline-block;
  vertical-align:middle;
  transition:transform .2s ease;
  flex-shrink:0;
}

#course-term-selector.is-open svg.kurzy-term-selector__arrow{
  transform:rotate(180deg);
}

#course-term-selector .kurzy-term-selector__list{
  position:absolute !important;
  right:0;
  top:100%;
  z-index:9999;
  min-width:380px;
  background:var(--bricks-color-ygrnej) !important;
  border:2px solid var(--bricks-color-eqcrjq) !important;
  box-shadow:var(--kurzy-dropdown-shadow);
  max-height:320px;
  overflow-y:auto;
  padding:0 !important;
  margin:0 !important;
  list-style:none !important;
}

#course-term-selector .kurzy-term-selector__item{
  display:block !important;
  width:100%;
  text-align:left;
  padding:12px 16px !important;
  border:none !important;
  border-bottom:1px solid rgba(0,0,0,.1) !important;
  border-radius:0 !important;
  background:none !important;
  cursor:pointer;
  font-size:1em;
  color:inherit;
  transition:background .1s ease;
  margin:0 !important;
  white-space:nowrap;
  line-height:1.4;
}

#course-term-selector .kurzy-term-selector__item:last-child{
  border-bottom:none !important;
}

#course-term-selector .kurzy-term-selector__item:hover:not(:disabled){
  background:rgba(0,0,0,.05) !important;
}

#course-term-selector .kurzy-term-selector__item.is-selected{
  font-weight:700;
  background:rgba(0,0,0,.05) !important;
}

#course-term-selector .kurzy-term-selector__item.is-soldout,
#course-term-selector .kurzy-term-selector__item.is-past{
  opacity:.45;
  cursor:not-allowed;
}

/* Hide default WC variation price + availability */
.woocommerce-variation-price,
.woocommerce-variation-availability{
  display:none !important;
}

/* Hide old variation summary if still in DOM */
.kurzy-variation-summary{
  display:none !important;
}

/* Kill WC wrappers margins that push our rows down */
.woocommerce-variation.single_variation{
  margin:0 !important;
  padding:0 !important;
}

.single_variation_wrap{
  margin:0 !important;
  padding:0 !important;
}

table.variations{
  margin:0 !important;
  padding:0 !important;
}

.reset_variations{
  display:none !important;
}

.kurzy-row--price{
  margin:0 !important;
  padding:16px 0 !important;
}

/* ===== QTY ROW ===== */
.kurzy-row--qty .kurzy-qty-slot{
  font-size:1em;
  line-height:1.3;
}

.kurzy-row--qty .quantity{
  display:inline-flex !important;
  align-items:center;
  gap:2px;
  height:25px !important;
  min-height:0 !important;
  padding:0 !important;
  margin:0 !important;
  overflow:visible;
}

.kurzy-row--qty .quantity input.qty{
  width:36px !important;
  height:auto !important;
  text-align:center;
  font-weight:700;
  font-size:1.1em;
  line-height:1.3 !important;
  border:none !important;
  background:none !important;
  padding:0 !important;
  margin:0 !important;
  -moz-appearance:textfield;
  appearance:textfield;
  box-shadow:none !important;
  color:var(--bricks-color-eqcrjq);
}

.kurzy-row--qty .quantity input.qty::-webkit-outer-spin-button,
.kurzy-row--qty .quantity input.qty::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}

.kurzy-row--qty .quantity button,
.kurzy-row--qty .quantity .minus,
.kurzy-row--qty .quantity .plus{
  background:none !important;
  border:none !important;
  box-shadow:none !important;
  font-size:1.1em !important;
  font-weight:700 !important;
  color:var(--bricks-color-eqcrjq) !important;
  cursor:pointer;
  padding:0 6px !important;
  line-height:1.3 !important;
  min-width:auto !important;
  height:auto !important;
}

.kurzy-row--qty .quantity button:hover,
.kurzy-row--qty .quantity .minus:hover,
.kurzy-row--qty .quantity .plus:hover{
  opacity:.6;
}

/* ===== CART QTY ===== */
.kurzy-qty-locked{
  display:inline-block;
  text-align:center;
  min-width:48px;
  font-weight:700;
}

.woocommerce-cart-form td.product-quantity{
  text-align:center !important;
}

.woocommerce-cart-form td.product-quantity .quantity{
  justify-content:center !important;
  margin:0 auto !important;
}

.woocommerce-cart-form .product-quantity .kurzy-qty-locked{
  display:block !important;
  text-align:center !important;
  width:100% !important;
  font-size:1.1em;
}

/* Add-to-cart button styling → přesunuto do child theme style.css */

/* Total row + button must stack vertically inside WC add-to-cart wrapper */
.kurzy-row--total{
  width:100%;
}

/* ===== ATTENDEES ===== */
#course-attendees.course-attendees{
  margin:0 !important;
  padding:0 !important;
}

#course-attendees .course-attendee{
  border:none;
  border-radius:0;
  padding:20px 0 18px;
  background:none;
}

#course-attendees .course-attendee + .course-attendee{
  border-top:2px solid var(--bricks-color-eqcrjq);
}

#course-attendees .course-attendee-head{
  display:flex !important;
  align-items:center;
  gap:16px;
  font-weight:700;
  margin-bottom:14px;
  font-size:1.15em;
}

#course-attendees .course-attendee-customer-toggle{
  margin:0;
}

#course-attendees .course-attendee-customer-label{
  display:inline-flex !important;
  align-items:center;
  gap:6px;
  font-size:11px !important;
  font-weight:400 !important;
  text-transform:uppercase;
  letter-spacing:.05em;
  opacity:.4;
  cursor:pointer;
  margin-left:12px;
}

#course-attendees .course-attendee-customer-label input[type="checkbox"]{
  width:13px !important;
  height:13px !important;
  min-width:13px;
  margin:0 !important;
  padding:0 !important;
  appearance:none !important;
  -webkit-appearance:none !important;
  -moz-appearance:none !important;
  border:2px solid var(--bricks-color-eqcrjq) !important;
  border-radius:0 !important;
  background:var(--bricks-color-ygrnej) !important;
  cursor:pointer;
  box-shadow:none !important;
  flex-shrink:0;
}

#course-attendees .course-attendee-customer-label input[type="checkbox"]:checked{
  background:var(--bricks-color-eqcrjq) !important;
  box-shadow:inset 0 0 0 2px var(--bricks-color-ygrnej) !important;
}

#course-attendees .course-attendee-grid{
  display:grid !important;
  grid-template-columns:2fr 1fr 2fr 2fr;
  gap:14px;
  align-items:end;
}

#course-attendees .course-attendee-adult{
  display:contents;
}

#course-attendees .course-attendee label{
  display:block;
  font-size:0.9em;
  color:var(--bricks-color-eqcrjq);
  margin:0;
  padding:0;
}

#course-attendees .course-attendee input[type="text"],
#course-attendees .course-attendee input[type="number"],
#course-attendees .course-attendee input[type="email"],
#course-attendees .course-attendee input[type="tel"]{
  width:100% !important;
  height:var(--kurzy-input-height) !important;
  margin-top:6px !important;
  padding:var(--kurzy-input-padding) !important;
  border-radius:0 !important;
  border:1px solid var(--bricks-color-eqcrjq) !important;
  background:var(--bricks-color-ygrnej) !important;
  font-size:max(16px, 1em); /* min 16px aby iOS Safari pri fokusu nezoomoval pole */
  color:var(--bricks-color-eqcrjq);
  box-shadow:none !important;
  box-sizing:border-box;
}

#course-attendees .course-attendee input:focus{
  outline:2px solid rgba(0,0,0,.7) !important;
  outline-offset:1px;
}

/* attendee spacing handled above */

#course-attendees .course-attendee input:disabled{
  background:var(--kurzy-input-disabled-bg) !important;
  opacity:.6;
}

/* ===== PER-ATTENDEE VOUCHER ===== */
#course-attendees .course-attendee-voucher{
  display:flex !important;
  align-items:center;
  gap:10px;
  margin-top:16px;
  padding-top:0;
  border-top:none;
  flex-wrap:nowrap;
}

#course-attendees .course-attendee-voucher__label{
  font-weight:700;
  font-size:12px !important;
  text-transform:uppercase;
  letter-spacing:.04em;
  white-space:nowrap;
  color:var(--bricks-color-eqcrjq) !important;
  opacity:.6;
  line-height:1;
}

#course-attendees .course-attendee-voucher__arrow{
  font-weight:700;
  font-size:12px !important;
  color:var(--bricks-color-eqcrjq) !important;
  opacity:.5;
  flex-shrink:0;
  line-height:1;
}

#course-attendees .course-attendee-voucher__options{
  display:flex !important;
  align-items:center;
  gap:16px;
  flex-wrap:wrap;
  margin-left:4px;
}

#course-attendees .course-attendee-voucher__opt{
  display:inline-flex !important;
  align-items:center;
  gap:5px;
  cursor:pointer;
  font-size:13px !important;
  color:var(--bricks-color-eqcrjq) !important;
  white-space:nowrap;
  margin:0 !important;
  padding:0 !important;
  line-height:1;
}

#course-attendees .course-attendee-voucher__opt input[type="radio"]{
  appearance:none !important;
  -webkit-appearance:none !important;
  -moz-appearance:none !important;
  width:16px !important;
  height:16px !important;
  min-width:16px;
  border:2px solid var(--bricks-color-eqcrjq) !important;
  border-radius:0 !important;
  background:var(--bricks-color-ygrnej) !important;
  display:inline-block !important;
  position:relative;
  box-shadow:none !important;
  padding:0 !important;
  margin:0 !important;
  cursor:pointer;
  flex-shrink:0;
}

#course-attendees .course-attendee-voucher__opt input[type="radio"]:checked{
  background:var(--bricks-color-eqcrjq) !important;
  box-shadow:inset 0 0 0 2px var(--bricks-color-ygrnej) !important;
}

/* Greeting on the gift voucher: same columns as the attendee grid, the field spans
   Jméno + Věk, the checkbox sits next to it. */
#course-attendees .course-attendee-greeting{
  display:grid !important;
  grid-template-columns:2fr 1fr 2fr 2fr;
  gap:14px;
  align-items:end;
  margin-top:14px;
}

#course-attendees .course-attendee-greeting[hidden]{
  display:none !important;
}

#course-attendees .course-attendee-greeting__field{
  grid-column:1 / span 2;
}

#course-attendees .course-attendee-greeting__self{
  grid-column:3 / span 2;
  display:inline-flex !important;
  align-items:center;
  gap:6px;
  min-height:var(--kurzy-input-height);
  font-size:13px !important;
  cursor:pointer;
}

#course-attendees .course-attendee-greeting__self input[type="checkbox"]{
  appearance:none !important;
  -webkit-appearance:none !important;
  width:16px !important;
  height:16px !important;
  min-width:16px;
  margin:0 !important;
  padding:0 !important;
  border:2px solid var(--bricks-color-eqcrjq) !important;
  border-radius:0 !important;
  background:var(--bricks-color-ygrnej) !important;
  box-shadow:none !important;
  cursor:pointer;
}

#course-attendees .course-attendee-greeting__self input[type="checkbox"]:checked{
  background:var(--bricks-color-eqcrjq) !important;
  box-shadow:inset 0 0 0 2px var(--bricks-color-ygrnej) !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px){
  #course-attendees .course-attendee-grid,
  #course-attendees .course-attendee-greeting{
    grid-template-columns:1fr 1fr;
  }

  #course-attendees .course-attendee-greeting__self{
    grid-column:1 / -1;
    min-height:0;
  }
}

@media (max-width: 520px){
  #course-attendees .course-attendee-grid,
  #course-attendees .course-attendee-greeting{
    grid-template-columns:1fr;
  }

  #course-attendees .course-attendee-greeting__field{
    grid-column:1 / -1;
  }

  #course-attendees .course-attendee-voucher{
    flex-wrap:wrap !important;
  }

  #course-term-selector .kurzy-term-selector__row{
    flex-direction:column;
    align-items:flex-start;
    gap:8px;
  }

  /* The list spans the whole form width and long labels wrap, so it never runs off
     the right edge of the phone (#306). */
  #course-term-selector .kurzy-term-selector__dropdown{
    position:static;
  }

  #course-term-selector .kurzy-term-selector__list{
    right:0;
    left:0;
    min-width:0;
  }

  #course-term-selector .kurzy-term-selector__item{
    white-space:normal;
  }
}

/* Course hero and video section of template 728: viewport height taken at load
   (--fr-vh from frontend.js), so the keyboard does not resize them (#306). */
html #brxe-sbvmri{
  height:calc(var(--fr-vh, 1vh) * 70);
}

html #brxe-gellih{
  height:calc(var(--fr-vh, 1vh) * 85);
}

@media (max-width: 478px){
  html #brxe-sbvmri,
  html #brxe-gellih{
    height:calc(var(--fr-svh, 1svh) * 75);
  }
}

/* ===== CART ATTENDEES DISPLAY ===== */

/* dl.variation uses flexbox — allow wrapping so Účastníci can go full-width */
dl.variation:has(.kurzy-attendees-cart){
  flex-wrap:wrap;
  row-gap:calc(var(--space-1, 8px) / 2);
}

dl.variation dt.variation-astnci,
dl.variation dd.variation-astnci{
  flex:0 0 100%;
  width:100%;
}

dl.variation dd.variation-astnci{
  margin-left:0;
  padding:0;
}

/* Same in the cart and the checkout summary: name in Body under "Účastníci:", contact
   and voucher in Small, indented under the name after its number. */
.kurzy-attendees-cart .kurzy-attendee-block{
  margin-bottom:var(--space-1, 8px);
}

.kurzy-attendees-cart .kurzy-attendee-block:last-child{
  margin-bottom:0;
}

.kurzy-attendees-cart .kurzy-attendee-name{
  font-size:1.8rem;
  font-weight:400;
  line-height:1.55;
}

.kurzy-attendees-cart .kurzy-attendee-contact,
.kurzy-attendees-cart .kurzy-attendee-voucher-info{
  margin-top:calc(var(--space-1, 8px) / 2);
  padding-left:1.8rem;
  font-size:max(12px, 1.3rem);
  line-height:1.55;
}

/* E-mail and phone on one line when they fit, otherwise the phone goes on its own line.
   The e-mail breaks after the @ (<wbr>), inside only when one part alone is wider than
   the column. */
.kurzy-attendees-cart .kurzy-attendee-contact{
  display:flex;
  flex-wrap:wrap;
  column-gap:var(--space-1, 8px);
  color:var(--bricks-color-eqcrjq);
}

.kurzy-attendees-cart .kurzy-attendee-email{
  min-width:0;
  overflow-wrap:break-word;
}

.kurzy-attendees-cart .kurzy-attendee-phone{
  white-space:nowrap;
}

.kurzy-attendees-cart .kurzy-attendee-voucher-info{
  opacity:.7;
  font-style:italic;
  overflow-wrap:anywhere;
}

/* ===== CART & CHECKOUT TOTALS — fee rows ===== */

/* Subtotal + fees = one tight group */
.cart_totals .shop_table tr.cart-subtotal>th,
.cart_totals .shop_table tr.cart-subtotal>td,
.woocommerce-checkout-review-order-table tr.cart-subtotal>th,
.woocommerce-checkout-review-order-table tr.cart-subtotal>td{
  border-bottom:none !important;
  padding-bottom:4px !important;
}

/* Cart only: Bricks forces flex on subtotal/total — match on fee rows */
.cart_totals .shop_table tr.fee{
  display:flex !important;
  justify-content:space-between !important;
}

.cart_totals .shop_table tr.fee>th,
.cart_totals .shop_table tr.fee>td,
.woocommerce-checkout-review-order-table tr.fee>th,
.woocommerce-checkout-review-order-table tr.fee>td{
  font-weight:400 !important;
  padding-top:4px !important;
  padding-bottom:4px !important;
  border-bottom:none !important;
}

.cart_totals .shop_table tr.fee>th,
.woocommerce-checkout-review-order-table tr.fee>th{
  font-size:.92em !important;
}

/* Gap before total, in the cart only below other visible rows (the subtotal is hidden there) */
.cart_totals .shop_table tr:not(.cart-subtotal) ~ tr.order-total>th,
.cart_totals .shop_table tr:not(.cart-subtotal) ~ tr.order-total>td,
.woocommerce-checkout-review-order-table tr.order-total>th,
.woocommerce-checkout-review-order-table tr.order-total>td{
  padding-top:20px !important;
}

/* ===== CART + CHECKOUT (Blocks) ===== */
.wc-block-cart .wc-block-components-product-details__value,
.wc-block-checkout .wc-block-components-product-details__value{
  white-space:pre-line;
  line-height:1.4;
  font-size:1em;
}

.wc-block-cart .wc-block-components-product-details__name,
.wc-block-checkout .wc-block-components-product-details__name{
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:0.8em;
}

.wc-block-cart .wc-block-components-product-details,
.wc-block-cart .wc-block-components-product-details > *{
  display:block;
}

.wc-block-cart .wc-block-components-product-details__name{
  display:block;
  margin-top:10px;
}

.wc-block-cart .wc-block-components-product-details__value{
  display:block;
  margin-top:4px;
  margin-left:0;
  word-break:break-word;
  padding-bottom:2px;
  opacity:0.85;
}

.wc-block-cart .wc-block-components-product-details{
  margin-top:8px;
}

/* ===== MINI CART ===== */
.woocommerce-mini-cart .kurzy-attendees--minicart{
  margin-top:8px;
}

.woocommerce-mini-cart .kurzy-attendees-list{
  list-style:none;
  padding:0;
  margin:0;
}

.woocommerce-mini-cart .kurzy-attendee-item{
  padding:8px 0;
}

.woocommerce-mini-cart .kurzy-attendee-item + .kurzy-attendee-item{
  border-top:1px dashed rgba(255,255,255,.18);
}

.woocommerce-mini-cart .kurzy-attendee-title{
  font-weight:600;
  line-height:1.2;
}

.woocommerce-mini-cart .kurzy-attendee-contact{
  margin-top:4px;
  font-size:0.82em;
  opacity:0.75;
  line-height:1.2;
}

.woocommerce-mini-cart .kurzy-attendee-voucher{
  margin-top:4px;
  font-size:0.82em;
  opacity:0.75;
  line-height:1.2;
  font-style:italic;
}

/* ===== CENA TAB (course detail) ===== */
/* A camp length with no price (no upcoming term of that length) leaves out its row when the
   list has a price in another row. A course without any price keeps both rows. */
#brxe-nspfhk.brxe-list:has(li > .content > .meta:not(:empty)) li:has(> .content > .meta:empty){
  display:none !important;
}

/* ===== TERMINY TAB (course detail) ===== */
.kurzy-terminy{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

.kurzy-terminy__item{
  display:inline-block;
  padding:8px 14px;
  border-radius:2px;
  background:var(--bricks-color-eqcrjq);
  color:var(--bricks-color-ygrnej);
  font-size:1.6rem;
  font-weight:600;
  line-height:1.3;
}

.kurzy-terminy__item.is-soldout{
  background:var(--kurzy-soldout-bg);
}

.kurzy-terminy__empty{
  margin:0;
  font-size:1.6rem;
}

/* ===== TERM LIST (course tiles on the Termíny pages) ===== */
.kurzy-terminy-seznam{
  display:flex;
  flex-direction:column;
  gap:var(--space-1);
  margin:0;
  padding:0;
  list-style:none;
}

.kurzy-terminy-seznam__item{
  display:flex;
  gap:var(--space-1);
  margin:0;
}

.kurzy-terminy-seznam__item::before{
  content:"•";
  flex:0 0 auto;
}

.kurzy-terminy-seznam__item.is-soldout{
  opacity:.5;
}

.kurzy-terminy-seznam__empty{
  margin:0;
}

/* ===== FAQ TAB (course detail) ===== */
.kurzy-faq__item + .kurzy-faq__item{
  margin-top:2.4rem;
}

.kurzy-faq__item > :last-child{
  margin-bottom:0;
}

/* Error of a refused add to cart, moved above the course form (Assets\Module). */
.kurzy-oznameni{
  margin:0 0 var(--space-2, 24px);
  scroll-margin-top:160px;
}

.kurzy-oznameni .woocommerce-error{
  margin:0;
  padding:var(--space-1, 12px) var(--space-2, 24px);
  background:var(--bricks-color-jxhqau, #f8f7fa);
  color:#c0392b;
  list-style:none;
}

.kurzy-oznameni .woocommerce-error:focus{
  outline:none;
}
