:root {
    --primary: #ff5722;
    --primary-hover: #e64a19;
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
}

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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

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

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    background: linear-gradient(135deg, #ff5722, #ff9800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-content {
    flex: 1;
    padding: 60px 0;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 620px;
    margin: 0 auto 32px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.5);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
}

.search-bar input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 16px;
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar button,
.search-bar .clear-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.search-bar button {
    background: linear-gradient(135deg, #ff5722, #f44336);
    color: white;
    padding: 10px 20px;
}

.search-bar .clear-search {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text);
    padding: 10px 16px;
    border: 1px solid var(--border);
}

.search-bar button:hover,
.search-bar .clear-search:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.hero {
    text-align: center;
    margin-bottom: 60px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.product-card {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    position: relative;
    group: hover;
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-color: var(--primary);
}

.product-image-container {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
    background: #2a3441;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.product-card:hover .product-image-container img {
    transform: scale(1.1);
}

.placeholder-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2a3441, #1e293b);
    color: var(--text-muted);
    font-size: 48px;
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-name {
    font-size: 16px;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.product-bottom {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

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

.product-price small {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

.btn-buy {
    background: linear-gradient(135deg, #ff5722, #f44336);
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.product-card:hover .btn-buy {
    opacity: 1;
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.4);
}

footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid var(--border);
    margin-top: auto;
    color: var(--text-muted);
    font-size: 14px;
}

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

.product-card {
    animation: fadeIn 0.6s ease forwards;
}

/* Add stagger delay for grid items */
.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }
.product-card:nth-child(7) { animation-delay: 0.7s; }
.product-card:nth-child(8) { animation-delay: 0.8s; }

/* RWD Media Queries */
/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.page-link:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.page-link.active {
    background: linear-gradient(135deg, #ff5722, #f44336);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.4);
}

.page-dots {
    color: var(--text-muted);
    font-weight: 500;
    margin: 0 4px;
}

/* RWD Media Queries */
@media (max-width: 768px) {
    .hero h1 { font-size: 32px; }
    .hero p { font-size: 16px; padding: 0 15px; }
    .main-content { padding: 30px 0; }
    .search-bar { max-width: 100%; margin-bottom: 24px; }
    .search-bar { flex-wrap: wrap; border-radius: 18px; }
    .search-bar input { width: 100%; }
    .product-grid { gap: 20px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .product-name { font-size: 14px; }
    .product-price { font-size: 18px; }
    .btn-buy { padding: 6px 12px; font-size: 12px; }
    .product-info { padding: 15px; }
    .placeholder-img { font-size: 32px; }
}

@media (max-width: 480px) {
    .header-content { flex-direction: column; gap: 10px; text-align: center; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; }
}

