/* ============================================
   Audio System Builder Pro — Frontend CSS v7.0.2
   ============================================ */

.asb-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}
.asb-wrapper *, .asb-wrapper *::before, .asb-wrapper *::after { box-sizing: border-box; }

.asb-main-title { font-size: 1.4em; font-weight: 700; color: #1a202c; text-align: center; margin-bottom: 20px; }

.asb-cards-grid { display: grid; gap: 15px; margin-bottom: 30px; }

.asb-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 280px;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}
.asb-card:hover { transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }

.asb-card-title { font-size: 15px; font-weight: 700; color: #1a202c; min-height: 38px; }

.asb-selected-thumb { width: 100%; height: 110px; object-fit: contain; margin: 10px 0; display: none; }
.asb-selected-name { font-size: 13px; color: #2d3748; margin-bottom: 5px; font-weight: 600; display: none; line-height: 1.3; }
.asb-selected-price { font-size: 14px; color: #e53e3e; font-weight: 700; margin-bottom: 8px; display: none; }

.asb-qty-box { display: none; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; }
.asb-qty-box label { font-size: 12px; font-weight: 600; color: #4a5568; }
.asb-qty-box input { width: 55px; text-align: center; border: 1px solid #cbd5e0; border-radius: 6px; padding: 4px; font-size: 13px; font-weight: 600; }

.asb-btn-open-modal {
    background-color: #0056b3;
    color: white;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
    width: 100%;
}
.asb-btn-open-modal:hover { background-color: #004085; }
.asb-btn-open-modal.active { background-color: #e53e3e; }
.asb-btn-open-modal.active:hover { background-color: #c53030; }

.asb-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.65);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}
.asb-modal-content {
    background: #fff;
    width: 92%;
    max-width: 1100px;
    height: 85vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3);
}
.asb-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}
.asb-modal-header h3 { margin: 0; font-size: 16px; color: #1e293b; font-weight: 700; }
.asb-modal-close {
    font-size: 26px;
    cursor: pointer;
    color: #64748b;
    font-weight: bold;
    border: none;
    background: none;
    line-height: 1;
}
.asb-modal-filter { padding: 12px 20px; border-bottom: 1px solid #edf2f7; background: #fff; }
.asb-modal-filter input {
    padding: 9px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    width: 320px;
    max-width: 100%;
    font-size: 13px;
    outline: none;
}
.asb-modal-filter input:focus { border-color: #0056b3; box-shadow: 0 0 0 3px rgba(0,86,179,0.15); }
.asb-modal-body { padding: 20px; overflow-y: auto; flex: 1; }

.asb-p-grid { display: grid; gap: 12px; }
.asb-p-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #fff;
    transition: border-color 0.2s;
}
.asb-p-item:hover { border-color: #0056b3; }
.asb-p-item img { width: 100%; height: 100px; object-fit: contain; margin-bottom: 8px; }
.asb-p-item-title { font-size: 12px; font-weight: 600; color: #334155; height: 32px; overflow: hidden; margin-bottom: 6px; line-height: 1.3; }
.asb-p-item-price { color: #e53e3e; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.asb-btn-select-prod {
    background: #0056b3;
    color: #fff;
    border: none;
    padding: 7px 0;
    width: 100%;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
}

.asb-summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid #edf2f7;
    padding-top: 20px;
    gap: 15px;
    flex-wrap: wrap;
}
.asb-total-price { font-size: 18px; font-weight: 700; color: #2d3748; }
.asb-total-price span { color: #e53e3e; font-size: 20px; }

.asb-action-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.asb-action-btns button {
    padding: 11px 20px;
    border-radius: 6px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: transform 0.1s, opacity 0.2s;
}
.asb-action-btns button:active { transform: scale(0.98); }
.asb-btn-cart { background: #3182ce; color: white; }
.asb-btn-pdf { background: #0056b3; color: white; }
.asb-btn-email { background: #16a34a; color: white; }
.asb-btn-pay { background: #dc2626; color: white; }

/* ============ MOBILE + TABLET (dưới 1024px) ============ */
@media (max-width: 1024px) {
    .asb-summary-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .asb-total-price {
        font-size: 16px;
        margin-bottom: 12px;
    }
    .asb-total-price span { font-size: 18px; }

    .asb-action-btns {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        gap: 10px;
    }
    .asb-action-btns button {
        width: calc(50% - 5px);
        flex: 0 0 calc(50% - 5px);
        min-height: 52px;
        box-sizing: border-box;
        margin: 0;
        padding: 12px 8px;
        font-size: 12px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.2px;
        white-space: normal;
        line-height: 1.25;
    }
}

/* ============ MOBILE NHỎ (dưới 480px) ============ */
@media (max-width: 480px) {
    .asb-modal-content { width: 95%; height: 90vh; }
    .asb-modal-filter input { width: 100%; }

    .asb-action-btns { gap: 6px; }
    .asb-action-btns button {
        width: calc(50% - 3px);
        flex: 0 0 calc(50% - 3px);
        min-height: 48px;
        font-size: 11px;
        padding: 10px 6px;
        letter-spacing: 0;
    }
    .asb-total-price { font-size: 14px; }
    .asb-total-price span { font-size: 16px; }
}