/**
 * Custom Cart and Checkout Quote Styles
 */

/* Hide default WooCommerce cart/checkout content if our custom template is loaded */
body.woocommerce-cart .woocommerce:not(.leadermec-cart-quote) > .woocommerce-cart-form,
body.woocommerce-checkout .woocommerce:not(.leadermec-checkout-quote) > .woocommerce-checkout {
    display: none;
}

.leadermec-cart-quote,
.leadermec-checkout-quote {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.leadermec-cart-quote .cart-header,
.leadermec-checkout-quote .checkout-header {
    margin-bottom: 30px;
    text-align: center;
}

.leadermec-cart-quote .cart-header h1,
.leadermec-checkout-quote .checkout-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #333;
}

.leadermec-cart-quote .cart-header p,
.leadermec-checkout-quote .checkout-header p {
    color: #666;
    font-size: 1rem;
}

/* Hide prices and totals in cart */
.leadermec-cart-quote .product-price,
.leadermec-cart-quote .product-subtotal,
.leadermec-cart-quote .cart_totals,
.leadermec-cart-quote .cart-collaterals,
.leadermec-cart-quote .coupon,
.leadermec-cart-quote .woocommerce-cart-form__coupon {
    display: none !important;
}

/* Hide duplicate checkout content */
body.woocommerce-checkout .woocommerce-checkout:not(.leadermec-quote-checkout),
body.woocommerce-checkout .woocommerce-checkout-review-order-table:not(.leadermec-checkout-quote .woocommerce-checkout-review-order-table),
body.woocommerce-checkout .woocommerce-checkout-payment,
body.woocommerce-checkout .woocommerce-checkout-coupon,
body.woocommerce-checkout .woocommerce-checkout-login {
    display: none !important;
}

/* Style order review table in checkout */
.leadermec-checkout-quote .woocommerce-checkout-review-order-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.leadermec-checkout-quote .woocommerce-checkout-review-order-table thead th {
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    color: #333;
}

.leadermec-checkout-quote .woocommerce-checkout-review-order-table thead th.product-quantity {
    text-align: right;
}

.leadermec-checkout-quote .woocommerce-checkout-review-order-table tbody td {
    padding: 15px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.leadermec-checkout-quote .woocommerce-checkout-review-order-table tbody tr:last-child td {
    border-bottom: none;
}

.leadermec-checkout-quote .woocommerce-checkout-review-order-table .product-info {
    width: 80%;
}

.leadermec-checkout-quote .woocommerce-checkout-review-order-table .product-quantity {
    width: 20%;
    text-align: right;
}

.leadermec-checkout-quote .product-info-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.leadermec-checkout-quote .product-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.leadermec-checkout-quote .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.leadermec-checkout-quote .product-details {
    flex: 1;
}

.leadermec-checkout-quote .product-details .product-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.leadermec-checkout-quote .product-details .product-name a {
    color: #333;
    text-decoration: none;
}

.leadermec-checkout-quote .product-details .product-name a:hover {
    color: #2E36FF;
}

.leadermec-checkout-quote .quantity-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

/* Hide subtotal and total rows if they appear */
.leadermec-checkout-quote .woocommerce-checkout-review-order-table .cart-subtotal,
.leadermec-checkout-quote .woocommerce-checkout-review-order-table .order-total,
.leadermec-checkout-quote .woocommerce-checkout-review-order-table .shipping,
.leadermec-checkout-quote .woocommerce-checkout-review-order-table .tax-rate {
    display: none !important;
}

/* Style for continue button */
.leadermec-cart-quote .cart-actions-bottom {
    margin-top: 30px;
    text-align: center;
    padding: 20px 0;
}

.leadermec-cart-quote .continue-to-checkout {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    background: #2E36FF;
    color: white;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.3s;
}

.leadermec-cart-quote .continue-to-checkout:hover {
    background: #1e25cc;
    color: white;
}

.leadermec-cart-quote .continue-to-checkout i {
    margin-left: 5px;
}

.quote-request-section {
    margin-top: 40px;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.quote-request-section h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333;
}

.quote-request-section p {
    margin-bottom: 20px;
    color: #666;
}

.quote-form .form-group {
    margin-bottom: 20px;
}

.quote-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.quote-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.quote-form textarea:focus {
    outline: none;
    border-color: #2E36FF;
    box-shadow: 0 0 0 2px rgba(46, 54, 255, 0.1);
}

#submit-quote-btn {
    width: 100%;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    background: #2E36FF;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

#submit-quote-btn:hover:not(:disabled) {
    background: #1e25cc;
}

#submit-quote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.quote-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    font-weight: 500;
}

.quote-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.quote-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Checkout Quote Styles */
.leadermec-checkout-quote .checkout-content {
    display: grid;
    gap: 30px;
}

.leadermec-checkout-quote .checkout-section {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.leadermec-checkout-quote .checkout-section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #2E36FF;
    padding-bottom: 10px;
}

.customer-details {
    display: grid;
    gap: 15px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row strong {
    color: #666;
    font-weight: 600;
}

.detail-row span {
    color: #333;
    text-align: right;
}

.edit-link {
    margin-top: 15px;
    text-align: right;
}

.edit-link a {
    color: #2E36FF;
    text-decoration: none;
    font-size: 0.9rem;
}

.edit-link a:hover {
    text-decoration: underline;
}

.checkout-submit {
    text-align: center;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.quote-note {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .leadermec-cart-quote,
    .leadermec-checkout-quote {
        padding: 15px;
    }
    
    .detail-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .detail-row span {
        text-align: left;
    }
}

