/* ==========================================================================
   AX Woo Quotes Frontend Styles
   ========================================================================== */

/* Quote Form Styles */
.ax-quote-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.ax-quote-form .quote-form-title {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.ax-quote-form .form-row {
    margin-bottom: 15px;
    clear: both;
}

.ax-quote-form .form-row-first {
    float: left;
    width: 48%;
    margin-right: 4%;
}

.ax-quote-form .form-row-last {
    float: right;
    width: 48%;
}

.ax-quote-form .form-row-wide {
    width: 100%;
}

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

.ax-quote-form .required {
    color: #e74c3c;
}

.ax-quote-form .input-text,
.ax-quote-form .select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.ax-quote-form .input-text:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.ax-quote-form .quote-submit-button {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Cart Summary in Quote Form */
.ax-quote-cart-summary {
    background: #fff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.ax-quote-cart-summary h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.cart-items-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-item-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.cart-item-preview img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-preview .item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cart-item-preview .item-name {
    font-weight: 600;
    color: #333;
}

.cart-item-preview .item-quantity {
    color: #666;
    font-size: 14px;
}

.cart-item-preview .item-price {
    color: #0073aa;
    font-weight: 600;
}

.cart-total-preview {
    text-align: right;
    padding: 10px;
    background: #e8f4f8;
    border-radius: 4px;
    margin-top: 10px;
}

/* Quote List Styles */
.ax-quote-list,
.ax-my-quotes {
    width: 100%;
}

.ax-quotes-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.ax-quotes-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ax-quotes-table th,
.ax-quotes-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.ax-quotes-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.ax-quotes-table tbody tr:hover {
    background: #f8f9fa;
}

.ax-quotes-table .quote-link {
    color: #0073aa;
    font-weight: 600;
    text-decoration: none;
}

.ax-quotes-table .quote-link:hover {
    text-decoration: underline;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-quote-pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-badge.status-quote-approved {
    background: #d4edda;
    color: #155724;
    border: 1px solid #b8daff;
}

.status-badge.status-quote-rejected {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* My Quotes Grid */
.ax-my-quotes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.ax-quote-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s ease;
}

.ax-quote-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.ax-quote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.ax-quote-header .quote-title {
    margin: 0;
    font-size: 18px;
}

.ax-quote-header .quote-title a {
    color: #333;
    text-decoration: none;
}

.ax-quote-header .quote-title a:hover {
    color: #0073aa;
}

.ax-quote-header .quote-date {
    color: #666;
    font-size: 14px;
}

.ax-quote-status {
    margin-bottom: 15px;
}

.ax-quote-status .status-label {
    font-weight: 600;
    color: #333;
}

.ax-quote-details {
    margin-bottom: 15px;
}

.ax-quote-items {
    margin-bottom: 10px;
}

.quote-items-list {
    list-style: none;
    padding: 0;
    margin: 5px 0 0 0;
}

.quote-items-list li {
    padding: 2px 0;
    color: #666;
    font-size: 14px;
}

.quote-items-list .more-items {
    font-style: italic;
    color: #999;
}

.ax-quote-total {
    text-align: right;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.ax-quote-total .total-amount {
    color: #0073aa;
    font-size: 18px;
}

.ax-quote-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ax-quote-actions .button {
    flex: 1;
    text-align: center;
    min-width: 100px;
}

/* Quote Cart Styles */
.ax-quote-cart {
    width: 100%;
}

.ax-quote-cart-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.ax-quote-cart-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ax-quote-cart-table th,
.ax-quote-cart-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.ax-quote-cart-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.ax-quote-cart-table .product-image {
    width: 80px;
}

.ax-quote-cart-table .product-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.ax-quote-cart-table .product-name {
    min-width: 200px;
}

.ax-quote-cart-table .product-link {
    color: #333;
    text-decoration: none;
    font-weight: 600;
}

.ax-quote-cart-table .product-link:hover {
    color: #0073aa;
}

.ax-quote-cart-table .product-variations,
.ax-quote-cart-table .product-sku {
    margin-top: 5px;
}

.ax-quote-cart-table .product-variations small,
.ax-quote-cart-table .product-sku small {
    color: #666;
    display: block;
    line-height: 1.4;
}

.ax-quote-cart-table .product-quantity {
    width: 100px;
}

.ax-quote-cart-table .quantity input {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
}

.ax-quote-cart-table .product-actions {
    width: 50px;
    text-align: center;
}

.ax-quote-cart-table .remove-item {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 18px;
    text-align: center;
    background: #e74c3c;
    color: #fff;
    text-decoration: none;
    border-radius: 50%;
    font-weight: bold;
}

.ax-quote-cart-table .remove-item:hover {
    background: #c0392b;
    color: #fff;
}

.ax-quote-cart-table tfoot td {
    background: #f8f9fa;
    font-weight: 600;
}

.ax-quote-cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    flex-wrap: wrap;
    gap: 15px;
}

.ax-quote-cart-summary .cart-summary {
    margin: 0;
    color: #333;
    font-weight: 600;
}

.cart-actions {
    display: flex;
    gap: 10px;
}

/* Empty States */
.ax-quotes-empty {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.ax-quotes-empty p {
    color: #666;
    font-size: 16px;
    margin-bottom: 20px;
}

/* Loading States */
.quote-form-loading {
    text-align: center;
    padding: 10px;
    color: #666;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .ax-quote-form .form-row-first,
    .ax-quote-form .form-row-last {
        float: none;
        width: 100%;
        margin-right: 0;
    }
    
    .ax-quotes-table,
    .ax-quote-cart-table {
        font-size: 14px;
    }
    
    .ax-quotes-table th,
    .ax-quotes-table td,
    .ax-quote-cart-table th,
    .ax-quote-cart-table td {
        padding: 8px 10px;
    }
    
    .ax-my-quotes-grid {
        grid-template-columns: 1fr;
    }
    
    .ax-quote-actions {
        flex-direction: column;
    }
    
    .ax-quote-cart-summary {
        flex-direction: column;
        text-align: center;
    }
    
    /* Mobile table layout for quote tables */
    .ax-quotes-table,
    .ax-quote-cart-table {
        border: 0;
    }
    
    .ax-quotes-table thead,
    .ax-quote-cart-table thead {
        display: none;
    }
    
    .ax-quotes-table tr,
    .ax-quote-cart-table tr {
        border: 1px solid #ddd;
        display: block;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 4px;
        background: #fff;
    }
    
    .ax-quotes-table td,
    .ax-quote-cart-table td {
        border: none;
        display: block;
        text-align: right;
        padding: 5px 0;
        border-bottom: 1px solid #eee;
    }
    
    .ax-quotes-table td:last-child,
    .ax-quote-cart-table td:last-child {
        border-bottom: none;
    }
    
    .ax-quotes-table td:before,
    .ax-quote-cart-table td:before {
        content: attr(data-label) ": ";
        float: left;
        font-weight: 600;
        color: #333;
    }
}

/* Quote Button Styles */
.ax-quote-button,
.ax-product-quote-button,
.ax-loop-quote-button {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.ax-quote-button:hover,
.ax-product-quote-button:hover,
.ax-loop-quote-button:hover {
    background: #005a87;
    color: #fff;
}

/* Modal Styles */
.ax-quote-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.ax-quote-modal-content {
    background: #fff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.ax-quote-modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.ax-quote-modal-close:hover {
    color: #000;
}

/* Notices */
.quote-form-notices {
    margin-top: 15px;
}

.quote-form-notices .notice {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 10px;
}

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

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

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-0 { margin-bottom: 0; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }

.mt-0 { margin-top: 0; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }