/* ============================================================
   TXMR – Thuê Xe Máy Rental – Frontend Styles
   ============================================================ */

/* ── NÚT THUÊ XE ──────────────────────────────────────────── */
.txmr-btn-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    padding: 10px 20px;
    background: #e74c3c;
    color: #fff !important;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .15s;
    width: 100%;
    text-decoration: none !important;
    border-radius: 5px !important;
}
.txmr-btn-open:hover {
    color: #fff !important;
    transform: translateY(-2px);
}
.single-product .txmr-btn-open {
    width: auto;
    margin-left: 8px;
    margin-top: 0;
}

/* ── ẨN NÚT THÊM VÀO GIỎ HÀNG ────────────────────────────── */
.txmr-hide-cart .single-product form.cart { display: none !important; }
.txmr-hide-cart .product .add_to_cart_button { display: none !important; }
.txmr-hide-cart .single-product .txmr-btn-open {
    display: inline-flex !important;
    margin-left: 0 !important;
}

/* ── OVERLAY ──────────────────────────────────────────────── */
.txmr-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 999999;
    overflow-y: auto;
    padding: 30px 16px;
    box-sizing: border-box;
}
.txmr-overlay.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* ── MODAL ────────────────────────────────────────────────── */
.txmr-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 700px;
    box-shadow: 0 24px 64px rgba(0,0,0,.28);
    overflow: hidden;
    animation: txmrSlideIn .28s cubic-bezier(.34,1.56,.64,1);
    margin: auto;
}
@keyframes txmrSlideIn {
    from { transform: translateY(-40px) scale(.97); opacity: 0; }
    to   { transform: translateY(0)     scale(1);   opacity: 1; }
}

/* ── HEADER ───────────────────────────────────────────────── */
.txmr-modal-header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #fff;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.txmr-product-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}
.txmr-product-img {
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,.25);
    flex-shrink: 0;
    background: rgba(255,255,255,.1);
}
.txmr-product-meta { min-width: 0; }
.txmr-modal-header h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.txmr-price-label {
    margin: 0;
    font-size: 13px;
    color: rgba(255,255,255,.8);
    line-height: 1.4;
}
form.cart .quantity,form.cart .single_add_to_cart_button{
    display: none;
}
.txmr-price-label strong { color: #f39c12; font-size: 20px; font-weight: 700; }
.txmr-per-day { font-size: 11px; opacity: .7; }

.txmr-close {
     background: rgba(255, 255, 255, .15);
    min-height: unset;
    border: none;
    color: #fff;
    font-size: 22px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
    line-height: 1;
    padding: 0;
    margin-right: 0px !important;
    margin-bottom: 0px;
}
.txmr-close:hover { background: rgba(255,255,255,.3); }

/* ── SỐ LƯỢNG TRONG HEADER ────────────────────────────────── */
.txmr-header-qty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.txmr-header-qty-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: rgba(255,255,255,.7);
    white-space: nowrap;
}
.txmr-modal-header .txmr-qty-wrap {
    border-color: rgba(255,255,255,.35);
}
.txmr-modal-header .txmr-qty-btn {
    background: rgba(255,255,255,.15);
    color: #fff;
    width: 34px;
    height: 34px;
    font-size: 18px;
        margin-bottom: 0px !important;
  
    margin-right: 0px;
}
.txmr-modal-header .txmr-qty-btn:hover {
    background: rgba(255,255,255,.35);
    color: #fff;
}
.txmr-modal-header #txmr-qty {
    background: rgba(255,255,255,.12) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,.25) !important;
    width: 50px !important;
    font-size: 16px;
    height: 45px;
    padding: 0 4px !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
}

/* ── BODY / FORM ──────────────────────────────────────────── */
.txmr-modal-body {
    padding: 16px 22px 12px;
}

.txmr-field { margin-bottom: 12px; min-width: 0; max-width: 100%; }
.txmr-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #666;
    margin-bottom: 5px;
}
.txmr-req { color: #e74c3c; }

/* ── INPUT THỐNG NHẤT: height 45px, nền trắng, không box-shadow ── */
.txmr-field input[type="text"],
.txmr-field input[type="tel"],
.txmr-fp-date,
.txmr-field .flatpickr-input,
.txmr-time-sel {
    height: 45px;
    padding: 0 12px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    box-shadow: none;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color .2s;
    width: 100%;
}

/* Focus: chỉ đổi màu border, không shadow */
.txmr-field input[type="text"]:focus,
.txmr-field input[type="tel"]:focus,
.txmr-fp-date:focus,
.txmr-field .flatpickr-input:focus,
.txmr-time-sel:focus {
    border-color: #e74c3c;
    outline: none;
    box-shadow: none;
    background: #fff;
}

/* Lỗi: chỉ đổi màu border */
.txmr-field input.txmr-error,
.txmr-fp-date.txmr-error,
.txmr-time-sel.txmr-error {
    border-color: #e74c3c !important;
    box-shadow: none !important;
}

/* Textarea: không fixed height, giữ nền trắng, không shadow */
.txmr-field textarea {
    padding: 10px 12px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    box-shadow: none;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color .2s;
    width: 100%;
    resize: vertical;
}
.txmr-field textarea:focus {
    border-color: #e74c3c;
    outline: none;
    box-shadow: none;
}
.txmr-field textarea.txmr-error {
    border-color: #e74c3c !important;
    box-shadow: none !important;
}

/* ── DATE DISPLAY INPUT (Flatpickr) ───────────────────────── */
.txmr-fp-date,
.txmr-field .flatpickr-input {
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") no-repeat right 12px center;
    padding-right: 36px;
    cursor: pointer;
    /* Safari: bỏ native styling, giữ màu nền & opacity đúng */
    -webkit-appearance: none;
    appearance: none;
    opacity: 1;
}

/* Flatpickr native mobile input – ngăn overflow trên iOS */
input.flatpickr-mobile {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* ── TIME SELECT ──────────────────────────────────────────── */
.txmr-time-select-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.txmr-time-sel {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    padding: 0 6px;
}
.txmr-time-colon {
    font-size: 20px;
    font-weight: 800;
    color: #555;
    flex-shrink: 0;
    line-height: 1;
}

/* ── FLATPICKR CALENDAR ───────────────────────────────────── */
.flatpickr-calendar {
    border-radius: 10px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.14) !important;
    font-family: inherit !important;
    z-index: 9999999 !important;
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #e74c3c !important;
    border-color: #e74c3c !important;
}
.flatpickr-day.inRange {
    background: rgba(231,76,60,.1) !important;
    border-color: transparent !important;
    box-shadow: none !important;
}
.flatpickr-day:hover { background: rgba(231,76,60,.08) !important; }

/* ── 2 CỘT ────────────────────────────────────────────────── */
.txmr-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 480px) {
    .txmr-row { grid-template-columns: 1fr; gap: 6px; }
    /* Row ngày+giờ nhận phòng: giữ 2 cột trên mobile */
    .txmr-row-date-time { grid-template-columns: 3fr 2fr !important; gap: 8px !important; }
    /* Ngăn grid cell tràn ra ngoài cột */
    .txmr-row-date-time > .txmr-field { min-width: 0; overflow: hidden; }
    .txmr-row-date-time > .txmr-field input,
    .txmr-row-date-time > .txmr-field select { max-width: 100%; }
}

/* ── SỐ LƯỢNG XE (base) ───────────────────────────────────── */
.txmr-qty-wrap {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}
.txmr-qty-btn {
    background: #f5f5f5;
    border: none;
    width: 38px;
    height: 38px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
    color: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}
.txmr-qty-btn:hover { background: #e74c3c; color: #fff; }
#txmr-qty {
    width: 56px !important;
    text-align: center;
    border: none !important;
    border-left: 1.5px solid #ddd !important;
    border-right: 1.5px solid #ddd !important;
    border-radius: 0 !important;
    background: #fff !important;
    font-weight: 700;
    font-size: 16px;
    color: #333;
    padding: 0 4px !important;   /* giữ padding ngang để browser center dọc được */
    height: 38px;
    box-shadow: none !important;
    /* ẩn spinner mũi tên của input number */
    -moz-appearance: textfield;
}
#txmr-qty::-webkit-outer-spin-button,
#txmr-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ── HÌNH THỨC THANH TOÁN ─────────────────────────────────── */
.txmr-payment-wrap { margin-bottom: 12px; }
.txmr-payment-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}
.txmr-payment-item {
    border-bottom: 1px solid #eee;
}
.txmr-payment-item:last-child { border-bottom: none; }
.txmr-payment-item.is-selected { background: #fdf8f8; }

.txmr-payment-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    cursor: pointer;
    margin: 0;
}
.txmr-payment-radio { flex-shrink: 0; width: 16px; height: 16px; accent-color: #e74c3c; cursor: pointer; }
.txmr-payment-name  { font-size: 14px; font-weight: 600; color: #333; flex: 1; }
.txmr-payment-icon  { display: flex; align-items: center; gap: 4px; }
.txmr-payment-icon img { max-height: 22px; width: auto; vertical-align: middle; }

.txmr-payment-desc {
    padding: 8px 14px 12px 40px;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    background: #fdf8f8;
    border-top: 1px solid #f0e8e8;
}
.txmr-payment-desc p { margin: 0 0 4px; }
.txmr-payment-desc ul { margin: 4px 0 0 16px; padding: 0; }

/* ── STEPPER SỐ NGƯỜI (người lớn / trẻ em) ───────────────── */
.txmr-gst-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    height: 45px;
}
.txmr-gst-btn {
    width: 42px;
    height: 100%;
    background: #f5f5f5;
    border: none;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    color: #555;
    flex-shrink: 0;
    transition: background .15s, color .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0 !important;
    line-height: 1;
    box-shadow: none !important;
}
.txmr-gst-btn:hover:not(:disabled) { background: #e74c3c; color: #fff; }
.txmr-gst-btn:disabled { opacity: .3; cursor: not-allowed; }
.txmr-gst-wrap input[type="number"] {
    flex: 1;
    text-align: center;
    border: none !important;
    border-left: 1.5px solid #ddd !important;
    border-right: 1.5px solid #ddd !important;
    border-radius: 0 !important;
    height: 100%;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    background: #fff !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: 0;
    -moz-appearance: textfield;
    margin-bottom: 0 !important;
}
.txmr-gst-wrap input[type="number"]::-webkit-outer-spin-button,
.txmr-gst-wrap input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ── THÔNG BÁO ────────────────────────────────────────────── */
.txmr-msg {
    padding: 11px 14px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 6px;
    line-height: 1.5;
}
.txmr-msg.txmr-success  { background: #d4edda; color: #155724; border: 1px solid #b8dacc; }
.txmr-msg.txmr-error-msg { background: #fdecea; color: #7f1f1f; border: 1px solid #f5c6cb; }

/* ── FOOTER ───────────────────────────────────────────────── */
.txmr-modal-footer {
    background: #f7f8fa;
    border-top: 1px solid #eee;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.txmr-summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}
.txmr-summary-detail { font-size: 12px; color: #888; width: 100%; }
.txmr-total-label    { font-size: 14px; font-weight: 600; color: #333; white-space: nowrap; }
.txmr-total-price    { font-size: 24px; font-weight: 800; color: #e74c3c; white-space: nowrap; }

.txmr-submit-btn {
    background: #e74c3c !important;
    color: #fff !important;
    border: none !important;
    padding: 0 28px !important;
    height: 45px;
    font-size: 15px !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: background .2s, transform .15s !important;
    white-space: nowrap;
    letter-spacing: .3px;
    box-shadow: none !important;
}
.txmr-submit-btn:hover  { transform: translateY(-1px) !important; }
.txmr-submit-btn:disabled {
    opacity: .65 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* ── BODY LOCK ────────────────────────────────────────────── */
body.txmr-no-scroll { overflow: hidden; }

/* ── MOBILE ───────────────────────────────────────────────── */
@media (max-width: 600px) {
    .txmr-overlay { padding: 10px 8px; }
    .txmr-modal { border-radius: 10px; }
    .txmr-modal-header { padding: 12px; flex-wrap: wrap; gap: 10px; }
    .txmr-product-info { flex: 1 1 100%; }
    .txmr-header-qty   { flex: 1; }
    .txmr-product-img  { width: 56px; height: 56px; }
    .txmr-modal-header h3 { font-size: 14px; }
    .txmr-modal-body { padding: 12px 12px 8px; }
    .txmr-modal-footer { padding: 10px 12px; flex-direction: column; align-items: stretch; }
    .txmr-submit-btn { width: 100%; text-align: center !important; }
    .txmr-total-price { font-size: 20px; }
    .txmr-summary { justify-content: flex-start; }
}

/* ============================================================
   SEARCH BAR – shortcode [txmr_booking_search]
   ============================================================ */
.txmr-search-bar {
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 32px rgba(0,0,0,.13);
    overflow: visible;
    position: relative;
}

.txmr-search-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px 22px;
    flex: 1;
    position: relative;
    min-width: 0;
}
.txmr-search-col + .txmr-search-col {
    border-left: 1px solid #ebebeb;
}

.txmr-search-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #999;
    margin-bottom: 5px;
    white-space: nowrap;
}

/* Date input trong search bar */
.txmr-sb-date {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%23bbb' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") no-repeat right 0 center !important;
    padding: 0 22px 0 0 !important;
    height: auto !important;
    font-size: 15px !important;
    font-weight: 600;
    color: #333 !important;
    cursor: pointer !important;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    opacity: 1;
    border-radius: 0 !important;
}
.txmr-sb-date::placeholder { color: #bbb; font-weight: 400; }

/* Guests trigger button */
.txmr-sb-guests-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 15px;
    font-weight: 600;
    color: #333 !important;
    cursor: pointer;
    width: 100%;
    text-align: left;
    line-height: 1.3;
}
.txmr-sb-chevron { font-size: 11px; color: #bbb; flex-shrink: 0; transition: transform .2s; }
.txmr-sb-guests-trigger.is-open .txmr-sb-chevron { transform: rotate(180deg); }

/* Guests dropdown */
.txmr-sb-guests-drop {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 280px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.16);
    padding: 8px 16px 14px;
    z-index: 999990;
}
.txmr-sb-guests-drop.is-open { display: block; }

.txmr-sb-guest-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f2f2f2;
}
.txmr-sb-guest-row:last-of-type { border-bottom: none; }
.txmr-sb-guest-label { font-size: 14px; font-weight: 600; color: #333; }

/* Stepper +/- */
.txmr-sb-stepper {
    display: flex;
    align-items: center;
    gap: 14px;
}
.txmr-sb-step {
        min-height: unset;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid #ddd !important;
    background: #fff !important;
    font-size: 18px;
    line-height: 1;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s, color .15s;
    padding: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}
.txmr-sb-step:hover:not(:disabled) { border-color: #e74c3c !important; color: #e74c3c; }
.txmr-sb-step:disabled { opacity: .3; cursor: not-allowed; }
.txmr-sb-step-val { font-size: 15px; font-weight: 700; min-width: 20px; text-align: center; color: #333; }

.txmr-sb-done {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}
.txmr-sb-done:hover { background: #c0392b; }

/* Submit column */
.txmr-search-col-submit {
    flex: 0 0 auto;
    padding: 12px 16px;
}
.txmr-sb-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #e74c3c;
    color: #fff !important;
    border: none;
    border-radius: 10px;
    padding: 14px 26px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    height: 100%;
    width: 100%;
    transition: background .2s, transform .15s;
}
.txmr-sb-submit-btn:hover { background: #c0392b; transform: translateY(-1px); }

/* ── HẬU TỐ /đêm ──────────────────────────────────────────── */
.txmr-per-night {
    font-size: 0.78em;
    font-weight: 400;
    color: inherit;
    opacity: 0.75;
    margin-left: 2px;
}

/* Mobile search bar */
@media (max-width: 767px) {
    .txmr-search-bar { flex-direction: column; border-radius: 12px; }
    .txmr-search-col + .txmr-search-col { border-left: none; border-top: 1px solid #ebebeb; }
    .txmr-search-col-submit { padding: 12px 16px; }
    .txmr-sb-submit-btn { height: auto; padding: 14px; }
    .txmr-sb-guests-drop { left: 0; right: 0; min-width: unset; }
    .txmr-search-col-guests { overflow: visible; }
}
