/**
 * Professional Modern Cart System CSS
 * Premium e-commerce quality interface for SSCI Services
 */

* {
    box-sizing: border-box;
}

.ssci-professional-cart-wrapper {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Header */
.ssci-cart-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.ssci-cart-header h2 {
    font-size: 36px;
    color: #1a1a1a;
    margin: 0 0 10px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.ssci-cart-header .subtitle {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Main Layout */
.ssci-professional-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    align-items: start;
}

/* Services Catalog */
.ssci-services-catalog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.catalog-header {
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.catalog-header h3 {
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 600;
}

.filter-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.search-input,
.category-select {
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    font-size: 13px;
}

.search-input::placeholder {
    color: #999;
}

.search-input:focus,
.category-select:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

#services-container {
    padding: 30px;
    min-height: 400px;
}

/* Service Category */
.service-category {
    margin-bottom: 35px;
}

.service-category:last-child {
    margin-bottom: 0;
}

.category-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

/* Service Card */
.service-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.service-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 10px;
}

.service-card-header h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    flex: 1;
    line-height: 1.3;
}

.service-code {
    display: inline-block;
    background: #f0f4ff;
    color: #667eea;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.service-description {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 15px;
    flex-grow: 1;
}

.service-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.service-price {
    font-size: 14px;
    font-weight: 700;
    color: #667eea;
    white-space: nowrap;
}

.btn-add-service {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.btn-add-service:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-add-service:active {
    transform: translateY(0);
}

/* Right Sidebar */
.ssci-cart-sidebar {
    position: sticky;
    top: 20px;
}

.cart-sticky {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.cart-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.item-badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

/* Cart Items List */
.cart-items-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    min-height: 100px;
    max-height: 300px;
}

.cart-items-list::-webkit-scrollbar {
    width: 6px;
}

.cart-items-list::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.cart-items-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.cart-items-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.empty-cart-message {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #999;
}

.empty-cart-message p {
    margin: 0;
    font-size: 13px;
}

.cart-item {
    padding: 12px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    margin-bottom: 10px;
    background: #fafafa;
    display: grid;
    gap: 8px;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-details strong {
    font-size: 12px;
    color: #1a1a1a;
}

.item-details small {
    font-size: 11px;
    color: #667eea;
    font-weight: 600;
}

.item-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.item-quantity {
    width: 50px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
}

.btn-remove-item {
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: #f56565;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background 0.3s ease;
}

.btn-remove-item:hover {
    background: #e53e3e;
}

.item-total {
    font-weight: 700;
    font-size: 12px;
    color: #667eea;
    text-align: right;
}

/* Cart Summary */
.cart-summary-section {
    padding: 15px;
    background: #f9fafb;
    border-top: 1px solid #f0f0f0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 13px;
    color: #666;
}

.summary-row.total {
    padding: 12px 0;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    border-top: 2px solid #667eea;
    border-bottom: 2px solid #667eea;
    margin: 5px 0;
}

.amount {
    font-weight: 700;
    color: #667eea;
}

.amount.highlight {
    color: #2d3748;
    font-size: 16px;
}

.multiplier {
    background: #f0f4ff;
    color: #667eea;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
}

/* Risk Slider */
.risk-indicator {
    padding: 15px 0;
    margin-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.risk-indicator label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.risk-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #48bb78 0%, #f6ad55 50%, #f56565 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.risk-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.risk-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.risk-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.risk-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.risk-value {
    min-width: 45px;
    text-align: right;
    font-weight: 700;
    color: #667eea;
    font-size: 13px;
}

.risk-indicator small {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 8px;
}

/* Quote Form */
.quote-form {
    padding: 20px;
    border-top: 1px solid #f0f0f0;
}

.form-section {
    margin-bottom: 15px;
}

.form-section label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-section input,
.form-section textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-section input:focus,
.form-section textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-message {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 600;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Buttons */
.btn-submit-quote {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.btn-submit-quote:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-submit-quote:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-clear-cart {
    width: 100%;
    padding: 10px;
    background: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-clear-cart:hover {
    background: #d0d0d0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: #e0e0e0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .ssci-professional-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .ssci-cart-sidebar {
        position: static;
    }

    .cart-sticky {
        max-height: none;
    }

    .category-items {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ssci-professional-cart-wrapper {
        margin: 20px auto;
        padding: 0 10px;
    }

    .ssci-cart-header h2 {
        font-size: 24px;
    }

    .catalog-header {
        padding: 15px;
    }

    .filter-controls {
        grid-template-columns: 1fr;
    }

    #services-container {
        padding: 15px;
    }

    .category-items {
        grid-template-columns: 1fr;
    }

    .service-card {
        padding: 12px;
    }

    .cart-header {
        padding: 15px;
    }

    .quote-form {
        padding: 15px;
    }
}

/* Loading State */
.service-card.loading,
.service-card.loading::after {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .ssci-professional-cart-wrapper {
        background: #1a1a1a;
    }

    .ssci-services-catalog,
    .cart-sticky {
        background: #2d2d2d;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    }

    .service-card {
        background: #3d3d3d;
        border-color: #4d4d4d;
        color: #e0e0e0;
    }

    .service-card:hover {
        border-color: #667eea;
    }

    .category-title,
    .service-card-header h5 {
        color: #e0e0e0;
    }

    .service-description {
        color: #b0b0b0;
    }

    .search-input,
    .category-select {
        background: #3d3d3d;
        color: #e0e0e0;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .form-section input,
    .form-section textarea {
        background: #3d3d3d;
        color: #e0e0e0;
        border-color: #4d4d4d;
    }

    .cart-item {
        background: #3d3d3d;
        border-color: #4d4d4d;
    }

    .cart-summary-section {
        background: #3d3d3d;
        border-top-color: #4d4d4d;
    }

    .emptycart-message {
        color: #999;
    }

    .risk-indicator {
        border-top-color: #4d4d4d;
    }

    .btn-clear-cart {
        background: #4d4d4d;
        color: #e0e0e0;
    }

    .btn-clear-cart:hover {
        background: #5d5d5d;
    }
}
