/* File: anewbd/css/pc-builder.css */

/*
==========================================================================
    PC Builder Page Layout
==========================================================================
*/

#page .site-content {
    flex-grow: 1;
    background: #f3f7ff;
}


.pc-builder-wrapper {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background: #f3f7ff;
}

.pc-builder-product-list {
    flex: 2;
    padding-right: 20px;
}


/*
==========================================================================
    New Accordion and Grid Styles
==========================================================================
*/
/* লেআউট শিফট রোধ করতে নতুন কোড  */
.pc-builder-category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    
}

.pc-builder-accordion-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.pc-builder-accordion-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* খোলা অ্যাকর্ডিয়ানের জন্য নতুন স্টাইল */
.pc-builder-accordion-item.is-active {
    border-color: #27ae60;
}

.pc-builder-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #f8f9fa;
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.pc-builder-accordion-header:hover {
    background-color: #e9ecef;
}

.pc-builder-accordion-header .pc-builder-category-title {
    font-size: 18px;
    font-weight: 600;
    color: #101828;
    margin: 0;
}

.pc-builder-accordion-header .accordion-icon {
    font-size: 18px;
    color: #555555;
    transition: transform 0.3s ease;
}

.pc-builder-accordion-item.is-active .accordion-icon {
    transform: rotate(45deg);
}

.pc-builder-accordion-content {
    display: none;
}

.pc-builder-accordion-content .related-products-section-checkout {
    padding-top: 0;
    margin-top: 0;
    border-top: none;
    box-shadow: none;
    border: none;
}

/* প্রোডাক্টের চারপাশে প্যাডিং যোগ করতে নতুন কোড  */
.pc-builder-accordion-content .related-products-list-checkout {
    height: auto;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 20px; /* এই লাইনটি পরিবর্তন করা হয়েছে */
}
/*
==========================================================================
    PC Builder Checkout Form - New Professional Styles
==========================================================================
*/
#pc-builder-checkout-form {
    padding: 10px;
    transition: all 0.3s ease-in-out;
}

#pc-builder-checkout-form .form-field-group {
    margin-bottom: 20px;
}

#pc-builder-checkout-form .form-field-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

#pc-builder-checkout-form .input-with-icon {
    position: relative;
}

#pc-builder-checkout-form .input-with-icon i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 15px;
    color: #999;
    font-size: 16px;
    pointer-events: none;
}

#pc-builder-checkout-form input[type="text"],
#pc-builder-checkout-form input[type="tel"],
#pc-builder-checkout-form textarea,
#pc-builder-checkout-form select {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.2s ease;
    background-color: #fff;
    font-family: inherit;
    color: #333;
}

#pc-builder-checkout-form input:focus,
#pc-builder-checkout-form textarea:focus,
#pc-builder-checkout-form select:focus {
    outline: none;
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2);
}

#pc-builder-checkout-form textarea {
    min-height: 80px;
}

#pc-builder-checkout-form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%208l5%205%205-5z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    cursor: pointer;
}

#pc-builder-checkout-form .popup-submit-button {
    width: 100%;
    padding: 15px;
    background-color: #27ae60;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#pc-builder-checkout-form .popup-submit-button:hover {
    background-color: #229954;
}

#pc-builder-checkout-form .popup-submit-button:disabled {
    background-color: #ddd;
    cursor: not-allowed;
    color: #999;
}
/*
==========================================================================
    PC Builder Quotation Sidebar Styles
==========================================================================
*/
.pc-builder-wrapper {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.pc-builder-product-list {
    flex: 2;
    padding-right: 20px;
}

.pc-builder-category-section {
    margin-bottom: 40px;
}

.pc-builder-category-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    border-bottom: 3px solid #e0e0e0;
    padding-bottom: 10px;
}

.pc-builder-quotation-sidebar {
    flex: 1;
    position: sticky;
    top: 20px;
    height: fit-content;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.pc-builder-quotation-sidebar .quotation-panel {
    min-height: 250px;
}

.pc-builder-quotation-sidebar .quotation-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.pc-builder-quotation-sidebar .quotation-panel-title {
    font-size: 20px;
    font-weight: 700;
    color: #101828;
    margin: 0;
}

.pc-builder-panel-toggle-button {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
}

.pc-builder-panel-toggle-button:hover {
    background: #eee;
}

#pc-builder-quotation-content {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden; 
    padding-right: 5px;
    padding-top: 8px;
}

.pc-builder-quotation-sidebar .no-products-message {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px 0;
}

.summary-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-item-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    position: relative;
    background-color: #fff;
}

.product-item-summary .remove-cart-item-button {
    position: absolute;
    top: -10px;  /* বাটনটিকে সামান্য উপরে উঠানো হয়েছে */
    right: -2px;   /* বাটনটিকে সামান্য বামে সরানো হয়েছে */
    z-index: 10; /* এই লাইনটি বাটনকে অন্য সবকিছুর উপরে রাখবে */
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.2s;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.product-item-summary .remove-cart-item-button:hover {
    background-color: #c0392b;
    transform: scale(1.1);
}

.summary-product-image img {
    width: 50px;
    height: auto;
    border-radius: 6px;
}

.summary-product-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.summary-product-details .item-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.pc-builder-price-info {
    font-size: 13px;
    color: #555;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.item-price ins {
    color: var(--color-price-red);
    font-weight: 700;
    text-decoration: none;
}
.item-price del {
    color: var(--color-text-light-grey);
    font-size: 12px;
}

.saved-amount-container {
    font-size: 12px;
    font-weight: 600;
    color: #27ae60;
}

.cart-totals-summary {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #ced4da;
    padding: 15px;
    border-radius: 8px;
    background-color: #e9ecef;
    border-top: none;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    margin-bottom: 5px;
}

.summary-row.total-row {
    font-size: 18px;
    font-weight: 700;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.summary-row .summary-value {
    font-weight: 600;
    color: #333;
}
.summary-row.total-row .total-price {
    color: #c0392b;
}
.summary-row.saved-row .summary-value {
    color: #27ae60;
}

.quotation-actions-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.pc-builder-action-button {
    flex: 1;
    background-color: #101828;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 12px 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 45px;
    font-size: 16px;
}

.pc-builder-action-button.secondary-action {
    background-color: #27ae60;
}

.pc-builder-action-button:hover {
    background-color: #333;
}

.pc-builder-action-button.secondary-action:hover {
    background-color: #229954;
}

.pc-builder-loading-icon {
    font-size: 18px;
    color: #27ae60;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    .pc-builder-quotation-sidebar, .pc-builder-quotation-sidebar * {
        visibility: visible;
    }
    .pc-builder-quotation-sidebar {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
        border: none;
    }
    .pc-builder-quotation-sidebar .pc-builder-panel-toggle-button,
    .pc-builder-quotation-sidebar .quotation-actions-row,
    .pc-builder-quotation-sidebar #pc-builder-checkout-form {
        display: none;
    }
    .pc-builder-quotation-sidebar .quotation-panel {
        min-height: auto;
    }
}

/*
==========================================================================
    PC Builder Full-Width Layout Fix (For Boxed View)
==========================================================================
*/
.page-template-pc-builder-page-template .ast-container {
    max-width: 1600px !important; /* <<-- পিসি বিল্ডারের জন্য একটু বেশি জায়গা দেওয়া হলো */
    width: 100%;
    padding-left: 20px !important;
    padding-right: 20px !important;
    margin: 0 auto !important; /* এটি নিশ্চিত করবে যে কন্টেইনারটি মাঝখানে থাকবে */
}

.page-template-pc-builder-page-template .site-content {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}

/*
==========================================================================
    PC Builder Product List Spacing Fix
==========================================================================
*/
.page-template-pc-builder-page-template .related-products-section-checkout .related-products-list-checkout {
    padding: 10px 20px 40px !important;
    margin: 10px 20px 40px !important;
}

/* শুধুমাত্র পিসি বিল্ডার পেজে, পণ্যগুলোর মধ্যে গ্যাপ কমানোর জন্য */
.page-template-pc-builder-page-template .related-product-item-checkout {
    margin: 0 !important;
}

/*
==========================================================================
    Mobile Quotation Bar and Popup Styles
==========================================================================
*/

.mobile-quotation-bar {
    display: none; /* ডিফল্টভাবে ডেস্কটপে লুকানো থাকবে */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #101828;
    color: #ffffff;
    padding: 10px 15px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2);
    z-index: 999;
    align-items: center;
    justify-content: space-between;
}

.mobile-quotation-bar .total-price-display {
    font-size: 16px;
    font-weight: 700;
}

.mobile-quotation-bar .view-quotation-button {
    background-color: var(--all-quick-buy-button-color) !important;
    color: #ffffff;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
}

/* Modal Styles */
.pc-builder-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.pc-builder-modal.is-visible {
    display: flex;
}

.pc-builder-modal-content {
    background-color: #ffffff;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.pc-builder-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.pc-builder-modal-header .quotation-panel-title {
    margin: 0;
    font-size: 18px;
}

.pc-builder-modal .modal-close-button {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.pc-builder-modal-body {
    padding: 15px;
    overflow-y: auto;
}

.pc-builder-modal-footer {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
}

.pc-builder-modal-footer .pc-builder-action-button {
    width: 100%;
}

/*
==========================================================================
    NEW: Mobile Popup Content Styles
==========================================================================
*/
.pc-builder-modal-body .summary-product-details {
    gap: 4px;
}

.pc-builder-modal-body .summary-product-details .item-name {
    font-size: 16px;
    font-weight: 600;
    color: #101828;
}

.pc-builder-modal-body .item-price ins {
    color: #c0392b;
    font-weight: 700;
    font-size: 16px;
}

.pc-builder-modal-body .item-price del {
    color: #95a5a6;
    font-size: 13px;
}

.pc-builder-modal-body .saved-amount-container {
    font-size: 14px;
    font-weight: 600;
    color: #27ae60 !important;
}


/*
==========================================================================
    Mobile Responsive Design
==========================================================================
*/
@media (max-width: 992px) {
    .pc-builder-wrapper {
        flex-direction: column;
    }
    .pc-builder-product-list {
        padding-right: 0;
        margin-top: 10px;
    }
    .pc-builder-quotation-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .pc-builder-quotation-sidebar {
        display: none; /* ডেস্কটপ সাইডবার মোবাইলে লুকানো থাকবে */
    }
    .mobile-quotation-bar {
        display: flex; /* মোবাইল বাটনটি দেখানো হবে */
    }
    .pc-builder-category-grid {
        grid-template-columns: repeat(1, 1fr); /* মোবাইলে এক কলাম গ্রিড */
    }

    .page-template-pc-builder-page-template .ast-container {
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }


    .page-template-pc-builder-page-template .related-products-section-checkout .related-products-list-checkout {
        padding: 10px 10px 40px !important;
        margin: 10px 0px 40px !important;
    }
}


/*
==========================================================================
    PC Builder "Added" Button Styles
==========================================================================
*/

.related-product-buttons.custom-buttons-wrapper .pc-builder-add-button.added {
    background-color: #27ae60 !important; /* হালকা সবুজ ব্যাকগ্রাউন্ড */
    color: var(--all-add-to-cart-button-text-color) !important; /* গাঢ় সবুজ টেক্সট */
    border: 1px solid #a5d6a7;
    cursor: pointer; /* হোভার ইফেক্টের জন্য কার্সার রাখা হয়েছে */
    pointer-events: auto !important; /* ক্লিক যেন ডিজেবল না হয় */
    opacity: 1; /* অপাসিটি স্বাভাবিক রাখা হয়েছে */
}

.related-product-buttons.custom-buttons-wrapper .pc-builder-add-button.added:hover {
    background-color: #ffebee !important; /* হালকা লাল ব্যাকগ্রাউন্ড */
    color: #c62828 !important; /* গাঢ় লাল টেক্সট */
    border-color: #ef9a9a;
}

/* আইকন এবং টেক্সটের মধ্যে স্পেস দেওয়ার জন্য */
.pc-builder-add-button.added i {
    margin-right: 5px;
}


/*
==========================================================================
    PC Builder Print Invoice Styles (For @media print)
==========================================================================
*/
@media print {
    body, html {
        visibility: hidden; /* প্রিন্টের সময় মূল পেজের সবকিছু হাইড করুন */
    }

    /* শুধুমাত্র প্রিন্ট কন্টেইনার এবং এর ভেতরের সবকিছু দৃশ্যমান করুন */
    .print-invoice-container, .print-invoice-container * {
        visibility: visible;
    }
    
    .print-invoice-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        border: none;
    }
}


/*
==========================================================================
    PC Builder Mobile Bar - Final & Foolproof Smart Adjustment
==========================================================================
*/
@media (max-width: 768px) {
    /*
     * ধাপ ১: PC Builder পেজের body-তে অতিরিক্ত প্যাডিং যোগ করা,
     * যাতে কোটেশন বারের নিচেও কন্টেন্ট দেখা যায়।
     */
    .page-template-pc-builder-page-template body {
        /* 60px (ট্যাব বার) + 50px (কোটেশন বার) = 110px */
        padding-bottom: 110px !important;
    }

    /*
     * ধাপ ২: কোটেশন বারটিকে ট্যাব বারের ঠিক উপরে সঠিকভাবে পজিশন করা।
     * z-index নিশ্চিত করে যে এটি অন্য কিছুর নিচে চাপা পড়বে না।
     */
    .mobile-quotation-bar {
        bottom: 60px; /* ট্যাব বারের (60px) উপরে অবস্থান */
        z-index: 998; /* ট্যাব বারের (999) ঠিক নিচে */
        transition: bottom 0.3s ease-in-out;
    }

    /*
     * ধাপ ৩: যখন ট্যাব বার হাইড হয়ে যাবে, তখন কোটেশন বার নিচে নেমে আসবে
     * এবং body-এর প্যাডিং কমিয়ে দেওয়া হবে।
     */
    body.tab-bar-is-hidden .mobile-quotation-bar {
        bottom: 0;
    }

    body.tab-bar-is-hidden.page-template-pc-builder-page-template {
        padding-bottom: 50px !important; /* শুধুমাত্র কোটেশন বারের জন্য প্যাডিং */
    }
}