/* ============================================
   PHIẾU KÍCH HOẠT BẢO HÀNH - Warranty Card
   ============================================ */

/* === Header phiếu bảo hành === */
.baohanh-header {
    text-align: center;
    padding: 28px 20px 20px;
}

.baohanh-header h2 {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 6px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.baohanh-header p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    margin: 0;
    font-weight: 400;
}

/* === Lưu ý === */
.baohanh-note {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    padding: 0px;
    margin-bottom: 0px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.baohanh-note p {
    margin: 0 0 4px;
}

.baohanh-note p:last-child {
    margin-bottom: 0;
}

/* === Fieldset container (trắng bên trong nền đỏ) === */
.form_kichhoatbaohanh fieldset {
    border: 1px solid #e5e5e5 !important;
    border-radius: 8px !important;
    padding: 22px 22px 16px !important;
    margin: 10px 0px !important;
    background: #fff !important;
}

/* === Legend title === */
.form_kichhoatbaohanh fieldset legend {
    font-size: 14px;
    font-weight: 700;
    color: #1d2939;
    padding: 0 10px;
    margin-left: 6px;
    width: auto;border-bottom: 0px!important;
}

/* === Khoảng cách giữa các fieldset === */
.form_kichhoatbaohanh fieldset + fieldset {
    margin-top: 0px !important;
}

/* === Radio buttons === */
.baohanh-radio .wpcf7-radio {
    display: flex;
    gap: 24px;
    align-items: center;
    height: 42px;
}

.baohanh-radio .wpcf7-list-item {
    margin: 0;
}

.baohanh-radio .wpcf7-list-item label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #344054;
}

.baohanh-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #dc2626;
    cursor: pointer;
}

/* === Mỗi hàng form === */
.baohanh-row {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 3px 0;
}

.baohanh-row:last-child {
    padding-bottom: 0;
}

/* === Label bên trái === */
.baohanh-row .baohanh-label {
    flex: 0 0 180px;
    font-size: 14px;
    font-weight: 500;
    color: #475467;
    padding-right: 20px;
    line-height: 1.4;
}

.baohanh-label .required {
    color: #f04438;
    margin-left: 2px;
    font-weight: 600;
}

/* === Input bên phải === */
.baohanh-row .baohanh-input {
    flex: 1;
    min-width: 0;
}

/* === ĐỒNG NHẤT tất cả input, select, textarea === */
.baohanh-row input[type="text"],
.baohanh-rowr input[type="tel"],
.baohanh-row input[type="email"],
.baohanh-row input[type="number"],
.baohanh-row textarea,
.baohanh-row select,
.baohanh-row .sd-input {
    width: 100%;
    height: 30px;
    padding: 0 12px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: #344054;
    background: #fff;
    transition: border-color 0.2s ease;
    outline: none;
    box-sizing: border-box;
    box-shadow: none;
    line-height: 36px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.baohanh-row input[type="text"]:hover,
.baohanh-row input[type="tel"]:hover,
.baohanh-row input[type="email"]:hover,
.baohanh-row .sd-input:hover {
    border-color: #98a2b3;
}

.baohanh-row input[type="text"]:focus,
.baohanh-row input[type="tel"]:focus,
.baohanh-row input[type="email"]:focus,
.baohanh-row .sd-input:focus,
.baohanh-row .sd-container.sd-active .sd-input {
    border-color: #2970ff;
    box-shadow: none;
}

.baohanh-row input::placeholder,
.baohanh-row .sd-input::placeholder {
    color: #98a2b3;
    font-size: 13.5px;
}

/* Ẩn CF7 wpcf7-form-control-wrap span (không cần thiết) */
.baohanh-row .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
    position: relative;
}

/* ============================================
   SEARCHABLE DROPDOWN
   ============================================ */

.sd-container {
    position: relative;
    width: 100%;
}

.sd-container .wpcf7-form-control-wrap {
    position: static !important;
}

.sd-input-wrap {
    position: relative;
}

/* Arrow */
.sd-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #667085;
    font-size: 10px;
    pointer-events: none;
    transition: transform 0.2s ease;
    z-index: 2;display: none;
    line-height: 1;
}

.sd-container.sd-active .sd-arrow {
    transform: translateY(-50%) rotate(180deg);
    color: #2970ff;display: none;
}

/* Input trong searchable dropdown */
.sd-container .sd-input {
    padding-right: 36px;
    cursor: pointer;
}

.sd-container.sd-active .sd-input {
    cursor: text;
}

/* === Dropdown panel === */
.sd-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid #d0d5dd;
    border-radius: 10px;
    box-shadow: 0 12px 32px -4px rgba(16, 24, 40, 0.14), 0 4px 8px -2px rgba(16, 24, 40, 0.06);
    z-index: 1000;
    display: none;
    overflow: visible;
    max-height: 360px;
}

/* Product dropdown - wider */
.searchable-dropdown[data-type="masanpham"] .sd-dropdown {
    right: auto;
    min-width: 700px;
}

/* Arrow trỏ vào input - viền */
.sd-dropdown::before {
    content: '';
    position: absolute;
    top: -9px;
    left: 24px;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 9px solid #d0d5dd;
    z-index: 2;
}

/* Arrow trỏ vào input - nền */
.sd-dropdown::after {
    content: '';
    position: absolute;
    top: -7px;
    left: 26px;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid #e4e7ec;
    z-index: 3;
}

.sd-dropdown.sd-open {
    display: block;
    animation: sdSlideDown 0.15s ease-out;
}

@keyframes sdSlideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Header row (for multi-column) === */
.sd-header {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: #e4e7ec;
    border-bottom: 1.5px solid #d0d5dd;
    font-size: 12px;
    font-weight: 600;
    color: #475467;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 1;
    border-radius: 9px 9px 0 0;
}

/* === Scrollable list === */
.sd-list {
    max-height: 268px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sd-list::-webkit-scrollbar {
    width: 6px;
}

.sd-list::-webkit-scrollbar-track {
    background: transparent;
}

.sd-list::-webkit-scrollbar-thumb {
    background: #d0d5dd;
    border-radius: 3px;
}

.sd-list::-webkit-scrollbar-thumb:hover {
    background: #98a2b3;
}

/* === Mỗi item === */
.sd-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #344054;
    transition: background 0.1s ease;
    border-bottom: 1px solid #f2f4f7;
}

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

.sd-item:hover {
    background: #f0f5ff;
}

.sd-item.sd-item-active {
    background: #eff4ff;
    color: #1849a9;
}

.sd-item.sd-item-selected {
    background: #eff8ff;
    font-weight: 500;
}

/* === Columns === */
.sd-col-sku {
    flex: 0 0 35%;
    font-weight: 500;
    color: #1849a9;
    border-right: 1px solid #eaecf0;
    padding-right: 14px;
    margin-right: 14px;
}

.sd-header .sd-col-sku {
    border-right-color: #d0d5dd;
}

.sd-col-name {
    flex: 1;
    color: #475467;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sd-header .sd-col-sku,
.sd-header .sd-col-name {
    color: #667085;
    font-weight: 600;
}

/* === Highlight matched text === */
.sd-highlight {
    background: #fef3c7;
    color: #92400e;
    border-radius: 2px;
    padding: 0 1px;
}

/* === Empty state === */
.sd-empty {
    padding: 24px 16px;
    text-align: center;
    color: #98a2b3;
    font-size: 13px;
}

/* === Single column item (provinces) === */
.sd-item-single {
    display: block;
    padding: 9px 14px;
}

/* Province dropdown */
.searchable-dropdown[data-type="tinhthanh"] .sd-item {
    font-size: 13.5px;
}

.searchable-dropdown[data-type="tinhthanh"] .sd-item:hover {
    background: #eff4ff;
    color: #1849a9;
}

.searchable-dropdown[data-type="tinhthanh"] .sd-item.sd-item-selected {
    background: #eff8ff;
    color: #1849a9;
    font-weight: 600;
}

/* ============================================
   NÚT GỬI
   ============================================ */

.baohanh-submit {
    text-align: center;
    margin-top: 20px;
}

.baohanh-row input[type="submit"] {
    background: #fff;
    color: #b91c1c;
    border: none;
    height: 48px;
    padding: 0 48px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.baohanh-row input[type="submit"]:hover {
    background: #fef2f2;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.baohanh-row input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ============================================
   CF7 ERROR / RESPONSE
   ============================================ */

.baohanh-row .wpcf7-not-valid-tip {
    font-size: 12px;
    color: #f04438;
    margin-top: 4px;
    display: block;
}

.baohanh-row .wpcf7-not-valid {
    border-color: #fda29b !important;
}

.baohanh-row .wpcf7-not-valid:focus {
    box-shadow: 0 0 0 3px rgba(253, 162, 155, 0.25) !important;
}

.baohanh-row .wpcf7-response-output {
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 14px;
    margin-top: 20px;
    border-width: 1.5px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .baohanh-row {
        margin: 16px auto;
    }

    .baohanh-row fieldset {
        padding: 20px 16px;
    }

    .baohanh-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 0;
        min-height: auto;
    }

    .baohanh-row .baohanh-label {
        flex: none;
        margin-bottom: 6px;
        font-size: 13px;
    }

    .baohanh-row .baohanh-input {
        width: 100%;
    }

    .baohanh-row input[type="submit"] {
        width: 100%;
        padding: 0 20px;
    }

    .sd-col-sku {
        flex: 0 0 40%;
    }
}

@media (max-width: 480px) {
    .baohanh-row fieldset {
        padding: 16px 12px;
    }

    .baohanh-row fieldset legend {
        font-size: 14px;
        padding: 0 10px;
    }

    .sd-col-name {
        font-size: 12px;
    }
}
.baohanh-submit input[type="submit"]{
    background: #EB0B00!important;
}

/* ============================================
   SUBMIT MODAL
   ============================================ */

.bh-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.bh-modal-overlay.bh-modal-show {
    display: flex;
}

.bh-modal {
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px 32px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: bhModalIn 0.3s ease;
}

@keyframes bhModalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.bh-modal-icon {
    margin-bottom: 20px;
}

/* Spinner */
.bh-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #dc2626;
    border-radius: 50%;
    animation: bhSpin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes bhSpin {
    to { transform: rotate(360deg); }
}

.bh-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1d2939;
    margin: 0 0 8px;
}

.bh-modal-msg {
    font-size: 14px;
    color: #667085;
    margin: 0 0 24px;
    line-height: 1.5;
}

.bh-modal-btn {
    background: #dc2626;
    color: #fff;
    border: none;
    height: 42px;
    padding: 0 36px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.bh-modal-btn:hover {
    background: #b91c1c;
}
.Tabbaohanh .nav-tabs > li > a {
    background-color: rgba(0,0,0,.04);
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    border-top: 1px solid #ddd;
    padding-left: 15px;
    padding-right: 15px;
}
.Tabbaohanh .nav-tabs > li.active > a {
    border-top-color: red;
}
.Tabbaohanh .nav-tabs > li.active > a {
    background-color: red!important;
    color: #fff!important;
}
@media (max-width: 480px) {
    .Tabbaohanh .nav-tabs + .tab-panels {
        background-color: #fff;
        border: 0px solid #ddd;
        padding: 0px;
    }
    .Tabbaohanh  .nav-tabs > li {
        width: 50%;
        padding: 2px;margin: 0px!important;
    }

    .Tabbaohanh .nav-tabs > li > a {
        background-color: rgba(0,0,0,.04);
        border-left: 1px solid #ddd;
        border-right: 1px solid #ddd;
        border-top: 1px solid #ddd;
        padding-left: 15px;
        padding-right: 15px;
        font-size: 11px;
        display: block;
        text-align: center;
        border-bottom: 1px solid #ddd;
    }
    .form_kichhoatbaohanh fieldset {
        border: 1px solid #e5e5e5 !important;
        border-radius: 8px !important;
        padding: 0px 20px 0px !important;
        margin: 10px 0px !important;
        background: #fff !important;
    }
    .baohanh-row {
        margin: 1px auto;
    }
    .form_kichhoatbaohanh fieldset {
        border: 1px solid #e5e5e5 !important;
        border-radius: 8px !important;
        padding: 0px 20px 0px !important;
        margin: 0px 0px !important;
        background: #fff !important;
    }
    .baohanh-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 0px 0;
        min-height: auto;
    }
}