/* ================================================================
   GHN Quick Buy — CSS
   Nút "Mua ngay" clone từ DevVN: gradient cam, nằm ngang add-to-cart
   ================================================================ */

/* ---------------------------------------------------------------
   NÚT MUA NGAY — pill tròn, cam solid, đồng hàng Thêm vào giỏ hàng
   Clone chính xác từ sachhuyenthuat.net
   --------------------------------------------------------------- */
/* ---------------------------------------------------------------
   NÚT MUA NGAY — Clone đúng style DevVN Quick Buy
   Gradient vàng-cam giống sachhuyenthuat.net
   --------------------------------------------------------------- */
a.ghn-quickbuy-btn,
a.ghn-quickbuy-btn.devvn_buy_now_style {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 28px !important;
    height: 52px !important;
    min-height: 52px !important;
    border-radius: 100px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    letter-spacing: .5px !important;
    color: #fff !important;
    text-align: center !important;
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
    cursor: pointer !important;
    vertical-align: middle !important;
    margin: 0 0 0 8px !important;
    /* Gradient DevVN: vàng → cam */
    background: #f43b00 !important;
    background: -moz-linear-gradient(top, #f6d61d, #f59000) !important;
    background: -webkit-linear-gradient(top, #f6d61d, #f59000) !important;
    background: linear-gradient(to bottom, #f6d61d, #f59000) !important;
    box-shadow: 0 4px 12px rgba(245,144,0,.35) !important;
    transition: filter .15s, transform .1s, box-shadow .15s !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    clear: none !important;
}
a.ghn-quickbuy-btn:hover,
a.ghn-quickbuy-btn.devvn_buy_now_style:hover {
    background: -moz-linear-gradient(top, #f6d61d, #e08200) !important;
    background: -webkit-linear-gradient(top, #f6d61d, #e08200) !important;
    background: linear-gradient(to bottom, #f6d61d, #e08200) !important;
    color: #fff !important;
    text-decoration: none !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(245,144,0,.45) !important;
}
a.ghn-quickbuy-btn:active,
a.ghn-quickbuy-btn.devvn_buy_now_style:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(245,144,0,.3) !important;
}

/* Shop loop */
.ghn-quickbuy-btn-loop {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #fff !important;
    background: #f97316;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    text-decoration: none;
    margin-top: 6px;
    transition: background .2s;
}
.ghn-quickbuy-btn-loop:hover { background: #ea6c0a; color: #fff !important; }

/* ================================================================
   POPUP OVERLAY
   ================================================================ */
.ghn-qb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 9999999;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 12px;
    overflow-y: auto;
}
.ghn-qb-overlay.active { display: flex; }

/* Popup container */
.ghn-qb-popup {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
    animation: ghnQBIn .22s ease;
    margin: auto;
}
@keyframes ghnQBIn {
    from { transform: translateY(-20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Header */
.ghn-qb-header {
    background: #8B5E3C;
    color: #fff;
    padding: 13px 18px;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ghn-qb-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #fff;
    flex: 1;
    line-height: 1.3;
}
.ghn-qb-close {
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    width: 26px; height: 26px;
    border-radius: 50%;
    font-size: 15px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
    padding: 0;
}
.ghn-qb-close:hover { background: rgba(255,255,255,.35); }

/* Body */
.ghn-qb-body {
    display: grid;
    grid-template-columns: 190px 1fr;
}

/* Product panel */
.ghn-qb-product {
    padding: 18px 14px;
    border-right: 1px solid #f0ebe4;
    background: #faf8f5;
    border-radius: 0 0 0 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ghn-qb-product img {
    width: 100%;
    border-radius: 6px;
    object-fit: cover;
    aspect-ratio: 3/4;
    border: 1px solid #eee;
}
.ghn-qb-product-name { font-size: 13px; font-weight: 600; color: #333; line-height: 1.4; }
.ghn-qb-product-price { font-size: 18px; font-weight: 700; color: #e53e3e; }
.ghn-qb-qty-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #666; }
.ghn-qb-qty-row input[type=number] {
    width: 54px; padding: 6px 8px;
    border: 1.5px solid #ddd; border-radius: 5px;
    text-align: center; font-size: 14px; font-weight: 600;
}
.ghn-qb-qty-row input[type=number]:focus { outline: none; border-color: #8B5E3C; }

/* Form panel */
.ghn-qb-form { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }

.ghn-qb-section-title {
    font-size: 11px; font-weight: 800; color: #8B5E3C;
    text-transform: uppercase; letter-spacing: 1px;
    padding-bottom: 5px; border-bottom: 2px solid #f0ebe4;
    margin-bottom: -2px;
}

/* Grid */
.ghn-qb-row        { display: grid; gap: 10px; }
.ghn-qb-row.cols-2 { grid-template-columns: 1fr 1fr; }
.ghn-qb-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Fields */
.ghn-qb-field { display: flex; flex-direction: column; gap: 4px; }
.ghn-qb-field label { font-size: 11px; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: .4px; }
.ghn-qb-field label .req { color: #e53e3e; margin-left: 2px; }

.ghn-qb-field input,
.ghn-qb-field select,
.ghn-qb-field textarea {
    padding: 9px 11px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 13px; color: #333; background: #fff;
    transition: border-color .15s, box-shadow .15s;
    width: 100%; box-sizing: border-box; font-family: inherit;
}
.ghn-qb-field input:focus,
.ghn-qb-field select:focus,
.ghn-qb-field textarea:focus {
    outline: none; border-color: #f59000;
    box-shadow: 0 0 0 3px rgba(245,144,0,.12);
}
.ghn-qb-field select { appearance: auto; cursor: pointer; }
.ghn-qb-field select:disabled { background: #f5f3f0; color: #aaa; cursor: not-allowed; }
.ghn-qb-field textarea { resize: vertical; min-height: 52px; }

/* Shipping box */
.ghn-qb-shipping-row {
    background: #fff8f0; border: 1.5px solid #f0d5a8;
    border-radius: 6px; padding: 9px 13px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.ghn-qb-shipping-label { font-size: 13px; color: #555; }
.ghn-qb-shipping-note  { font-size: 11px; color: #999; margin-top: 2px; }
.ghn-qb-shipping-fee   { font-size: 16px; font-weight: 800; color: #fd6e1d; white-space: nowrap; }

/* Payment */
.ghn-qb-payment-options { display: flex; flex-direction: column; gap: 6px; }
.ghn-qb-payment-option {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 13px; border: 1.5px solid #e0d9d0;
    border-radius: 6px; cursor: pointer;
    transition: all .15s; font-size: 13px; color: #444; user-select: none;
}
.ghn-qb-payment-option:hover { border-color: #f59000; background: #fff8f0; }
.ghn-qb-payment-option.selected { border-color: #f59000; background: #fff8f0; }
.ghn-qb-payment-option input[type=radio] { accent-color: #fd6e1d; flex-shrink: 0; }
.ghn-qb-payment-icon { font-size: 16px; }

/* Summary */
.ghn-qb-summary {
    background: #faf8f5; border: 1.5px solid #e8ddd0;
    border-radius: 6px; padding: 10px 13px;
}
.ghn-qb-summary-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; color: #555; }
.ghn-qb-summary-row.total {
    font-weight: 800; font-size: 15px; color: #222;
    border-top: 1.5px solid #e0d9d0; margin-top: 6px; padding-top: 8px;
}
.ghn-qb-summary-row.total .amount { color: #e53e3e; }

/* Messages */
.ghn-qb-msg { padding: 9px 13px; border-radius: 6px; font-size: 13px; line-height: 1.5; display: none; }
.ghn-qb-msg.error   { background: #fff0f0; color: #c53030; border: 1px solid #fed7d7; display: block; }
.ghn-qb-msg.success { background: #f0fff4; color: #276749; border: 1px solid #c6f6d5; display: block; }

/* Footer */
.ghn-qb-footer { padding: 12px 20px 16px; border-top: 1px solid #f0ebe4; }

/* Submit button trong popup — pill tròn, cam solid */
.ghn-qb-btn-order {
    width: 100%;
    background: #f97316;
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 100px;
    font-size: 15px; font-weight: 800;
    cursor: pointer;
    text-transform: uppercase; letter-spacing: .8px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: background-color .2s, transform .1s;
}
.ghn-qb-btn-order:hover:not(:disabled) {
    background: #ea6c0a;
    transform: translateY(-1px);
}
.ghn-qb-btn-order:active:not(:disabled) { transform: translateY(0); }
.ghn-qb-btn-order:disabled { background: #ccc; cursor: not-allowed; transform: none; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 640px) {
    .ghn-qb-body { grid-template-columns: 1fr; }
    .ghn-qb-product {
        display: grid; grid-template-columns: 80px 1fr;
        border-right: none; border-bottom: 1px solid #f0ebe4;
        border-radius: 0; padding: 12px 14px; align-items: start; gap: 10px;
    }
    .ghn-qb-product img { height: 100px; aspect-ratio: auto; }
    .ghn-qb-row.cols-3 { grid-template-columns: 1fr; }
    .ghn-qb-row.cols-2 { grid-template-columns: 1fr; }
    .ghn-qb-form { padding: 12px 14px; }
    .ghn-qb-footer { padding: 10px 14px 14px; }
}

/* Label optional */
.ghn-qb-optional {
    font-weight: 400;
    font-size: 10px;
    color: #999;
    text-transform: none;
    letter-spacing: 0;
}
