:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --border: #334155;
    --font-main: 'Outfit', sans-serif;
}

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

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

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

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.highlight {
    color: var(--accent);
}

.search-bar {
    display: flex;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 16px;
    width: 100%;
    max-width: 500px;
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 1rem;
    outline: none;
    font-family: var(--font-main);
}

.search-bar button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.search-bar button:hover {
    color: var(--accent);
}

/* Stats */
.stats-bar {
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    border-color: var(--accent);
}

.card-image {
    height: 200px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.brand {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.model {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 15px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.price-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stock {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    display: inline-block;
    margin-top: 10px;
}

.stock.low {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
    padding-bottom: 40px;
}

.page-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    padding: 15px 20px;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border);
}

.modal-body {
    display: flex;
    padding: 30px;
    gap: 30px;
}

.modal-image {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    max-height: 400px;
}

.modal-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-info {
    flex: 1;
}

.info-row {
    margin-bottom: 10px;
    font-size: 1rem;
    color: var(--text-primary);
}

.info-row strong {
    color: var(--text-secondary);
    width: 120px;
    display: inline-block;
}

@media (max-width: 768px) {
    .modal-body {
        flex-direction: column;
    }

    .modal-image {
        max-height: 250px;
    }
}