/* ============================================================
   Webstudio Rezervácie – frontend štýly
   Vanilla CSS s CSS premennými, žiadny framework
   ============================================================ */

.wsr-wrapper {
    --wsr-primary: #ed5a3a;
    --wsr-primary-hover: #d94824;
    --wsr-bg: #ffffff;
    --wsr-bar-bg: #ffffff;
    --wsr-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    --wsr-border: #e6e6e6;
    --wsr-text: #1a1a1a;
    --wsr-text-muted: #666;
    --wsr-input-bg: #ffffff;
    --wsr-radius-pill: 999px;
    --wsr-radius: 14px;
    --wsr-radius-sm: 8px;
    --wsr-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    font-family: var(--wsr-font);
    color: var(--wsr-text);
    box-sizing: border-box;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
}

.wsr-wrapper *,
.wsr-wrapper *::before,
.wsr-wrapper *::after {
    box-sizing: border-box;
}

/* ───── Hlavná lišta (pill bar) ───── */
.wsr-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--wsr-bar-bg);
    border-radius: var(--wsr-radius-pill);
    box-shadow: var(--wsr-shadow);
    flex-wrap: wrap;
}

.wsr-field {
    position: relative;
    flex: 1 1 200px;
    min-width: 180px;
    display: flex;
    align-items: center;
    background: var(--wsr-input-bg);
    border: 1px solid var(--wsr-border);
    border-radius: var(--wsr-radius-pill);
    padding: 0 16px;
    height: 56px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wsr-field:focus-within {
    border-color: var(--wsr-primary);
    box-shadow: 0 0 0 3px rgba(237, 90, 58, 0.12);
}

/* Aktívny input - kam sa položí marker pri kliku do mapy */
.wsr-field.is-active-target[data-field="pickup"] {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.wsr-field.is-active-target[data-field="pickup"] .wsr-icon {
    color: #16a34a;
}

.wsr-field.is-active-target[data-field="dropoff"] {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.wsr-field.is-active-target[data-field="dropoff"] .wsr-icon {
    color: #dc2626;
}

.wsr-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wsr-text);
    margin-right: 10px;
    flex-shrink: 0;
}

.wsr-input,
.wsr-input-btn {
    flex: 1;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    font-family: inherit;
    font-size: 15px;
    color: var(--wsr-text);
    width: 100%;
    text-align: left;
    cursor: pointer;
    padding: 0 !important;
    min-width: 0;
    margin: 0 !important;
    height: auto;
    line-height: 1.4;
}

.wsr-input:focus,
.wsr-input-btn:focus,
.wsr-input:focus-visible,
.wsr-input-btn:focus-visible {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.wsr-input {
    cursor: text;
}

.wsr-input::placeholder {
    color: var(--wsr-text-muted);
}

.wsr-input-btn {
    color: var(--wsr-text-muted);
}

.wsr-input-btn.has-value {
    color: var(--wsr-text);
}

.wsr-caret {
    color: var(--wsr-text-muted);
    margin-left: 8px;
    font-size: 12px;
    flex-shrink: 0;
}

.wsr-search-btn {
    background: var(--wsr-primary);
    color: white;
    border: none;
    border-radius: var(--wsr-radius-pill);
    height: 56px;
    padding: 0 38px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition: background-color 0.15s;
}

.wsr-search-btn:hover,
.wsr-search-btn:focus-visible {
    background: var(--wsr-primary-hover);
}

/* ───── Popovers (kalendár, čas, suggesty) ───── */
.wsr-popover {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border: 1px solid var(--wsr-border);
    border-radius: var(--wsr-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    min-width: 280px;
    transform-origin: top left;
    /* Default visible state - animácia ho prepíše počas otvorenia */
    opacity: 1;
    transform: none;
}

.wsr-popover.is-open {
    display: block;
    /* Animácia sa spúšťa LEN keď sa pridá .is-open trieda - tým sa zaručene prehrá */
    animation: wsr-popover-in 0.18s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* Pole s otvoreným popoverom musí mať vyšší z-index aby popover nebol prekrytý
   nasledujúcimi poľami (kritické v stacked layout kde sú polia pod sebou). */
.wsr-wrapper .wsr-field:has(.wsr-popover.is-open),
.wsr-wrapper .wsr-field.wsr-field--popover-open {
    z-index: 100;
}

@keyframes wsr-popover-in {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ───── Kalendár ───── */
.wsr-calendar-popover {
    padding: 14px;
    width: 320px;
}

.wsr-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.wsr-cal-nav {
    background: #1a1a1a;
    border: none;
    border-radius: var(--wsr-radius-sm);
    width: 36px !important;
    height: 36px !important;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
    font-family: inherit;
    line-height: 1;
    padding: 0 !important;
    margin: 0;
    transition: background-color 0.15s;
}

.wsr-cal-nav:hover {
    background: #000;
}

.wsr-cal-selectors {
    display: flex;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

.wsr-cal-select {
    border: 1px solid var(--wsr-border);
    border-radius: var(--wsr-radius-sm);
    padding: 0 24px 0 10px !important;
    height: 36px !important;
    line-height: 34px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    background-color: white;
    cursor: pointer;
    color: var(--wsr-text);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23666'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 14px;
    margin: 0;
    vertical-align: middle;
}

.wsr-cal-select:hover {
    border-color: var(--wsr-text-muted);
}

.wsr-cal-select:focus {
    outline: none;
    border-color: var(--wsr-primary);
    box-shadow: 0 0 0 3px rgba(237, 90, 58, 0.12);
}

.wsr-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 38px);
    gap: 2px;
    justify-content: center;
    position: relative;
    min-height: 240px;
}

.wsr-cal-dow {
    font-weight: 700;
    font-size: 12px;
    text-align: center;
    padding: 8px 0;
    width: 38px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wsr-cal-day {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--wsr-radius-sm);
    color: var(--wsr-text);
    padding: 0;
}

.wsr-cal-day:hover:not(:disabled) {
    background: #1a1a1a !important;
    color: white !important;
}

.wsr-cal-day.empty {
    cursor: default;
    visibility: hidden;
}

.wsr-cal-day:disabled,
.wsr-cal-day.blocked,
.wsr-cal-day.unavailable {
    color: #ccc;
    cursor: not-allowed;
}

.wsr-cal-day.unavailable {
    text-decoration: none;
    opacity: 0.4;
}

.wsr-cal-day.selected {
    background: var(--wsr-primary);
    color: white;
}

.wsr-cal-day.today:not(.selected) {
    box-shadow: inset 0 0 0 2px var(--wsr-primary);
}

.wsr-cal-loading {
    position: absolute;
    inset: 30px 0 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    color: var(--wsr-text-muted);
    font-size: 13px;
    z-index: 2;
    border-radius: var(--wsr-radius-sm);
}

.wsr-cal-loading::after {
    content: "...";
    animation: wsr-dots 1.4s infinite;
}

@keyframes wsr-dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}

.wsr-time-empty {
    padding: 16px;
    text-align: center;
    color: var(--wsr-text-muted);
    font-size: 14px;
}

/* ───── Časový picker ───── */
.wsr-time-popover {
    width: 200px;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px 0;
}

.wsr-time-item {
    padding: 12px 18px;
    cursor: pointer;
    font-size: 15px;
    color: var(--wsr-text);
}

.wsr-time-item:hover {
    background: #1a1a1a !important;
    color: white !important;
}

.wsr-time-item.selected {
    background: var(--wsr-primary);
    color: white;
}

/* ───── Suggesty (autocomplete) ───── */
.wsr-suggest-popover {
    width: 100%;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px 0;
}

.wsr-suggest-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    color: var(--wsr-text);
    border-bottom: 1px solid #f3f3f3;
}

.wsr-suggest-item:last-child {
    border-bottom: none;
}

.wsr-suggest-item:hover {
    background: #f7f7f7;
}

.wsr-suggest-empty {
    padding: 14px 16px;
    color: var(--wsr-text-muted);
    font-size: 14px;
    text-align: center;
}

/* ───── Destinations dropdown (preset ciele) ───── */
.wsr-destinations-popover {
    width: 360px;
    max-width: calc(100vw - 32px);
    max-height: 320px;
    overflow-y: auto;
    padding: 6px 0;
}

.wsr-destination-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f3f3;
    transition: background-color 0.15s;
}

.wsr-destination-item:last-child {
    border-bottom: none;
}

.wsr-destination-item:hover {
    background: #1a1a1a !important;
    color: white !important;
}

.wsr-destination-item:hover .wsr-destination-name,
.wsr-destination-item:hover .wsr-destination-address {
    color: white !important;
}

.wsr-destination-item.selected {
    background: var(--wsr-primary);
    color: white;
}

.wsr-destination-item.selected .wsr-destination-name,
.wsr-destination-item.selected .wsr-destination-address {
    color: white;
}

.wsr-destination-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--wsr-text);
}

.wsr-destination-address {
    font-size: 12px;
    color: var(--wsr-text-muted);
    line-height: 1.3;
}

/* Preset destination markery na mape - menšie outline pin s labelom */
.wsr-marker-destination {
    pointer-events: auto;
}

.wsr-marker-destination .wsr-marker-pin {
    width: 28px;
    height: 36px;
    cursor: pointer;
    transition: transform 0.15s;
}

.wsr-marker-destination .wsr-marker-pin:hover {
    transform: scale(1.15);
}

.wsr-marker-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: -2px;
    background: rgba(26, 26, 26, 0.92);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ───── Mapa a sumár ───── */
.wsr-map-container {
    margin-top: 24px;
    background: white;
    border-radius: var(--wsr-radius);
    box-shadow: var(--wsr-shadow);
    overflow: hidden;
    position: relative;
    display: none;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.wsr-map-container.is-visible {
    display: block;
}

.wsr-map-container.is-animated-in {
    opacity: 1;
    transform: translateY(0);
}

.wsr-map-hint {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 26, 26, 0.85);
    color: white;
    padding: 8px 16px;
    border-radius: var(--wsr-radius-pill);
    font-size: 13px;
    font-weight: 500;
    z-index: 500;
    pointer-events: none;
    transition: opacity 0.2s;
    max-width: calc(100% - 80px);
    text-align: center;
    backdrop-filter: blur(4px);
    /* Nezalamovať text na 2 riadky - radšej skratka cez ellipsis */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Close button - okrúhle X v pravom hornom rohu mapy.
   Klient ho použije ak chce mapu zatvoriť bez ohľadu na stav polí.
   z-index nad mapou ale pod hintom (ktorý je v strede). */
.wsr-map-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(26, 26, 26, 0.85);
    color: white;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 501;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 0.15s;
    backdrop-filter: blur(4px);
    font-family: inherit;
}

.wsr-map-close:hover {
    background: rgba(0, 0, 0, 0.95);
}

.wsr-map-hint.is-pickup {
    background: rgba(22, 163, 74, 0.95);
}

.wsr-map-hint.is-dropoff {
    background: rgba(220, 38, 38, 0.95);
}

.wsr-map-hint.is-hidden {
    opacity: 0;
}

.wsr-map {
    width: 100%;
    height: 420px;
    background: #f3f3f3;
    cursor: crosshair;
}

/* Cursor crosshair len keď je vybraný target */
.wsr-map-container:not(.has-active-target) .wsr-map {
    cursor: grab;
}

/* Vlastné markre: pickup zelený, dropoff červený */
.wsr-marker {
    background: transparent;
    border: none;
}

.wsr-marker-pin {
    width: 28px;
    height: 36px;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.wsr-marker-pin svg {
    display: block;
    width: 100%;
    height: 100%;
}

.wsr-summary {
    display: flex;
    align-items: center;
    padding: 22px 28px;
    gap: 24px;
}

.wsr-summary-item {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

.wsr-summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--wsr-text);
    flex-shrink: 0;
}

.wsr-summary-label {
    font-size: 13px;
    color: var(--wsr-text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.wsr-summary-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--wsr-text);
}

.wsr-summary-divider {
    width: 1px;
    height: 44px;
    background: var(--wsr-border);
}

/* ───── Modal ───── */
.wsr-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.wsr-modal-backdrop.is-open {
    display: flex;
}

.wsr-modal-backdrop.is-animated-in {
    opacity: 1;
}

.wsr-modal {
    background: white;
    border-radius: var(--wsr-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 920px;
    padding: 28px;
    position: relative;
    margin: auto;
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    transition: opacity 0.28s ease 0.05s, transform 0.32s cubic-bezier(0.34, 1.2, 0.64, 1) 0.05s;
}

.wsr-modal-backdrop.is-animated-in .wsr-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

#wsr-form > h3 {
    margin: 0 0 18px;
    font-size: 20px;
    color: var(--wsr-text);
}

/* 2-stĺpcový layout na desktope: summary vľavo, formulár vpravo */
.wsr-modal-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 760px) {
    .wsr-modal-body {
        grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.1fr);
        gap: 28px;
    }
}

.wsr-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: var(--wsr-text-muted);
    padding: 4px 10px;
    border-radius: var(--wsr-radius-sm);
}

.wsr-modal-close:hover {
    background: #f3f3f3;
    color: var(--wsr-text);
}

.wsr-modal-summary {
    background: #f7f8fa;
    border: none;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-self: stretch;
}

.wsr-modal-summary .wsr-route-card {
    flex: 1;
}

/* ─── Stat chips (dátum, čas, km, min) ─── */
.wsr-stat-chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 0;
}

/* Dátum a Čas v prvom rade (1. a 2. chip), zvyšné chips na celú šírku */
.wsr-chip:nth-child(n+3) {
    grid-column: 1 / -1;
}

.wsr-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1px solid #ececef;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    min-width: 0;
}

.wsr-chip-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fff1ed;
    color: var(--wsr-primary);
}

.wsr-chip-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    line-height: 1.2;
    flex: 1;
}

.wsr-chip-label {
    font-size: 10px;
    color: var(--wsr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wsr-chip-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--wsr-text);
    white-space: normal;
    overflow: visible;
    line-height: 1.3;
}

/* ─── Route card (pickup → dropoff) ─── */
.wsr-route-card {
    background: white;
    border: 1px solid #ececef;
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
}

.wsr-route-stops {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 140px;
}

.wsr-route-stop {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    position: relative;
    z-index: 2;
}

.wsr-route-stop.start {
    flex: 0 0 auto;
}

.wsr-route-stop.end {
    flex: 0 0 auto;
}

/* Pickup marker má pod sebou predĺženú spojnicu ktorá ide cez celú výšku pickup info bloku */
.wsr-route-stop.start .wsr-route-marker {
    position: relative;
    align-self: stretch;
}

.wsr-route-stop.start .wsr-route-marker::after {
    content: "";
    position: absolute;
    top: 22px; /* pod pickup dotom */
    bottom: 0; /* po spodok pickup info bloku */
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background-image: linear-gradient(
        to bottom,
        #d4d4d8 50%,
        transparent 50%
    );
    background-size: 2px 8px;
    background-repeat: repeat-y;
}

/* Spacer medzi pickup a dropoff stop - obsahuje pokračujúcu vertikálnu čiaru */
.wsr-route-spacer {
    flex: 1 1 auto;
    min-height: 20px;
    width: 22px;
    position: relative;
}

.wsr-route-spacer::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background-image: linear-gradient(
        to bottom,
        #d4d4d8 50%,
        transparent 50%
    );
    background-size: 2px 8px;
    background-repeat: repeat-y;
}

.wsr-route-marker {
    flex-shrink: 0;
    width: 22px;
    display: flex;
    justify-content: center;
    padding-top: 4px;
}

.wsr-route-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15), 0 0 0 1px white;
}

.wsr-route-stop.end .wsr-route-dot {
    background: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15), 0 0 0 1px white;
}

.wsr-route-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding-top: 1px;
}

.wsr-route-label {
    font-size: 11px;
    color: var(--wsr-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.wsr-route-address-main {
    font-size: 15px;
    font-weight: 600;
    color: var(--wsr-text);
    line-height: 1.35;
    word-break: break-word;
}

.wsr-route-address-sub {
    font-size: 12px;
    color: var(--wsr-text-muted);
    line-height: 1.4;
    word-break: break-word;
}

/* ───── Form polia v modale ───── */
.wsr-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.wsr-form-field {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wsr-form-field.wsr-full {
    flex: 1 1 100%;
}

.wsr-form-field label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--wsr-text);
}

.wsr-form-field input,
.wsr-form-field textarea {
    border: 1px solid var(--wsr-border);
    border-radius: var(--wsr-radius-sm);
    padding: 10px 14px;
    font-family: inherit;
    font-size: 14px;
    color: var(--wsr-text);
    background: white;
    width: 100%;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wsr-form-field input:focus,
.wsr-form-field textarea:focus {
    border-color: var(--wsr-primary);
    box-shadow: 0 0 0 3px rgba(237, 90, 58, 0.12);
}

.wsr-form-field textarea {
    resize: vertical;
    min-height: 80px;
}

.wsr-form-feedback {
    margin: 12px 0;
    padding: 10px 14px;
    border-radius: var(--wsr-radius-sm);
    font-size: 13px;
    display: none;
}

.wsr-form-feedback.is-error {
    display: block;
    background: #fdecea;
    color: #b3261e;
    border: 1px solid #f6c5c0;
}

.wsr-form-feedback.is-success {
    display: block;
    background: #e7f5ee;
    color: #1d7a43;
    border: 1px solid #b9dfca;
}

.wsr-submit-btn {
    width: 100%;
    background: var(--wsr-primary);
    color: white;
    border: none;
    border-radius: var(--wsr-radius-pill);
    padding: 14px 20px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s;
    margin-top: 6px;
}

.wsr-submit-btn:hover:not(:disabled) {
    background: var(--wsr-primary-hover);
}

.wsr-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ───── Success state v modale ───── */
.wsr-modal-success {
    display: none;
    text-align: center;
    padding: 40px 20px 20px;
}

.wsr-modal-success.is-visible {
    display: block;
    animation: wsr-fade-in-up 0.4s ease both;
}

.wsr-modal-success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #16a34a;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: wsr-success-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    box-shadow: 0 8px 28px rgba(22, 163, 74, 0.32);
}

.wsr-modal-success-icon svg {
    width: 38px;
    height: 38px;
    color: white;
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: wsr-success-check 0.4s ease 0.25s both;
}

.wsr-modal-success-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--wsr-text);
    margin: 0 0 8px;
    letter-spacing: -0.2px;
}

.wsr-modal-success-text {
    font-size: 15px;
    color: var(--wsr-text-muted);
    margin: 0 auto 24px;
    max-width: 420px;
    line-height: 1.5;
}

@keyframes wsr-success-pop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes wsr-success-check {
    to { stroke-dashoffset: 0; }
}

@keyframes wsr-fade-in-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form sa schová pri success */
.wsr-modal-body.is-hidden {
    display: none;
}

/* Form feedback - jemnejšia animácia keď sa objaví */
.wsr-form-feedback.is-error,
.wsr-form-feedback.is-success {
    animation: wsr-fade-in-up 0.25s ease both;
}

/* ───── Toast ───── */
.wsr-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a1a1a;
    color: white;
    padding: 14px 22px;
    border-radius: var(--wsr-radius-pill);
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 100000;
}

.wsr-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.wsr-toast.is-success {
    background: #1d7a43;
}

.wsr-toast.is-error {
    background: #b3261e;
}

/* ───── Mobile ───── */
/* Mobile / tablet - inline horizontálny formulár sa zmení na stacked-style kartičku.
   Polia idú pod sebou (rovnako ako stacked variant), wrapper má väčší padding a tieň. */
@media (max-width: 900px) {
    /* Close button na mape väčší pre prsty (touch target min 44x44px podľa WCAG) */
    .wsr-map-close {
        width: 44px;
        height: 44px;
        font-size: 24px;
        top: 12px;
        right: 12px;
    }

    .wsr-bar {
        border-radius: var(--wsr-radius);
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        gap: 10px;
    }

    .wsr-field {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        height: 56px;
    }

    /* Texty v poli majú dostatočnú veľkosť na mobile pre čitateľnosť a klikateľnosť */
    .wsr-input-btn,
    .wsr-input {
        font-size: 15px;
    }

    .wsr-search-btn {
        width: 100%;
        min-height: 56px;
        margin-top: 4px;
    }

    .wsr-popover {
        left: 0;
        right: 0;
        width: 100%;
        min-width: 0;
        /* Pop-out ide pod políčkom (klasický dropdown), nie vedľa */
        top: calc(100% + 8px);
    }

    .wsr-calendar-popover {
        width: 100%;
    }

    .wsr-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .wsr-summary-divider {
        width: 100%;
        height: 1px;
    }

    .wsr-form-row {
        flex-direction: column;
        gap: 0;
    }

    .wsr-form-row .wsr-form-field {
        margin-bottom: 14px;
    }
}

/* ============================================================
   Variant: STACKED layout (políčka pod sebou na desktope aj mobile)
   Použitie: [rezervacny_formular layout="stacked"]
   Políčka MUSIA mať identickú veľkosť ako default horizontálny variant.
   Mapa sa SKRYJE úplne - stacked je pre kompaktné kontaktné/sidebar miesta.
   ============================================================ */
.wsr-wrapper.wsr-layout-stacked {
    /* Bez max/min width - klient si šírku rieši cez parent kontajner alebo vlastné CSS */
    position: relative; /* aby mapa s position:absolute bola relatívna k wrapperu */
}

.wsr-wrapper.wsr-layout-stacked .wsr-map-container {
    position: absolute;
    top: 0;
    left: calc(100% + 24px);
    width: 720px;
    margin-top: 0;
    z-index: 100;
    /* Mapa je viditeľná až keď ju JS zobrazí cez .is-visible (rovnako ako default) */
}

/* Na mobile (<900px) mapa spadne pod formulár ako klasický overlay - position relative */
@media (max-width: 900px) {
    .wsr-wrapper.wsr-layout-stacked .wsr-map-container {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        margin-top: 12px;
    }
}

.wsr-wrapper.wsr-layout-stacked .wsr-bar {
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--wsr-radius);
    padding: 14px;
    gap: 10px;
    /* Vyhodený shadow - klient si chce v stacked móde shadow prispôsobiť cez vlastné CSS.
       Dark theme stacked override toto neovplyvní (tam sa shadow nepoužíva tak či tak). */
    box-shadow: none;
}

.wsr-wrapper.wsr-layout-stacked .wsr-field {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    /* height: 56px je zdedené, nemeníme */
}

.wsr-wrapper.wsr-layout-stacked .wsr-search-btn {
    width: 100%;
    margin-top: 4px;
    /* Tlačidlo má rovnakú výšku ako políčka */
    min-height: 56px;
}

/* Popovery v stacked variante - vyletia VPRAVO od pola (nie pod ním ako v default).
   Lebo políčka sú pod sebou, takže popover otváraný dolu by zakryl ďalšie polia.
   Vpravo od pola: top:0, left: 100% + 12px gap. */
.wsr-wrapper.wsr-layout-stacked .wsr-popover {
    top: 0;
    left: calc(100% + 12px);
    right: auto;
    /* Šírka necháme prirodzenú podľa typu popoveru (kalendár 320px, time 200px, suggesty plnú) */
    z-index: 9999;
}

/* Suggesty v stacked móde - úzke 320px (default je 100% šírka pola) */
.wsr-wrapper.wsr-layout-stacked .wsr-suggest-popover {
    width: 320px;
}

/* Pickup input v stacked móde má autocomplete suggesty - tie tiež vyletia vpravo */
.wsr-wrapper.wsr-layout-stacked .wsr-field[data-field="pickup"] .wsr-popover {
    top: 0;
    left: calc(100% + 12px);
}

/* AK je MAPA OTVORENÁ (.is-visible), popovery sa otvárajú POD políčkom
   namiesto vpravo - lebo vpravo je teraz mapa a popover by sa nezobrazil/prekrýval. */
.wsr-wrapper.wsr-layout-stacked:has(.wsr-map-container.is-visible) .wsr-popover {
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    width: 100%;
    min-width: 0;
    z-index: 9999;
}

.wsr-wrapper.wsr-layout-stacked:has(.wsr-map-container.is-visible) .wsr-suggest-popover {
    width: 100%;
}

.wsr-wrapper.wsr-layout-stacked:has(.wsr-map-container.is-visible) .wsr-field[data-field="pickup"] .wsr-popover {
    top: calc(100% + 8px);
    left: 0;
}

/* Na úzkych obrazovkách (mobil) kde nie je miesto vpravo - popover vždy pod políčkom */
@media (max-width: 900px) {
    .wsr-wrapper.wsr-layout-stacked .wsr-popover {
        top: calc(100% + 8px);
        left: 0;
        right: auto;
        width: 100%;
        min-width: 0;
    }
    .wsr-wrapper.wsr-layout-stacked .wsr-suggest-popover {
        width: 100%;
    }
    .wsr-wrapper.wsr-layout-stacked .wsr-field[data-field="pickup"] .wsr-popover {
        top: calc(100% + 8px);
        left: 0;
    }
}

/* ============================================================
   Variant: DARK theme (pre tmavé pozadia ako kontaktná sekcia)
   Použitie: [rezervacny_formular theme="dark"]
   Wrapper je PRIEHĽADNÝ, len jednotlivé políčka sú biele.
   Tým sa formulár "rozplynie" do pozadia a vyniknu len biele inputy.

   AGRESÍVNE !important + isolation - aby parent theme webu nemohol blokovať
   klikanie cez vlastné pointer-events:none alebo overlay vrstvy.
   ============================================================ */

/* Wrapper si vytvára vlastný stacking context (isolation:isolate) - izoluje od rodičovských
   overlay layerov ktoré môžu blokovať klikanie (časté pri tmavých "hero" sekciách) */
.wsr-wrapper.wsr-theme-dark {
    pointer-events: auto !important;
    position: relative;
    isolation: isolate;
    z-index: 1;
}

.wsr-wrapper.wsr-theme-dark .wsr-bar {
    background: transparent;
    box-shadow: none;
    padding: 0;
    pointer-events: auto !important;
    position: relative;
}

/* Bez padding-u v stacked + dark - políčka idú priamo bez wrappera okolo */
.wsr-wrapper.wsr-theme-dark.wsr-layout-stacked .wsr-bar {
    padding: 0;
    gap: 12px;
}

/* Polia v dark theme: biele s jemným tieňom pre lepšiu viditeľnosť na čiernom */
.wsr-wrapper.wsr-theme-dark .wsr-field {
    background: white !important;
    border-color: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    pointer-events: auto !important;
    position: relative;
    cursor: pointer;
}

/* Inputy, buttony, ikony a carety vnútri - všetko musí byť explicitne klikateľné */
.wsr-wrapper.wsr-theme-dark .wsr-input,
.wsr-wrapper.wsr-theme-dark .wsr-input-btn,
.wsr-wrapper.wsr-theme-dark .wsr-icon,
.wsr-wrapper.wsr-theme-dark .wsr-caret {
    pointer-events: auto !important;
}

.wsr-wrapper.wsr-theme-dark .wsr-input-btn {
    cursor: pointer;
}

.wsr-wrapper.wsr-theme-dark .wsr-input {
    cursor: text;
}

/* Search button má vlastný shadow */
.wsr-wrapper.wsr-theme-dark .wsr-search-btn {
    box-shadow: 0 4px 16px rgba(237, 90, 58, 0.35);
    pointer-events: auto !important;
    position: relative;
    cursor: pointer;
}

/* Map container v dark theme - ak by sa zobrazila */
.wsr-wrapper.wsr-theme-dark .wsr-map-container {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Neaktívne duplikátne inštancie pluginu (ak je shortcode použitý viackrát na stránke).
   Zostávajú vizuálne ale nereagujú na klik - aktívna je len posledná inštancia. */
.wsr-wrapper--inactive {
    cursor: not-allowed;
}

.wsr-wrapper--inactive .wsr-bar,
.wsr-wrapper--inactive .wsr-field,
.wsr-wrapper--inactive .wsr-search-btn {
    pointer-events: none;
    opacity: 0.6;
}
