/* Cart Container - Responsive to parent container */
.ecs-cart-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

.ecs-cart-title {
    margin: 0 0 20px 0 !important;
    color: inherit !important;
    font-size: inherit !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
    text-align: inherit !important;
}

/* Session Warning */
.ecs-session-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    color: #856404;
}

.ecs-session-warning p {
    margin: 0;
    line-height: 1.5;
}

.ecs-session-warning strong {
    color: #856404;
}

/* Cart Content */
.ecs-cart-content {
    margin-top: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.ecs-cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.ecs-cart-items {
    margin-top: 20px;
}

/* Cart Table - Fully responsive */
.ecs-cart-table {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse;
    margin: 0 !important;
    table-layout: auto !important;
    box-sizing: border-box !important;
}

.ecs-cart-table th,
.ecs-cart-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.ecs-cart-table th {
    background: #fdecd7;
    border: 1px solid #ddd;
    font-weight: bold;
    color: #000;
}

.ecs-cart-table tbody tr {
    background: #F7EAE6 !important;
}

.ecs-cart-table tbody tr:hover {
    background: #f0d5c6 !important;
}

/* Ensure cart table rows have correct background */
.ecs-cart-container .ecs-cart-table tbody tr {
    background-color: #F7EAE6 !important;
}

.ecs-cart-container .ecs-cart-table tbody tr:hover {
    background-color: #f0d5c6 !important;
}

/* Override any conflicting styles */
.ecs-cart-items table tbody tr {
    background-color: #F7EAE6 !important;
}

/* Cart Actions */
.ecs-cart-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    text-align: right;
}

.ecs-cart-actions button {
    margin-left: 10px;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.ecs-submit-rfq {
    background: #28a745;
    color: white;
}

.ecs-submit-rfq:hover {
    background: #218838;
}

.ecs-clear-cart {
    background: #dc3545;
    color: white;
}

.ecs-clear-cart:hover {
    background: #c82333;
}

/* Quantity Input */
.ecs-cart-quantity {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
}

/* Remove Button */
.ecs-cart-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.ecs-cart-remove:hover {
    background: #c82333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ecs-cart-container {
        padding: 15px;
        margin: 10px;
    }
    
    .ecs-cart-table {
        font-size: 14px;
    }
    
    .ecs-cart-table th,
    .ecs-cart-table td {
        padding: 8px;
    }
    
    .ecs-cart-actions {
        text-align: center;
    }
    
    .ecs-cart-actions button {
        display: block;
        width: 100%;
        margin: 5px 0;
    }
}

/* RFQ Column Styles - Flexible width */
.ecs-rfq-cell {
    text-align: center;
    vertical-align: middle;
    width: auto !important;
    min-width: 120px !important;
    white-space: nowrap;
}

.ecs-rfq-checkbox {
    margin: 0;
    cursor: pointer;
    transform: scale(1.2);
}

.ecs-quantity-controls {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 5px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.ecs-quantity-btn {
    background: #007cba;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.ecs-quantity-btn:hover {
    background: #005a87;
}

.ecs-quantity-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.25);
}

.ecs-quantity-input {
    width: 50px;
    padding: 4px 6px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: center;
    font-size: 12px;
}

.ecs-quantity-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.25);
}

/* Animation for quantity controls */
.ecs-quantity-controls {
    transition: all 0.3s ease;
}

.ecs-quantity-controls:not(:empty) {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* New Cart Layout Styles */
.ecs-cart-quantity-cell {
    text-align: center;
    vertical-align: middle;
    width: 160px;
}

.ecs-cart-quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ecs-cart-quantity-btn {
    background: #fff;
    color: #000;
    border: 1px solid #ddd;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    user-select: none;
}

.ecs-cart-quantity-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    transform: scale(1.05);
}

.ecs-cart-quantity-btn:active {
    transform: scale(0.95);
}

.ecs-cart-quantity-input {
    width: 50px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    background: #FFFFFF !important;
}

.ecs-cart-quantity-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.25);
}

.ecs-cart-remove-cell {
    text-align: center;
    vertical-align: middle;
    width: 60px;
}

.ecs-cart-remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.ecs-cart-remove-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.ecs-cart-remove-btn:active {
    transform: scale(0.9);
}

/* WordPress Block Editor and Page Builder Compatibility */
.wp-block .ecs-cart-container,
.vc_row .ecs-cart-container,
.vc_column .ecs-cart-container,
.vc_column_container .ecs-cart-container,
.wpb_column .ecs-cart-container,
.elementor-widget .ecs-cart-container,
.et_pb_module .ecs-cart-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

/* WPBakery specific table fixes */
.vc_row .ecs-cart-table,
.vc_column .ecs-cart-table,
.wpb_column .ecs-cart-table,
.vc_column_container .ecs-cart-table {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    table-layout: auto !important;
}

/* Fix potential WPBakery column width issues */
.vc_col-sm-12 .ecs-cart-container,
.vc_col-md-12 .ecs-cart-container,
.vc_col-lg-12 .ecs-cart-container {
    width: 100% !important;
    max-width: 100% !important;
}

/* Ensure no conflicting margins/padding from page builders */
.vc_row .ecs-cart-title,
.vc_column .ecs-cart-title,
.wpb_column .ecs-cart-title {
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
}

/* RfQ Icon Badge System */
.ecs-rfq-icon-container {
    position: relative;
    display: inline-block;
}

.ecs-rfq-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #fff;
    color: #000;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1000;
    line-height: 1;
    padding: 2px;
    box-sizing: border-box;
}

.ecs-rfq-badge.hidden {
    display: none;
}

/* Ensure badge shows above other elements */
.ecs-rfq-icon-container:hover .ecs-rfq-badge {
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

/* Cart Data Holder for Gravity Forms Integration */
#ecs-cart-data-holder {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
} 