/* -----------------------------------
   FORMULÁŘE
----------------------------------- */

#formular, .formular{
  max-width:900px;
  margin:24px 0;
  padding:clamp(20px, 3vw, 34px);

  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  border-radius:22px;
  box-shadow:0 14px 36px rgba(0,0,0,.06);
}

#formular .form-section-title{
  margin:0 0 18px;
  padding:12px 18px;
  border-radius:12px;
  background:var(--color-primary);
  color:#fff;
  font-weight:800;
}

#formular p{
  margin:0 0 22px;
  color:#555;
}

/* DL formuláře */

#formular dl{
  margin:0;
  padding:0;
}

#formular dt,
#formular dd{
  margin:0;
  padding:0;
}

#formular dt{
  margin-bottom:7px;
}

#formular dd{
  margin-bottom:22px;
}

#formular label{
  color:var(--color-dark);
  font-weight:650;
  line-height:1.35;
}

#formular label b{
  font-weight:800;
}

/* Povinné položky */

#formular dt.required label{
  display:inline-flex;
  align-items:center;
  gap:10px;
}

#formular dt.required label::after{
  content:"Povinné";

  display:inline-block;
  padding:4px 10px;

  background:var(--color-primary);
  color:#fff;

  border-radius:999px;

  font-size:.72rem;
  font-weight:800;
  line-height:1;
  text-transform:uppercase;
  letter-spacing:.04em;
}

/* Povinný checkbox / jiný label v DD */

#formular dd.required:has(input[type="checkbox"]) label::after{
  content:"Povinné";

  display:inline-block;
  margin-left:10px;
  padding:4px 10px;

  background:var(--color-primary);
  color:#fff;

  border-radius:999px;

  font-size:.72rem;
  font-weight:800;
  line-height:1;
  text-transform:uppercase;
  letter-spacing:.04em;
}

/* Pole */

#formular input[type="text"],
#formular input[type="email"],
#formular input[type="tel"],
#formular input[type="number"],
#formular input[type="password"],
#formular input[type="date"],
#formular textarea,
#formular select{
  width:100% !important;
  box-sizing:border-box;

  padding:12px 14px;

  border:1px solid rgba(0,0,0,.18);
  border-radius:12px;

  background:#fff;
  color:var(--color-dark);

  font:inherit;
  line-height:1.35;

  transition:border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

#formular textarea{
  min-height:180px;
  resize:vertical;
}

#formular input:focus,
#formular textarea:focus,
#formular select:focus{
  outline:none;
  border-color:var(--color-primary);
  box-shadow:0 0 0 4px rgba(194,1,22,.12);
}

/* Checkbox */

#formular dd:has(input[type="checkbox"]){
  display:flex;
  align-items:flex-start;
  gap:12px;
}

#formular input[type="checkbox"]{
  width:20px !important;
  height:20px;
  margin-top:3px;
  flex-shrink:0;
}

#formular dd:has(input[type="checkbox"]) label{
  display:block;
  margin:0;
  font-weight:400;
  line-height:1.5;
}

#formular .checkbox-group{
  display:block !important;
}

#formular .checkbox-row{
  display:flex;
  align-items:flex-start;
  gap:12px;
  margin-bottom:12px;
}

#formular .checkbox-row input[type="checkbox"]{
  width:20px !important;
  height:20px;
  margin-top:3px;
  flex-shrink:0;
}

#formular .checkbox-row label{
  margin:0;
  font-weight:400;
  line-height:1.5;
}

#formular .checkbox-subgroup{
  margin-top:10px;
  margin-left:32px;
}

/* Radio skupina */

#formular dd:has(input[type="radio"]){
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* Jeden řádek radio + popisek */

#formular .radio-option{
  display:flex;
  align-items:center;
  gap:12px;
}

/* Radio */

#formular input[type="radio"]{
  width:20px !important;
  height:20px;
  margin:0;
  flex-shrink:0;
  cursor:pointer;
}

/* Label */

#formular dd:has(input[type="radio"]) label{
  margin:0;
  font-weight:400;
  cursor:pointer;
}

dd.input-error:has(input[type="radio"]){
  padding:1em;
  border-radius:12px;
  background:#fff7f7;
}

/* -----------------------------------
   FILE INPUT
----------------------------------- */

#formular input[type="file"]{
  width:100%;
  box-sizing:border-box;

  padding:10px;

  border:1px solid rgba(0,0,0,.18);
  border-radius:12px;

  background:#fff;

  font:inherit;

  transition:border-color .15s ease,
             box-shadow .15s ease,
             background-color .15s ease;
}

#formular input[type="file"]:focus{
  outline:none;
  border-color:var(--color-primary);
  box-shadow:0 0 0 4px rgba(194,1,22,.12);
}

/* tlačítko "Vybrat soubor" */

#formular input[type="file"]::file-selector-button{
  margin-right:14px;
  padding:10px 18px;

  border:0;
  border-radius:999px;

  background:var(--color-primary);
  color:#fff;

  font:inherit;
  font-weight:700;

  cursor:pointer;

  transition:transform .15s ease,
             box-shadow .15s ease;
}

#formular input[type="file"]::file-selector-button:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 18px rgba(194,1,22,.22);
}

/* Grid varianta uvnitř formuláře */

#formular .form-grid-rz{
  max-width:none;
  margin-top:0;
}

#formular .form-grid-rz .u-gridtable__row{
  padding:0 0 .8rem;
  margin-bottom:.8rem;
  border-bottom:1px dashed #eee;
}

#formular .form-grid-rz .u-gridtable__cell{
  overflow-wrap:normal !important;
  word-break:normal !important;
}

#formular .form-grid-rz dd{
  margin-bottom:0;
}

/* křížek pro zrušení RZ*/
#formular .blok-rz{
  position:relative;
  padding-right:48px;
}

#formular .rz-remove{
  position:absolute;
  top:8px;
  right:8px;

  width:32px;
  height:32px;

  border:0;
  border-radius:999px;

  background:#c62828;
  color:#fff;

  font-size:22px;
  font-weight:800;
  line-height:1;

  cursor:pointer;

  transition:transform .15s ease, box-shadow .15s ease;
}

#formular .rz-remove:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 18px rgba(198,40,40,.25);
}

/* Chybové stavy */

.input-error input,
.input-error textarea,
.input-error select{
  border-color:#c62828 !important;
  background-color:#fff7f7;
  box-shadow:0 0 0 4px rgba(198,40,40,.10);
}

dt.input-error label{
  color:#c62828;
}

.form-error{
  color:#c62828 !important;
  font-size:.92rem;
  margin-top:7px;
  padding:0;
}

/* Tlačítko */

#formular .submit,
.formular .submit{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  min-height:46px;
  padding:12px 24px;

  border:0;
  border-radius:999px;

  background:var(--color-primary);
  color:#fff;

  font-weight:800;
  cursor:pointer;

  transition:transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

#formular .submit:hover,
.formular .submit:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 22px rgba(194,1,22,.22);
}

/* Alerty */

.chyba,
.zvyrazneni{
  margin:30px 0;
  padding:28px 34px;

  width:100%;
  max-width:900px;
  box-sizing:border-box;

  border-radius:18px;
  text-align:center;
}

.chyba{
  background:rgba(194,1,24,.88);
  color:#fff;
}

.zvyrazneni{
  background:rgba(202,160,1,.22);
  color:#111;
}

@media (max-width:700px){
  #formular .form-grid-rz .u-gridtable__row{
    grid-template-columns:1fr !important;
    gap:16px;
  }
}

@media (max-width:600px){
  #formular{
    padding:20px 16px;
    border-radius:18px;
  }

  #formular dt.required label{
    flex-wrap:wrap;
  }

  #formular dd:has(input[type="checkbox"]){
    gap:10px;
  }
}


/* odhlášení z novinek */
.unsubscribe-buttons {
  margin-top: 20px;
}

.unsubscribe-buttons .btn-red {
  background-color: #c20116;
  color: white;
  border: none;
  padding: 10px 20px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  margin-right: 10px !important;
}

.unsubscribe-buttons .btn-red:hover {
  background-color: #a90012;
  transform: scale(1.05);
}

.unsubscribe-buttons .btn-green {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.unsubscribe-buttons .btn-green:hover {
  background-color: #218838;
  transform: scale(1.05);
}

/* ======================= Základní vzhled SweetAlert2 ==============================*/

.swal2-popup.litomysl-popup {
  font-size: 0.95em;
  background-color: #fdfdfd;
  border: 2px solid #9b1c2e;
  border-radius: 10px;
  width: 24em;
  max-width: 90vw;
  padding: 1em;
  box-shadow: 0 0 20px rgba(0,0,0,.1);
  overflow-x: hidden;
  justify-items: center;
}

/* Nadpis */
.swal2-title.litomysl-title {
  color: #9b1c2e;
  font-weight: bold;
  font-size: 1.4em;
}

/* Zarovnání a mezery u tlačítek */
.swal2-actions {
  gap: .6em;
  flex-wrap: wrap;
}

/* Primární tlačítko (potvrdit) */
.litomysl-button {
  background-color: #9b1c2e;
  color: #FFF;
  font-weight: bold;
  font-size: 0.95em;
  padding: 0.55em 1.8em;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color .2s ease, transform .05s ease, box-shadow .2s ease;
}

.litomysl-button:hover { background-color: #7e1724; }
.litomysl-button:active { transform: translateY(1px); }

/* Focus (přístupnost) */
.litomysl-button:focus,
.litomysl-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(212,175,55,.35);
}

/* Disabled / loading stav */
.swal2-confirm.swal2-loading,
.litomysl-button:disabled {
  opacity: .7;
  cursor: not-allowed;
}

/* Sekundární tlačítko (zrušit) */
.litomysl-button--secondary {
  background-color: #eee;
  color: #333;
  font-weight: 600;
  font-size: 0.95em;
  padding: 0.55em 1.6em;
  border-radius: 6px;
  border: 2px solid #ddd;
  transition: background-color .2s ease, border-color .2s ease;
}
.litomysl-button--secondary:hover { background-color: #e2e2e2; border-color: #d2d2d2; }
.litomysl-button--secondary:focus,
.litomysl-button--secondary:focus-visible { box-shadow: 0 0 0 3px rgba(155,28,46,.25); }

/* Jen uvnitř SweetAlert2 – tvoje existující utility */
.swal2-popup.litomysl-popup .chyba,
.swal2-popup.litomysl-popup .zvyrazneni {
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  padding: 30px 20px;
  overflow-x: hidden;
}


/* Responsivní přizpůsobení pro menší obrazovky */
@media (max-width: 480px) {
  .swal2-popup.litomysl-popup {
    font-size: 0.9em;
    width: 90vw;
    padding: 0.8em;
  }

  .swal2-title.litomysl-title {
    font-size: 1.25em;
    margin: 0 auto 0.5em -0.5em;
  }

  .swal2-confirm.litomysl-button {
    font-size: 0.9em;
    padding: 0.4em 1.5em;
  }
}


/* ========================== Styl jen pro kalendář ================================ */
#rezervacni-kalendar table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
}

#rezervacni-kalendar td {
  width: 14.2%;
  height: 3em;
  border: 1px solid #ccc;
  vertical-align: middle;
  text-align: center;
  padding: 0.5em;
  font-size: 1em;
}

#rezervacni-kalendar td.available a {
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  width: 100%;
  height: 100%;
  line-height: 2.5em;
  color: #9b1c2e;
}
/*
#rezervacni-kalendar td.available a:hover {
  background-color: #f2f2f2;
  border-radius: 5px;
}
*/
#rezervacni-kalendar td.unavailable {
  background-color: #f9f9f9;
  color: #ccc;
}

#rezervacni-kalendar td.today {
  border: 2px solid #d4af37;
}


/* rezervační kalendář tržnice */

.vendor-info   { padding:8px 0 12px; font-size:.9em; line-height:1.35; }
.ban-alert     { margin-top:4px; color:#b74242; font-weight:600; }

.den         { font-weight:600; line-height:1.2; margin-bottom:2px; }
.mesic-mini  { font-size:.65em; line-height:1; color:#666; }

/* stav dne */
td.available   { background:#f2f2f2; }          /* světle šedé pole */
td.today       { background:#ffeec2; }          /* dnešek zůstává zvýrazněný */
td.unavailable { background:#f7f7f7; color:#bbb; }
td.outOfRange  { background:#fafafa; color:#e0e0e0; }



/* =============== 1. KONTEJNER ŘÁDKU STOLŮ ======================== */
.stoly {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 4px;
  width: 100%;
}

@media (max-width: 1400px) {
  .stoly {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 950px) {
  #rezervacni-kalendar .stoly {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}


/* =============== 2. VÝCHOZÍ VZHLED JEDNOHO STOLU ================= */
.stul{
  position:relative;         
  flex:1 1 0;
  aspect-ratio:1/1;
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1rem;
  line-height:1;
  border:1px solid;
  border-radius:4px;
  user-select:none;
}


/* =============== 3. BAREVNÉ STAVY =================================*/

/* volný */
.stul.free{      background:#fff;    border-color:#8bc98f; color:#2a7d34; cursor:pointer; }
.stul.free:hover{background:#2a7d34; border-color:#2a7d34; color:#fff;}

/* moje – bude dále upřesněno (cancellable / locked) */
.stul.mine{ color:#000; }

/* moje (lze zrušit) */
.stul.mine.cancellable{ background:#ffcf5c; border-color:#d49b1b; cursor:pointer; }

/* moje (už nelze zrušit) */
.stul.mine.locked{ background:#ffcf5c; border-color:#d49b1b; border-style:dashed; cursor:not-allowed; }

/* zabrané cizí / limity / ban */
.stul.taken     { background:#f7d7d7; border-color:#e39d9d; color:#000;   cursor:default;      }
.stul.limit,
.stul.weeklimit { background:#e7e7e7; border-color:#d0d0d0; color:#9a9a9a;cursor:not-allowed; }
.stul.banned    { background:#ececec; border-color:#d5d5d5; color:#a0a0a0;cursor:not-allowed; }

/* =============== 4. IKONKY V ROHU (pouze ::before) =============== */
.stul.mine.cancellable::before{
  content:'×';                           /* křížek = lze zrušit */
  position:absolute; top:-2px; right:0px;
  font-weight:700; font-size:.9em; line-height:1;
}
.stul.mine.locked::before{
  content:'\1F512';                      /* 🔒 = zamčeno */
  position:absolute; top:-4px; right:-4px;
  font-size:.85em; line-height:1;
}

/* =============== 5. TOOLTIP (společný) =========================== */
/* — zobrazí se na libovolném stolu, který nese atribut data-tip —  */
.stul[data-tip]:hover::after{
  content:attr(data-tip);
  position:absolute;
  top:-7px;                         /* 10 px nad horní hranou stolu */
  left:50%; transform:translate(-50%, -100%);   /* vycentrovat */
  background:#333; color:#fff;
  font-size:.9em; white-space:nowrap;
  padding:0.5em 0.5em; border-radius:4px;
  z-index:10; pointer-events:none;
}

/* ===== tooltip – šipka =========================================== */
.stul[data-tip]:hover::before{
    content:'';
    position:absolute;
    top:-11px;                          /* doladíš: větší číslo ⇒ šipka výš */
    left:50%; transform:translateX(-50%) rotate(45deg);
    width:8px; height:8px;
    background:#333;
    z-index:10; pointer-events:none;
}

/* =============== 6. HOVER EFEKTY, KTERÉ NEMÁME RÁDI ============== */
.stul.limit:hover,
.stul.weeklimit:hover,
.stul.banned:hover,
.stul.mine.locked:hover{
  /* žádná změna barvy */
  background:inherit; color:inherit;
}


.trznice-legenda{
  margin-top:1.2rem; font-size:.9em;
}
.trznice-legenda ul{
  list-style:none; padding:0; margin:0; display:flex; flex-wrap:wrap; gap:12px;
}
.trznice-legenda li{
  display:flex; align-items:center; gap:6px;
}
.trznice-legenda .stul{
  width:18px; height:18px; border-radius:4px; border:1px solid;           /* tvar */
}
