/* ============================================================
   YouGo Cars Transfer — frontend.css  v1.2
   ============================================================ */

/* ── Wrapper ── */
.ygc-wrap {
    max-width: 740px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    color: #1a1a1a;
}

/* ── Section card ── */
.ygc-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 22px 24px;
    margin-bottom: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.ygc-section__title {
    font-size: 14px;
    font-weight: 700;
    color: #1a3a5c;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #edf2f7;
}

/* ── Direction cards ─────────────────────────────────────────
   Two clickable cards with SVG icons that visually show the
   direction of the transfer.
   ──────────────────────────────────────────────────────────── */
.ygc-direction {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 0;
}

.ygc-direction__card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 14px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: border-color .18s, background .18s, box-shadow .18s;
    user-select: none;
}

/* Hide the native radio button visually — it stays accessible */
.ygc-direction__card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ygc-direction__card.is-active,
.ygc-direction__card:has(input:checked) {
    border-color: #1a3a5c;
    background: #edf4fc;
    box-shadow: 0 0 0 3px rgba(26,58,92,.08);
}

/* Icon row: emoji (WordPress converts these to colourful .svg images automatically) */
.ygc-direction__icon {
    font-size: 28px;
    line-height: 1;
    /* emoji images rendered by WP are inline, this keeps them aligned */
    display: flex;
    align-items: center;
    gap: 4px;
}
.ygc-direction__icon img.emoji {
    width: 28px !important;
    height: 28px !important;
    vertical-align: middle;
}

.ygc-direction__label {
    font-size: 16px;
    font-weight: 600;
    color: #1a3a5c;
    line-height: 1.4;
}

/* ── Grid layout ── */
.ygc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-bottom: 22px;
}
.ygc-row:last-child { margin-bottom: 0; }
.ygc-col { display: flex; flex-direction: column; }

.ygc-col label {
    font-weight: 600;
    color: #1d2327;
    letter-spacing: .4px;
    margin-bottom: 5px;
}
.ygc-col label span { color: #e74c3c; font-weight: 700; }
.ygc-wrap .ygc-col label span[aria-hidden] { color: #e74c3c !important; font-weight: 700; }


/* ── Inputs ── */
.ygc-input {
    width: 100%;
    padding: 9px 12px;
    font-size: 15px;
    font-family: inherit;
    color: #1a1a1a;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 7px;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
}
/* Neutralise browser autofill yellow/blue tint */
.ygc-input:-webkit-autofill,
.ygc-input:-webkit-autofill:hover,
.ygc-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 100px #fff inset !important;
    -webkit-text-fill-color: #1a1a1a !important;
    caret-color: #1a1a1a;
}
/* Override theme rules that target filled inputs */
.ygc-wrap input.ygc-input,
.ygc-wrap input.ygc-input:not(:placeholder-shown) {
    background: #fff !important;
}
.ygc-input:focus {
    outline: none;
    border-color: #1a3a5c;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,58,92,.07);
}
textarea.ygc-input { resize: vertical; min-height: 78px; }

/* ── Additional extras ─────────────────────────────────────── */
.ygc-extras { display: flex; flex-direction: column; gap: 10px; }

.ygc-extra {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: background .15s;
}
.ygc-extra:has(.js-extra-check:checked),
.ygc-extra:has(.js-extra-qty[value]:not([value="0"])) { background: #edf4fc; border-color: #93c5fd; }

.ygc-extra__info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ygc-extra__label { font-weight: 600; font-size: 14px; color: #1a1a1a; }
.ygc-extra__desc  { font-size: 12px; color: #64748b; }
.ygc-extra__price { font-size: 13px; color: #2c5282; font-weight: 600; margin-top: 2px; }
.ygc-extra__price span { font-weight: 400; color: #64748b; }

/* Toggle switch (for max_qty = 1) */
.ygc-toggle { display: flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.ygc-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.ygc-toggle__track {
    width: 44px; height: 24px;
    background: #d1d5db; border-radius: 12px;
    position: relative; transition: background .2s;
}
.ygc-toggle__thumb {
    position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px;
    background: #fff; border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: left .2s;
}
.ygc-toggle input:checked ~ .ygc-toggle__track { background: #1a3a5c; }
.ygc-toggle input:checked ~ .ygc-toggle__track .ygc-toggle__thumb { left: 23px; }

/* Counter (for max_qty > 1) */
.ygc-counter {
    display: flex !important; align-items: center !important;
    border: 1.5px solid #d1d5db !important; border-radius: 7px !important;
    overflow: hidden !important; flex-shrink: 0 !important;
    width: auto !important; height: auto !important;
}
.ygc-counter__btn {
    width: 34px !important; height: 34px !important;
    min-width: 0 !important; min-height: 0 !important;
    padding: 0 !important; margin: 0 !important;
    background: #f3f4f6 !important; border: none !important;
    border-radius: 0 !important; box-shadow: none !important;
    cursor: pointer !important; font-size: 18px !important;
    line-height: 1 !important; color: #374151 !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    transition: background .15s !important;
}
.ygc-counter__btn:hover:not([disabled]) { background: #e5e7eb !important; }
.ygc-counter__btn[disabled] { opacity: .3 !important; cursor: default !important; pointer-events: none !important; }
.ygc-counter__btn:after { display: none !important; }
.ygc-counter__btn:before { display: none !important; }
.ygc-counter__val {
    width: 36px !important; height: 34px !important;
    border: none !important; border-left: 1.5px solid #d1d5db !important;
    border-right: 1.5px solid #d1d5db !important;
    text-align: center !important; font-size: 14px !important; font-weight: 600 !important;
    color: #1d2327 !important; background: #fff !important;
    padding: 0 !important; -moz-appearance: textfield !important;
}
.ygc-counter__val::-webkit-inner-spin-button,
.ygc-counter__val::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ── Price summary box ── */
.ygc-price-box {
    margin-bottom: 18px;
    background: linear-gradient(135deg, #1a3a5c 0%, #2d6a9f 100%);
    border-radius: 10px;
    padding: 16px 20px;
    color: #fff;
}
.ygc-price-box__row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 14px; padding: 3px 0;
}
.ygc-price-box__row strong { font-size: 16px; }
.ygc-price-box__total {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid rgba(255,255,255,.25);
    margin-top: 8px; padding-top: 8px; font-size: 15px;
}
.ygc-price-box__total strong { font-size: 26px; font-weight: 700; letter-spacing: .5px; }

/* ── Submit ── */
.ygc-submit-row { text-align: center; margin-top: 20px; }
.ygc-transfer-btn {
    display: inline-block; padding: 18px 60px;
    font-size: 18px; font-weight: 700; font-family: inherit;
    color: #fff; background: #1a3a5c; border: none;
    border-radius: 30px; cursor: pointer;
    transition: background .15s, transform .1s;
    letter-spacing: .8px;
}
.ygc-transfer-btn:hover   { background: #2c5282; }
.ygc-transfer-btn:active  { transform: scale(.98); }
.ygc-transfer-btn:disabled { background: #94a3b8; cursor: default; transform: none; }

/* ── Feedback ── */
.ygc-error {
    background: #fef2f2; border: 1px solid #fca5a5;
    border-radius: 7px; padding: 11px 15px; color: #b91c1c;
    font-size: 14px; margin-bottom: 14px;
}
.ygc-success {
    background: #f0fdf4; border: 1px solid #86efac;
    border-radius: 10px; padding: 36px 24px; text-align: center; color: #15803d;
}
.ygc-success__icon { font-size: 56px; margin-bottom: 8px; }
.ygc-success h3 { color: #15803d; font-size: 22px; margin: 0 0 8px; }
.ygc-success__ref { font-size: 20px; font-weight: 700; letter-spacing: 1px; }

/* ── Price table ── */
.ygc-price-table-wrap { overflow-x: auto; }
.ygc-price-table {
    width: 100%; border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    white-space: nowrap;
}
.ygc-price-table th { background: #1a3a5c; color: #fff; padding: 11px 14px; text-align: left; }
.ygc-price-table .ygc-price-table__subhead th { background: #2c5282; font-size: 11px; text-align: center; text-transform: uppercase; letter-spacing: .5px; padding: 6px 14px; }
.ygc-price-table td { padding: 10px 14px; border-bottom: 1px solid #e2e8f0; }
.ygc-price-table tr:nth-child(even) td { background: #f8fafc; }
.ygc-price-table tr:hover td { background: #ebf2fb; }
.ygc-price-table__dest  { font-weight: 600; color: #1a3a5c; }
.ygc-price-table__price { text-align: center; }
.ygc-price-table__price--rt { color: #2c5282; }
.ygc-nd { color: #bbb; }

/* ── Responsive ── */
@media (max-width: 420px) {
    .ygc-direction { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .ygc-row { grid-template-columns: 1fr; }
    .ygc-section { padding: 16px; }
    .ygc-direction__card { padding: 14px 10px 10px; }
    .ygc-extra {padding: 0 0 10px 0; background: #ffffff; border-top: none; border-left: none; border-right: none; border-radius: 0;}
    .ygc-extra:last-child {padding: 0 ; border: none;}
}

/* ── Field icons ──────────────────────────────────────────────────────────── */

.ygc-icon {
    width: 16px; height: 16px; fill: #4c8aff;
    flex-shrink: 0; display: block;
}

/* Left side of custom pickers (route / vehicle / time) */
.ygc-display-inner {
    display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden;
}

/* Icon + input wrapper for plain text/number fields */
.ygc-input-icon-wrap {
    position: relative;
}
.ygc-input-icon-wrap > .ygc-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    pointer-events: none; z-index: 1;
}
.ygc-input-icon-wrap > .ygc-input {
    padding-left: 36px;
}

/* Icon inside date wrap (already position:relative) */
.ygc-date-wrap > .ygc-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    pointer-events: none; z-index: 1;
}
.ygc-date-chevron {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    pointer-events: none; z-index: 1;
}

@keyframes ygc-dropdown-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes ygc-dropdown-in-up {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ygc-time-dropdown,
.ygc-vehicle-dropdown,
.ygc-route-dropdown {
    animation: ygc-dropdown-in .15s ease;
}
.ygc-time-picker.drop-up    .ygc-time-dropdown,
.ygc-vehicle-picker.drop-up .ygc-vehicle-dropdown,
.ygc-route-picker.drop-up   .ygc-route-dropdown {
    animation-name: ygc-dropdown-in-up;
}

/* ── Shared custom picker styles (time / route / vehicle) ── */
.ygc-date-wrap { position: relative; }

.ygc-picker {
    position: relative;
}
.ygc-picker__display {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 9px 12px; border: 1px solid #dcdcde;
    border-radius: 6px; box-sizing: border-box;
    background: #fff; cursor: pointer; user-select: none;
    line-height: 1.5;
}
.ygc-picker__display:focus {
    outline: none; border-color: #b8d4f5; box-shadow: 0 0 0 2px rgba(100,181,246,.08);
}
.ygc-picker__display.ygc-field-error {
    border-color: #e53935 !important;
}
.ygc-picker.open .ygc-picker__display {
    border-color: #b8d4f5; border-bottom-left-radius: 0; border-bottom-right-radius: 0;
}
.ygc-picker.drop-up.open .ygc-picker__display {
    border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; border-top-left-radius: 0; border-top-right-radius: 0;
}
.ygc-picker__value { color: #1d2327; }
.ygc-picker__value.placeholder { color: #8c8f94; }
.ygc-chevron { width: 12px; height: 12px; fill: #a9acb0; flex-shrink: 0; transition: transform .15s; display: block; }
.ygc-picker.open .ygc-chevron { transform: rotate(180deg); }
.ygc-picker__dropdown {
    position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border: 1px solid #b8d4f5; border-top: none;
    border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;
    max-height: 330px; overflow-y: auto; z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.ygc-picker.drop-up .ygc-picker__dropdown {
    border-top: 1px solid #b8d4f5; border-bottom: none;
    border-radius: 6px 6px 0 0;
    box-shadow: 0 -4px 12px rgba(0,0,0,.12);
}
.ygc-picker__option {
    padding: 10px 12px; font-size: 15px; cursor: pointer; color: #1d2327;
    border-bottom: 1px solid #f3f4f6;
}
.ygc-picker__option:last-child { border-bottom: none; }
.ygc-picker__option:hover { background: #f3f4f6; }
.ygc-picker__option.is-selected { background: #e9eaec; font-weight: 600; color: #1d2327; }

/* ── Route picker additions (supports groups) ── */
.ygc-route-group-label {
    padding: 6px 12px 4px; font-size: 15px; font-weight: 600; letter-spacing: .06em;
    color: #1d2327; user-select: none;
    border-bottom: 1px solid #f3f4f6;
}
.ygc-route-option { padding-left: 32px; }
.ygc-route-group + .ygc-route-group .ygc-route-group-label { border-top: 1px solid #e5e7ea; }

/* ============================================================
   Flatpickr — date picker overrides — YouGo Cars Transfer
   ============================================================ */

/* Match the plugin's input style — covers both original and altInput */
.ygc-date-wrap .flatpickr-alt-input,
.ygc-date-wrap .flatpickr-input:not([type=hidden]),
.ygc-date-wrap .ygc-date-input {
    cursor: pointer;
    padding-left: 36px !important;
    padding-right: 34px;
    caret-color: transparent;
    user-select: none;
}

/* Hide the original hidden input flatpickr uses internally */
.ygc-date-wrap .flatpickr-input[type=hidden] {
    display: none !important;
}

/* Calendar container */
.flatpickr-calendar {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.10);
    font-family: inherit;
}

/* Month navigation bar */
.flatpickr-months {
    background: #4c8aff;
    border-radius: 10px 10px 0 0;
    height: 42px;
}
.flatpickr-months .flatpickr-month {
    background: transparent;
    color: #fff;
    fill: #fff;
    height: 42px;
}
.flatpickr-current-month {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    height: 42px;
    padding-top: 12px;
}
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    color: #fff;
    font-weight: 600;
}
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: #fff;
    fill: #fff;
    padding: 12px 14px 6px;
    height: 42px;
}
.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    color: #fff;
    fill: #fff;
    background: rgba(255,255,255,.15);
    border-radius: 6px;
}
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    fill: #fff;
}
.flatpickr-current-month .numInputWrapper:hover,
.flatpickr-current-month select.flatpickr-monthDropdown-months:hover {
    background: transparent;
}

/* Weekday header */
.flatpickr-weekdays {
    background: #f9fafb;
}
span.flatpickr-weekday {
    background: #f9fafb;
    color: #6b7280;
    font-weight: 600;
    font-size: 12px;
}

/* Day cells */
.flatpickr-day {
    border-radius: 6px;
    color: #1f2937;
    font-size: 13px;
}
.flatpickr-day:hover,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
    background: #e8f0ff;
    border-color: #e8f0ff;
    color: #4c8aff;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: #4c8aff;
    border-color: #4c8aff;
    color: #fff;
}
.flatpickr-day.today {
    border-color: #4c8aff;
    color: #4c8aff;
}
.flatpickr-day.today:hover {
    background: #4c8aff;
    color: #fff;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: #d1d5db;
}
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #d1d5db;
}

.flatpickr-current-month .numInput.cur-year {
  pointer-events: none;
  border: 0;
  background: transparent;
  -moz-appearance: textfield;
}

.flatpickr-current-month .arrowUp,
.flatpickr-current-month .arrowDown {
  display: none;
}

/* Mobile: prevent calendar from overflowing viewport edges */
@media (max-width: 640px) {
    .flatpickr-calendar {
        max-width: calc(100vw - 16px) !important;
        box-sizing: border-box;
    }
}

/* Section note */
.ygc-section-note {
    font-size: 13px;
    color: #64748b;
    margin: -8px 0 14px;
    font-style: italic;
}

/* Price table direction title */
.ygc-price-table__dir-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a3a5c;
    margin: 20px 0 6px;
    padding-bottom: 6px;
    border-bottom: 2px solid #1a3a5c;
}
