/**
 * WooCommerce Báo Giá - Styles
 */

/* Wrapper cho button - đảm bảo nằm cùng hàng */
.wc-bao-gia-btn-wrapper {
    display: inline-block !important;
    vertical-align: top !important;
    margin-left: 10px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    width: auto !important;
    float: none !important;
    clear: none !important;
}

/* Button "In Báo Giá" */
.wc-bao-gia-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background-color: #0066cc;
    color: #ffffff !important;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    margin: 0 !important;
    width: auto !important;
    max-width: none !important;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* .wc-bao-gia-btn:hover {
    background-color: #0052a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
} */

.wc-bao-gia-btn:active {
    transform: translateY(0);
}

.wc-bao-gia-btn svg {
    vertical-align: middle;
}

/* Modal */
.wc-bao-gia-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.wc-bao-gia-modal.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wc-bao-gia-modal-content {
    background-color: #ffffff;
    margin: 2% auto;
    width: 90%;
    max-width: 1000px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.wc-bao-gia-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid #e0e0e0;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.wc-bao-gia-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
    font-weight: 700;
}

.wc-bao-gia-close {
    color: #999;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.wc-bao-gia-close:hover,
.wc-bao-gia-close:focus {
    color: #333;
}

.wc-bao-gia-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    background-color: #f5f5f5;
}

.wc-bao-gia-modal-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px 30px;
    border-top: 2px solid #e0e0e0;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.wc-bao-gia-modal-footer .button {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wc-bao-gia-print-btn {
    background-color: #28a745;
    color: #ffffff !important;
}

.wc-bao-gia-print-btn:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.wc-bao-gia-download-btn {
    background-color: #dc3545;
    color: #ffffff !important;
}

.wc-bao-gia-download-btn:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Loading */
.wc-bao-gia-loading {
    text-align: center;
    padding: 60px 20px;
}

.wc-bao-gia-loading .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0066cc;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Báo Giá Document Preview */
.wc-bao-gia-preview {
    background-color: #ffffff;
    padding: 0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bao-gia-document {
    padding: 40px;
    background-color: #ffffff;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #333;
    line-height: 1.6;
}

.bao-gia-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #333;
}

.company-logo img {
    max-width: 150px;
    height: auto;
}

.company-info {
    flex: 1;
    padding: 0 20px;
}

.company-info h3 {
    font-size: 18px;
    color: #c00;
    margin-bottom: 10px;
}

.company-info p {
    margin: 5px 0;
    font-size: 13px;
}

.partner-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.partner-logos img {
    max-width: 80px;
    height: auto;
}

.bao-gia-title {
    text-align: center;
    margin: 30px 0;
}

.bao-gia-title h1 {
    font-size: 28px;
    color: rgb(0, 0, 0);
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 700;
}

.bao-gia-title .date {
    font-size: 14px;
    color: #666;
}

.product-intro {
    margin: 20px 0;
    font-size: 14px;
}

/* Table Wrapper for Responsive Scroll */
.bao-gia-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 30px 0;
}

/* Table Styles */
.bao-gia-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 13px;
    min-width: 600px;
}

.bao-gia-table thead {
    background-color: #f0f0f0;
}

.bao-gia-table th {
    padding: 12px;
    border: 1px solid #ddd;
    font-weight: 700;
    text-align: left;
    color: #333;
}

.bao-gia-table td {
    padding: 12px;
    border: 1px solid #ddd;
}

.bao-gia-table tbody tr:hover {
    background-color: #f9f9f9;
}

.bao-gia-table .text-center {
    text-align: center;
}

.bao-gia-table .text-right {
    text-align: right;
}

.bao-gia-table tfoot {
    background-color: #f9f9f9;
    font-weight: 700;
}

.bao-gia-table tfoot td {
    font-size: 15px;
}

/* Specifications Table */
.specifications-table {
    width: 100%;
    margin-top: 15px;
    border: none;
}

.specifications-table td {
    border: none;
    padding: 6px 10px;
    font-size: 12px;
}

.specifications-table .spec-label {
    font-weight: 600;
    width: 40%;
    background-color: #f9f9f9;
    color: #555;
}

.specifications-table .spec-value {
    color: #333;
}

/* Notes Section */
.bao-gia-notes {
    margin: 30px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-left: 4px solid #0066cc;
    border-radius: 4px;
}

.bao-gia-notes h3 {
    font-size: 16px;
    color: #c00;
    margin-bottom: 15px;
    font-weight: 700;
}

.bao-gia-notes ul {
    list-style-type: disc;
    padding-left: 25px;
    margin: 0;
}

.bao-gia-notes li {
    margin: 8px 0;
    font-size: 13px;
}

/* Footer Section */
.bao-gia-footer {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
    gap: 30px;
}

.footer-section {
    flex: 1;
}

.footer-section h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #333;
}

.footer-section p {
    font-size: 13px;
    margin: 5px 0;
}

.signature-space {
    height: 80px;
    border-bottom: 1px solid #333;
    margin-top: 50px;
}

/* Contact Section */
.bao-gia-contact {
    text-align: center;
    margin-top: 40px;
    padding: 25px;
    background-color: #0066cc;
    color: #ffffff;
    border-radius: 4px;
}

.bao-gia-contact h3 {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 700;
}

.bao-gia-contact p {
    margin: 8px 0;
    font-size: 15px;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .wc-bao-gia-modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .wc-bao-gia-modal-header,
    .wc-bao-gia-modal-body,
    .wc-bao-gia-modal-footer {
        padding: 15px;
    }
    
    .bao-gia-document {
        padding: 20px;
    }
    
    .bao-gia-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .company-info {
        padding: 20px 0;
    }
    
    .bao-gia-footer {
        flex-direction: column;
    }
    
    /* Table responsive trên mobile */
    .bao-gia-table-wrapper {
        margin: 20px 0;
        border: 1px solid #ddd;
        border-radius: 4px;
        background: linear-gradient(90deg, #fff 30%, rgba(255,255,255,0)),
                    linear-gradient(90deg, rgba(255,255,255,0), #fff 70%) 100% 0,
                    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.2), rgba(0,0,0,0)),
                    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.2), rgba(0,0,0,0)) 100% 0;
        background-repeat: no-repeat;
        background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
        background-attachment: local, local, scroll, scroll;
    }
    
    .bao-gia-table {
        font-size: 10px;
        min-width: 500px;
    }
    
    .bao-gia-table th,
    .bao-gia-table td {
        padding: 6px 4px;
    }
    
    .bao-gia-table th {
        font-size: 10px;
    }
    
    .bao-gia-table tfoot td {
        font-size: 11px;
    }
    
    .specifications-table td {
        padding: 4px 6px;
        font-size: 11px;
    }
    
    /* Nút "In Báo Giá" trên mobile */
    .wc-bao-gia-btn-wrapper {
        display: block !important;
        margin-left: 0 !important;
        margin-top: 10px !important;
    }
    
    
    .wc-bao-gia-modal-footer {
        flex-direction: column;
    }
    
    .wc-bao-gia-modal-footer .button {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .wc-bao-gia-modal-header,
    .wc-bao-gia-modal-footer {
        display: none !important;
    }
    
    .wc-bao-gia-modal {
        background-color: transparent;
    }
    
    .wc-bao-gia-modal-content {
        box-shadow: none;
        margin: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .wc-bao-gia-modal-body {
        padding: 0;
        background-color: transparent;
    }
    
    .bao-gia-document {
        padding: 0;
    }
}

