/* WooCommerce Quotation Plugin Styles */

/* Add to Quote Button */
.wc-quotation-button-wrapper {
    margin: 10px 0;
}

.wc-quotation-add-button {
    background-color: #0073aa;
    color: white !important;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px !important;
    font-weight: 500 !important;
    text-transform: uppercase;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    line-height: 1.4;
}

.wc-quotation-add-button:hover {
    background-color: #005a87;
    color: white !important;
    text-decoration: none;
}

.wc-quotation-add-button.shop-loop {
    width: 100%;
    margin-top: 10px;
}

.wc-quotation-add-button:disabled {
    background-color: #ccc;
    color: white !important;
    cursor: not-allowed;
}

/* Quotation Widget */
.wc-quotation-widget {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 999999 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.wc-quotation-widget.wc-quotation-empty {
    display: none !important;
}

.wc-quotation-widget-toggle {
    background-color: #0073aa;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.wc-quotation-widget-toggle:hover {
    background-color: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.wc-quotation-icon {
    font-size: 18px;
}

.wc-quotation-text {
    font-weight: 600;
    font-size: 14px;
}

.wc-quotation-count {
    background-color: #ff6b35;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.wc-quotation-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.wc-quotation-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.wc-quotation-widget-content {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 400px;
    max-width: 90vw;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    max-height: 500px;
    overflow: hidden;
}

.wc-quotation-widget-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}

.wc-quotation-widget-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.wc-quotation-widget-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-quotation-widget-close:hover {
    color: #333;
}

.wc-quotation-widget-items {
    max-height: 350px;
    overflow-y: auto;
    padding: 0;
}

.wc-quotation-widget-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
    position: relative;
}

.wc-quotation-widget-item:last-child {
    border-bottom: none;
}

.wc-quotation-widget-item .item-image {
    flex-shrink: 0;
}

.wc-quotation-widget-item .item-image img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.wc-quotation-widget-item .item-details {
    flex: 1;
    min-width: 0;
}

.wc-quotation-widget-item .item-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
}

.wc-quotation-widget-item .item-price {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.wc-quotation-widget-item .item-quantity {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wc-quotation-widget-item .quantity-decrease,
.wc-quotation-widget-item .quantity-increase {
    background-color: #f0f0f0;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #666;
}

.wc-quotation-widget-item .quantity-decrease:hover,
.wc-quotation-widget-item .quantity-increase:hover {
    background-color: #e0e0e0;
    color: #333;
}

.wc-quotation-widget-item .quantity-input {
    width: 40px;
    height: 24px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.wc-quotation-widget-item .item-total {
    font-weight: 600;
    font-size: 14px;
    color: #0073aa;
    margin-right: 8px;
}

.wc-quotation-widget-item .item-remove {
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.wc-quotation-widget-item .item-remove:hover {
    background-color: #ff4444;
    color: white;
}

.wc-quotation-widget-total {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    font-size: 16px;
    text-align: right;
}

.wc-quotation-widget-actions {
    padding: 16px 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #e0e0e0;
}

.wc-quotation-widget-actions .button {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    transition: all 0.2s ease;
}

.wc-quotation-widget-actions .wc-quotation-view-full {
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
}

.wc-quotation-widget-actions .wc-quotation-view-full:hover {
    background-color: #005a87;
    color: white;
    text-decoration: none;
}

.wc-quotation-widget-actions .wc-quotation-clear-all:hover {
    background-color: #ff4444;
    color: white;
    border-color: #ff4444;
}

.wc-quotation-widget-empty {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

/* Quotation Page */
.wc-quotation-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.wc-quotation-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #0073aa;
}

.wc-quotation-header h2 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 28px;
}

.quotation-meta {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 14px;
}

.quotation-number {
    font-weight: 600;
    color: #0073aa;
}

.wc-quotation-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.wc-quotation-table th {
    background-color: #f8f9fa;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.wc-quotation-table td {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.wc-quotation-table .product-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.wc-quotation-table .product-name a {
    font-weight: 600;
    color: #0073aa;
    text-decoration: none;
    font-size: 16px;
}

.wc-quotation-table .product-name a:hover {
    text-decoration: underline;
}

.wc-quotation-table .product-description {
    margin-top: 8px;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.wc-quotation-table .product-sku {
    margin-top: 4px;
}

.wc-quotation-table .product-sku small {
    color: #999;
    font-size: 12px;
}

.wc-quotation-table .product-price {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.quantity-decrease,
.quantity-increase {
    background-color: #f0f0f0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    transition: all 0.2s ease;
}

.quantity-decrease:hover,
.quantity-increase:hover {
    background-color: #0073aa;
    color: white;
}

.quantity-input {
    width: 60px;
    height: 32px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.wc-quotation-table .product-subtotal {
    font-weight: 600;
    font-size: 16px;
    color: #0073aa;
    text-align: right;
}

.remove-item {
    background-color: #ff4444;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-item:hover {
    background-color: #cc0000;
    transform: scale(1.1);
}

.wc-quotation-table tfoot td {
    padding: 8px 10px;
    border-bottom: 1px solid #e0e0e0;
}

.wc-quotation-table tfoot tr:first-child td {
    border-top: 2px solid #0073aa;
    padding-top: 10px;
}

.wc-quotation-table tfoot tr.quotation-subtotal-excl td {
    background-color: #fafafa;
    font-size: 14px;
}

.wc-quotation-table tfoot tr.quotation-vat td {
    background-color: #fafafa;
    font-size: 14px;
}

.wc-quotation-table tfoot tr.quotation-subtotal td {
    background-color: #f0f0f0;
    font-weight: 600;
    font-size: 15px;
}

.wc-quotation-table tfoot tr.quotation-shipping td {
    background-color: #f5f5f5;
    font-size: 14px;
}

.wc-quotation-table tfoot tr.quotation-total td {
    background-color: #0073aa;
    color: white;
    font-size: 18px;
    font-weight: bold;
    padding: 10px;
    border-bottom: none;
}

.wc-quotation-table .total-amount {
    color: #0073aa;
}

.wc-quotation-table tfoot tr.quotation-total .total-amount {
    color: white;
}

.wc-quotation-table tfoot td:last-child {
    text-align: right;
    font-weight: 600;
}

.wc-quotation-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.quotation-actions-top,
.quotation-actions-main {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.quotation-actions-top {
    justify-content: flex-start;
}

.quotation-actions-main {
    justify-content: flex-start;
}

.wc-quotation-actions .button {
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-transform: uppercase;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wc-quotation-actions .button-primary {
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
}

.wc-quotation-actions .button-primary:hover {
    background-color: #005a87;
    color: white;
    text-decoration: none;
}

.wc-quotation-actions .wc-quotation-checkout {
    background-color: #28a745;
    border-color: #28a745;
    font-weight: 600;
}

.wc-quotation-actions .wc-quotation-checkout:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.wc-quotation-actions .wc-quotation-make-payment {
    background-color: #ff6b35;
    border-color: #ff6b35;
    font-weight: 600;
}

.wc-quotation-actions .wc-quotation-make-payment:hover {
    background-color: #e85a28;
    border-color: #d94d1c;
    color: white;
}

.wc-quotation-actions .button-secondary {
    background-color: #666;
    color: white;
    border-color: #666;
}

.wc-quotation-actions .button-secondary:hover {
    background-color: #555;
    color: white;
    text-decoration: none;
}

.wc-quotation-actions .wc-quotation-clear-all:hover {
    background-color: #ff4444;
    color: white;
    border-color: #ff4444;
}

/* Empty Quotation */
.wc-quotation-empty {
    text-align: center;
    padding: 60px 20px;
}

.empty-quotation-message h2 {
    color: #666;
    margin-bottom: 16px;
}

.empty-quotation-message p {
    color: #999;
    margin-bottom: 24px;
    font-size: 16px;
}

/* Modal */
.wc-quotation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-quotation-modal .modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.wc-quotation-modal .modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wc-quotation-modal .modal-header h3 {
    margin: 0;
    color: #333;
}

.wc-quotation-modal .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
}

.wc-quotation-modal .modal-body {
    padding: 20px;
}

.wc-quotation-modal .form-group {
    margin-bottom: 20px;
}

.wc-quotation-modal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.wc-quotation-modal .form-group .required {
    color: #ff4444;
}

.wc-quotation-modal .form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.wc-quotation-modal .form-control:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.wc-quotation-modal .modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Loading */
.wc-quotation-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-quotation-loading .loading-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
}

.wc-quotation-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .wc-quotation-widget-content {
        width: 350px;
    }
    
    .wc-quotation-actions {
        flex-direction: column;
        gap: 16px;
    }
    
    .quotation-actions-top,
    .quotation-actions-main {
        width: 100%;
        flex-direction: column;
    }
    
    .wc-quotation-actions .button {
        width: 100%;
        margin: 0;
    }
    
    .wc-quotation-table {
        font-size: 14px;
    }
    
    .wc-quotation-table th,
    .wc-quotation-table td {
        padding: 12px 8px;
    }
    
    .quotation-meta {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .wc-quotation-widget {
        bottom: 10px;
        right: 10px;
    }
    
    .wc-quotation-widget-content {
        width: calc(100vw - 20px);
        right: -10px;
    }
    
    .wc-quotation-widget-toggle {
        padding: 10px 16px;
    }
    
    .wc-quotation-text {
        display: none;
    }
    
    .wc-quotation-table .product-thumbnail img {
        width: 60px;
        height: 60px;
    }
    
    .quantity-controls {
        flex-direction: column;
        gap: 4px;
    }
    
    .quotation-actions-top,
    .quotation-actions-main {
        flex-direction: column;
    }
}

/* Shipping Section */
.woocommerce-shipping-fields {
    margin-bottom: 30px;
}

.woocommerce-shipping-fields h3 {
    margin-bottom: 20px;
}

#shipping-rates-container {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

#shipping-rates-container h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.shipping-rate-item {
    padding: 15px;
    margin-bottom: 10px;
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.shipping-rate-item:hover {
    border-color: #0073aa;
}

.shipping-rate-item label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    margin: 0;
}

.shipping-rate-item input[type="radio"] {
    margin-right: 12px;
    margin-top: 4px;
}

.shipping-rate-item .rate-details {
    flex: 1;
}

.shipping-rate-item .rate-details strong {
    color: #333;
    font-size: 16px;
}

.shipping-rate-item .rate-details small {
    color: #666;
    display: block;
    margin: 5px 0;
}

.shipping-rate-item .rate-price {
    display: inline-block;
    margin-top: 5px;
    font-size: 18px;
    font-weight: bold;
    color: #0073aa;
}

.shipping-rate-item input[type="radio"]:checked + .rate-details {
    color: #0073aa;
}

.quotation-shipping .shipping-method {
    font-size: 0.9em;
    color: #666;
}
