/**
 * Mavigex Price Management - Styles
 */

/* B2B/B2C visibility: hidden by default, JS removes class for correct group */
.only_b2b,
.only_b2c { display: none !important; }

/* Contact Link Wrapper */
.mavigex-price-contact-wrapper {
    margin: 15px 0;
    padding: 15px;
    background-color: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.mavigex-price-contact-wrapper .price-hidden-message {
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.mavigex-price-contact-wrapper .mavigex-contact-btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
}

/* Modal Overlay */
.mavigex-contact-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

/* Modal Container */
.mavigex-contact-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 9999;
}

.mavigex-contact-modal .modal-inner-wrap {
    padding: 0;
}

/* Modal Header */
.mavigex-contact-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
}

.mavigex-contact-modal .modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.mavigex-contact-modal .action-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}

.mavigex-contact-modal .action-close:hover {
    color: #333;
}

.mavigex-contact-modal .action-close span {
    display: none;
}

.mavigex-contact-modal .action-close::before {
    content: '\00d7';
}

/* Modal Content */
.mavigex-contact-modal .modal-content {
    padding: 20px;
}

/* Form Fields */
.mavigex-contact-modal .field {
    margin-bottom: 15px;
}

.mavigex-contact-modal .field.product-info {
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 20px;
}

.mavigex-contact-modal .field.product-info .sku {
    color: #666;
    font-size: 13px;
}

.mavigex-contact-modal .label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.mavigex-contact-modal .field.required .label span::after {
    content: ' *';
    color: #e02b27;
}

.mavigex-contact-modal .control {
    width: 100%;
}

.mavigex-contact-modal .input-text {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.mavigex-contact-modal .input-text:focus {
    border-color: #1979c3;
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 121, 195, 0.2);
}

.mavigex-contact-modal textarea.input-text {
    resize: vertical;
    min-height: 80px;
}

/* Messages */
.mavigex-contact-modal .messages {
    margin: 15px 0;
}

.mavigex-contact-modal .message-success {
    padding: 10px 15px;
    background-color: #e5f7e5;
    border: 1px solid #5cb85c;
    border-radius: 4px;
    color: #3c763d;
}

.mavigex-contact-modal .message-error {
    padding: 10px 15px;
    background-color: #f7e5e5;
    border: 1px solid #e02b27;
    border-radius: 4px;
    color: #e02b27;
}

/* Actions */
.mavigex-contact-modal .actions-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.mavigex-contact-modal .action.primary {
    padding: 10px 25px;
    background-color: #1979c3;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.mavigex-contact-modal .action.primary:hover {
    background-color: #006bb4;
}

.mavigex-contact-modal .action.primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.mavigex-contact-modal .action.cancel {
    padding: 10px 25px;
    background-color: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #333;
    cursor: pointer;
}

.mavigex-contact-modal .action.cancel:hover {
    background-color: #e5e5e5;
}

/* Body class when modal is open */
body.mavigex-modal-open {
    overflow: hidden;
}

/* Validation errors */
.mavigex-contact-modal .mage-error {
    color: #e02b27;
    font-size: 12px;
    margin-top: 5px;
}

.mavigex-contact-modal .input-text.mage-error {
    border-color: #e02b27;
}

/* Product List Price Hidden */
.product-item .mavigex-price-hidden {
    padding: 8px 10px;
    background-color: #f7f7f7;
    border-radius: 3px;
    text-align: center;
}

.product-item .mavigex-price-hidden .contact-link {
    color: #1979c3;
    text-decoration: none;
    font-weight: 600;
}

.product-item .mavigex-price-hidden .contact-link:hover {
    text-decoration: underline;
}

/* B2B: Hide prices in minicart preview (prices come from SAP on /cart page) */
body.is-b2b .minicart-items .product-item-pricing .price,
body.is-b2b .minicart-items .product-item-pricing .minicart-price,
body.is-b2b .minicart-items .product-item-pricing [data-role="priceSidebar"],
body.is-b2b .minicart-items .product-item-pricing .price-wrapper,
body.is-b2b .minicart-items .product-item-pricing .price-container,
body.is-b2b .block-minicart .subtotal {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .mavigex-contact-modal {
        width: 95%;
        max-height: 85vh;
    }

    .mavigex-contact-modal .modal-header {
        padding: 12px 15px;
    }

    .mavigex-contact-modal .modal-content {
        padding: 15px;
    }

    .mavigex-contact-modal .actions-toolbar {
        flex-direction: column;
    }

    .mavigex-contact-modal .actions-toolbar .action {
        width: 100%;
    }
}
