/* ============================================================
   WooCommerce Mua Trả Góp v2 – Frontend Styles
   ============================================================ */

:root {
    --tg-btn-color:    #c0392b;
    --tg-header-color: #c0392b;
}

/* ---- Nút Mua Trả Góp ---- */
.tragop-btn {
    border: none !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    display: inline-block !important;
    transition: filter .2s !important;
}
.tragop-btn:hover { filter: brightness(.88) !important; }

/* ---- Overlay ---- */
#tragop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

/* ---- Modal ---- */
#tragop-modal {
    background: #fff;
    width: 840px;
    max-width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 5px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,.3);
}

/* ---- Header ---- */
.tg-header {
    background: var(--tg-header-color);
    color: #fff;
    padding: 13px 18px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1;
}
.tg-header button {
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    font-size: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.tg-header button:hover { background: rgba(255,255,255,.35); }

/* ---- Product info ---- */
.tg-product-info {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}
.tg-product-info > img:first-child {
    width: 110px;
    height: 80px;
    object-fit: contain;
    border: 1px solid #ddd;
    padding: 4px;
    background: #fff;
    border-radius: 3px;
    flex-shrink: 0;
}
.tg-product-text h2 {
    color: var(--tg-header-color);
    font-size: 17px;
    margin: 0 0 5px;
    text-transform: uppercase;
    line-height: 1.3;
}
.tg-product-text p { margin: 0; color: #444; }
.tg-logo { margin-left: auto; max-height: 52px; max-width: 160px; flex-shrink: 0; }
.tg-bank-name {
    margin-left: auto;
    font-size: 17px;
    font-weight: 900;
    color: var(--tg-header-color);
    letter-spacing: 1px;
    flex-shrink: 0;
}

/* ---- Two-column body ---- */
.tg-body {
    display: flex;
}
.tg-col {
    flex: 1;
    padding: 16px 18px;
}
.tg-col:first-child {
    border-right: 1px solid #eee;
}
.tg-col h3 {
    font-size: 12px;
    font-weight: 700;
    margin: 0 0 12px;
    text-transform: uppercase;
    color: #555;
    letter-spacing: .4px;
}

/* ---- Tables ---- */
.tg-table { width: 100%; border-collapse: collapse; }
.tg-table td { padding: 7px 4px; vertical-align: middle; }
.tg-table td:first-child { font-weight: 600; color: #444; width: 50%; }
.tg-table input[type="text"],
.tg-table select {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
    box-sizing: border-box;
    background: #fff;
}
.tg-table input[readonly] { background: #f5f5f5; color: #555; }
.tg-table select { cursor: pointer; }

/* ---- Results ---- */
.tg-result {
    margin-top: 16px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px 12px;
}
.tg-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}
.tg-result-row:last-child { border-bottom: none; }
.tg-accent {
    color: var(--tg-header-color);
    font-weight: 700;
    font-size: 14px;
}

/* ---- Form inputs ---- */
.tg-col:last-child .tg-table input {
    border: 1px solid #ccc;
    padding: 8px 10px;
}
.tg-col:last-child .tg-table input:focus {
    border-color: var(--tg-header-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(192,57,43,.15);
}

/* ---- Message ---- */
#tg-msg {
    margin-top: 10px;
    font-size: 13px;
    min-height: 18px;
    padding: 0 2px;
}
#tg-msg.success { color: #27ae60; font-weight: 600; }
#tg-msg.error   { color: #c0392b; font-weight: 600; }

/* ---- Submit ---- */
#tg-submit-btn {
    margin-top: 16px;
    width: 100%;
    background: var(--tg-header-color);
    color: #fff;
    border: none;
    padding: 13px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 3px;
    cursor: pointer;
    letter-spacing: .5px;
    transition: filter .2s;
}
#tg-submit-btn:hover:not(:disabled) { filter: brightness(.88); }
#tg-submit-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---- Shortcode button loading state ---- */
.tragop-shortcode.tragop-loading {
    opacity: .65;
    cursor: wait !important;
}
.tragop-shortcode.tragop-loading::after {
    content: ' ⏳';
}
@media (max-width: 620px) {
    .tg-body { flex-direction: column; }
    .tg-col:first-child { border-right: none; border-bottom: 1px solid #eee; }
    .tg-product-info { flex-wrap: wrap; }
    .tg-logo, .tg-bank-name { margin-left: 0; }
}
