:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #10b981;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
}

/* --- Layout --- */
header {
    background-color: var(--card-bg);
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.mobile-cart-trigger {
    display: none; /* Hidden on desktop */
    background-color: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    align-items: center;
    gap: 8px;
}

.badge {
    background-color: #ef4444;
    color: white;
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 50%;
    font-weight: bold;
}

/* Main Grid Layout */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 350px; /* Content + Fixed Sidebar Width */
    gap: 20px;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
    align-items: start; /* Prevents sidebar from stretching if content is short */
}

/* --- Tabs --- */
.tabs-header {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: -2px; /* Overlap border */
    scrollbar-width: none; 
}
.tabs-header::-webkit-scrollbar { display: none; }

.tab-btn {
    background: #e5e7eb;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--primary);
    background-color: white;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}

.tab-content {
    background-color: white;
    padding: 2rem;
    border-radius: 0 8px 8px 8px; /* Top left square for tab connection */
    box-shadow: var(--shadow);
    min-height: 600px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Forms --- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.full-width {
    grid-column: 1 / -1;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}
.checkbox-group input { width: 20px; height: 20px; }

label { font-weight: 600; font-size: 0.9rem; }
input, select, textarea {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--primary);
    border-color: transparent;
}

/* --- Services List (ROWS) --- */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.service-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    gap: 1rem;
    transition: border-color 0.2s;
}

.service-row:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.service-info {
    flex: 1;
}

.service-title {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.service-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.service-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 220px; /* Ensure space for price, qty and btn */
    justify-content: flex-end;
}

.service-price {
    font-weight: bold;
    color: var(--text-main);
    font-size: 1.1rem;
    min-width: 70px;
    text-align: right;
}

/* Qty Controls */
.qty-control {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 6px;
    padding: 2px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.qty-input {
    width: 35px;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0;
}

.btn-small {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-small:hover { background-color: var(--primary-dark); }

.section-header {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: bold;
}

/* --- Sidebar Cart --- */
.sidebar-area {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    position: sticky;
    top: 90px; /* Offset from header */
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

.cart-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    /* Custom Scrollbar for inner cart */
    scrollbar-width: thin;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: start;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 0.5rem;
}

.item-info h4 { font-size: 0.9rem; margin-bottom: 4px; }
.item-info p { font-size: 0.75rem; color: var(--text-muted); }

.item-remove {
    color: #ef4444;
    background: none;
    border: none;
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: underline;
    margin-left: 10px;
}

.cart-footer {
    border-top: 2px solid #e5e7eb;
    padding-top: 1rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.checkout-btn, .add-btn {
    width: 100%;
    background-color: var(--secondary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.1s;
}
.checkout-btn:hover, .add-btn:hover { transform: scale(1.02); }

.price-preview {
    background-color: #eff6ff;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin-top: 1rem;
    border: 1px solid #bfdbfe;
}
.price-display {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    margin: 0.5rem 0;
}

/* --- Mobile Responsive --- */
@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr; /* Stack vertically */
    }

    .mobile-cart-trigger {
        display: flex;
    }

    .sidebar-area {
        position: static; /* No sticky on mobile usually, or bottom */
        order: 2; /* Cart below content */
        max-height: none;
    }

    .service-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .service-actions {
        width: 100%;
        justify-content: space-between;
        margin-top: 1rem;
    }
}