/* ── TNS Tour Booking ───────────────────────────────────────────────────── */
:root {
    --tns-orange:      #f4662f;
    --tns-orange-dark: #d95520;
    --tns-grey:        #e0e0e0;
    --tns-text:        #333;
    --tns-radius:      4px;
}

.tns-wrap {
    font-family: Arial, sans-serif;
    color: var(--tns-text);
    font-size: 14px;
    max-width: 100%;
}

/* ── Progress tracker ── */
.tns-progress-tracker { display: table; width: 100%; margin-bottom: 20px; table-layout: fixed; }
.tns-pt-step { display: table-cell; padding-bottom: 6px; font-size: 13px; color: #999; }
.tns-pt-step.tns-pt-active { color: var(--tns-orange); font-weight: 600; }
.tns-pt-bar { height: 4px; background: var(--tns-grey); border-radius: 2px; margin-top: 4px; }
.tns-pt-active .tns-pt-bar { background: var(--tns-orange); }

/* ── Layout helpers ── */
.tns-box    { margin-bottom: 16px; }
.tns-bold   { font-weight: 700; }
.tns-mt     { margin-top: 16px; }
.tns-two-col { display: flex; gap: 24px; flex-wrap: wrap; }
.tns-two-col .tns-form-group { flex: 1; min-width: 160px; }

/* ── Form groups ── */
.tns-form-group { margin-bottom: 14px; }
.tns-form-group label {
    display: block; margin-bottom: 5px;
    font-weight: 600; font-size: 13px; color: var(--tns-text);
}
.tns-req { color: var(--tns-orange); }

/* ── Inputs & selects ── */
.tns-input,
.tns-select {
    width: 100%; padding: 10px 12px;
    border: 1px solid #ccc; border-radius: var(--tns-radius);
    font-size: 14px; color: var(--tns-text);
    box-sizing: border-box; background: #fff;
}
.tns-input:focus, .tns-select:focus {
    outline: none; border-color: var(--tns-orange);
    box-shadow: 0 0 0 2px rgba(244,102,47,.15);
}
.tns-select-sm { width: auto; min-width: 110px; }
.tns-textarea  { resize: vertical; }

/* ── Native date input (visible, styled) ── */
.tns-date-input {
    background: #f9f9f9;
    cursor: pointer;
    /* Ensure the date picker icon is visible */
    -webkit-appearance: textfield;
    appearance: textfield;
}
.tns-date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
    filter: invert(50%);
}
.tns-date-input:hover::-webkit-calendar-picker-indicator {
    opacity: 1;
}

/* ── Day circles ── */
.tns-days-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.tns-day-check { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tns-day-label { font-size: 12px; font-weight: 700; color: var(--tns-text); }
.tns-check-circle {
    width: 32px; height: 32px; border-radius: 50%;
    border: 2px solid var(--tns-grey);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: transparent;
}
.tns-check-circle.tns-checked {
    background: var(--tns-orange); border-color: var(--tns-orange); color: #fff;
}

/* ── Buttons ─────────────────────────────────────────────────────────────
   Use 4 levels of selector nesting to beat Elementor's popup CSS.
   Our stylesheet also loads after elementor-frontend (declared as a
   dependency in wp_enqueue_style), so cascade order wins too.
────────────────────────────────────────────────────────────────────── */
#tns-wrap .tns-btn,
.elementor-popup-modal #tns-wrap .tns-btn,
.dialog-lightbox-message #tns-wrap .tns-btn,
.elementor-location-popup #tns-wrap .tns-btn,
body #tns-wrap .tns-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    background: #f4662f !important;
    background-color: #f4662f !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--tns-radius) !important;
    padding: 12px 28px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: .5px !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    line-height: normal !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    transition: background-color .15s ease !important;
    min-width: unset !important;
    width: auto !important;
    height: auto !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

#tns-wrap .tns-btn:hover,
.elementor-popup-modal #tns-wrap .tns-btn:hover,
.dialog-lightbox-message #tns-wrap .tns-btn:hover,
body #tns-wrap .tns-btn:hover {
    background: #d95520 !important;
    background-color: #d95520 !important;
    color: #fff !important;
    text-decoration: none !important;
}

#tns-wrap .tns-btn:disabled,
#tns-wrap .tns-btn[disabled] {
    opacity: .6 !important;
    cursor: default !important;
}

#tns-wrap .tns-btn-nav {
    padding: 12px 16px !important;
}

/* ── Nav bar ── */
.tns-nav {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid #eee; padding-top: 16px; margin-top: 16px;
}
.tns-right { margin-left: auto; display: flex; gap: 8px; }

/* ── Time slot grid ── */
#tns-slots-grid { display: flex; gap: 8px; margin-bottom: 16px; }

.tns-slot-date {
    background: var(--tns-orange); color: #fff;
    font-weight: 700; padding: 10px; border-radius: var(--tns-radius);
    text-align: center; font-size: 13px;
}
.tns-slot-time {
    border: 1px solid #ddd; border-radius: var(--tns-radius);
    padding: 10px; display: flex; align-items: center; gap: 8px;
    cursor: pointer; font-size: 14px; background: #fff;
    transition: border-color .15s, background .15s;
    user-select: none;
}
.tns-slot-time:hover  { border-color: var(--tns-orange); }
.tns-slot-time.tns-selected {
    border-color: var(--tns-orange);
    background: rgba(244,102,47,.07);
    font-weight: 700;
}
.tns-slot-radio {
    width: 16px; height: 16px;
    border: 2px solid #ccc; border-radius: 50%;
    flex-shrink: 0; box-sizing: border-box;
    transition: border-color .15s, background .15s;
}
.tns-selected .tns-slot-radio {
    border-color: var(--tns-orange);
    background: var(--tns-orange);
    box-shadow: inset 0 0 0 3px #fff;
}

/* ── Phone ── */
.tns-phone-row { display: flex; align-items: stretch; }
.tns-phone-prefix {
    background: #f5f5f5; border: 1px solid #ccc; border-right: none;
    padding: 10px; border-radius: var(--tns-radius) 0 0 var(--tns-radius);
    font-size: 13px; white-space: nowrap; display: flex; align-items: center;
}
.tns-input-phone { border-radius: 0 var(--tns-radius) var(--tns-radius) 0 !important; }

/* ── Errors ── */
.tns-label-error {
    color: #dc3545; font-size: 12px;
    background: #f8d7da; border: 1px solid #f5c6cb;
    padding: 8px 12px; border-radius: var(--tns-radius);
}
.tns-field-error { color: #dc3545; font-size: 12px; margin-top: 4px; }

/* ── Loader ── */
.tns-loader { display: flex; align-items: center; gap: 10px; padding: 20px 0; color: #666; }
.tns-spinner {
    display: inline-block; width: 18px; height: 18px;
    border: 3px solid rgba(244,102,47,.3); border-top-color: var(--tns-orange);
    border-radius: 50%; animation: tns-spin .7s linear infinite; flex-shrink: 0;
}
.tns-spinner-white { border-color: rgba(255,255,255,.4) !important; border-top-color: #fff !important; }
@keyframes tns-spin { to { transform: rotate(360deg); } }

/* ── Success ── */
.tns-success-wrap { text-align: center; padding: 20px 10px; }
.tns-success-icon {
    width: 60px; height: 60px; background: #28a745; color: #fff;
    border-radius: 50%; font-size: 28px; line-height: 60px; margin: 0 auto 16px;
}
.tns-success-title { color: var(--tns-orange); font-size: 22px; margin: 0 0 16px; }
.tns-success-details {
    background: #f9f9f9; border-radius: var(--tns-radius);
    padding: 16px 20px; text-align: left;
    margin: 0 auto 16px; max-width: 340px; line-height: 1.9;
}
.tns-success-details strong { color: var(--tns-orange); }
.tns-success-note { color: #666; font-size: 13px; line-height: 1.7; }
.tns-success-note a { color: var(--tns-orange); }

/* ── Responsive ── */
@media (max-width: 500px) {
    .tns-two-col { flex-direction: column; }
    #tns-slots-grid { flex-wrap: wrap; }
    #tns-slots-grid > div { flex: 1 1 45%; }
}
