:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --light: #f9fafb;
    --border: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: white;
    padding: 1rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo:before {
    content: "🛒";
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 3rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.95;
}

/* Search Container */
.search-container {
    max-width: 700px;
    margin: 0 auto 3rem;
}

.search-form {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

#searchQuery {
    width: 100%;
    padding: 1.25rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    transition: border-color 0.3s;
}

#searchQuery:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-primary {
    width: 100%;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Loading Animation */
.loading-container {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.loading-spinner {
    border: 5px solid var(--border);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results */
.results-wrapper {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
}

.results-header {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 2rem;
    text-align: center;
    border-bottom: 2px solid var(--border);
}

.results-header h2 {
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.results-header p {
    color: #6b7280;
    font-size: 0.95rem;
}

.results-content {
    padding: 2rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

.results-content h2 {
    color: var(--primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.results-content h3 {
    color: var(--dark);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.results-content p {
    margin-bottom: 1rem;
    color: #374151;
}

.results-content strong {
    color: var(--primary);
    font-weight: 600;
}

.results-content a.product-link-inline {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin: 0.5rem 0.5rem 0.5rem 0;
    transition: transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.results-content a.product-link-inline:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.results-footer {
    background: #fffbeb;
    padding: 1.5rem;
    text-align: center;
    color: #92400e;
    border-top: 2px solid var(--warning);
}

/* Error Container */
.error-container {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.error-container h3 {
    color: var(--danger);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.error-container p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.retry-btn {
    padding: 0.75rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.retry-btn:hover {
    background: var(--primary-dark);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    background: var(--dark);
    color: white;
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .results-content {
        padding: 1.5rem;
        font-size: 1rem;
    }
}