* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6500;
    --secondary-color: #1a1a1a;
    --background-color: #f5f5f5;
    --card-background: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: var(--secondary-color);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo i {
    margin-right: 10px;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.3s;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--primary-color);
}

/* Main Content */
.main-content {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h2 {
    font-size: 32px;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.page-header p {
    color: var(--text-light);
    font-size: 18px;
}

/* Build Container */
.build-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
}

/* Categories List */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.category-section {
    background: var(--card-background);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.category-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--secondary-color);
}

.category-title i {
    margin-right: 10px;
    color: var(--primary-color);
}

.product-count {
    background-color: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.product-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.product-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.product-card.selected {
    border-color: var(--primary-color);
    background-color: #fff5f0;
}

.product-image {
    width: 100%;
    height: 180px;
    object-fit: contain;
    margin-bottom: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-brand {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.product-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
}

.product-select-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.product-card.selected .product-select-badge {
    display: flex;
}

/* Summary Panel */
.summary-panel {
    background: var(--card-background);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 20px;
    height: fit-content;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.summary-header h3 {
    font-size: 22px;
    color: var(--secondary-color);
}

.btn-clear {
    background: none;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-clear:hover {
    background-color: var(--danger-color);
    color: white;
}

.summary-items {
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.empty-message {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border-left: 3px solid var(--primary-color);
}

.summary-item-info {
    flex: 1;
}

.summary-item-category {
    font-size: 11px;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 3px;
}

.summary-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 3px;
}

.summary-item-price {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: bold;
}

.summary-item-remove {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 5px 10px;
    font-size: 18px;
    transition: transform 0.2s;
}

.summary-item-remove:hover {
    transform: scale(1.2);
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: bold;
}

.total-price {
    color: var(--primary-color);
    font-size: 24px;
}

.btn-generate-pdf {
    width: 100%;
    padding: 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-generate-pdf:hover {
    background-color: #e55a00;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-generate-pdf i {
    margin-right: 10px;
}

/* Footer */
.footer {
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 1024px) {
    .build-container {
        grid-template-columns: 1fr;
    }

    .summary-panel {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .product-image {
        height: 120px;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.loading i {
    font-size: 48px;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
}

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