/* Reset and Global Styles */
:root {
    --primary-color: #ff4757;
    --secondary-color: #2c3e50;
    --accent-color: #ff4757;
    --body-bg: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-radius: 12px;
    --transition: 0.3s;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--body-bg); color: var(--text-color); line-height: 1.6; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* Header & Navbar */
header { background: var(--card-bg); box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1000; }
.navbar { padding: 15px 0; border-bottom: 1px solid #eee; }
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 24px; font-weight: 700; color: var(--secondary-color); }
.logo span { color: var(--primary-color); }
.search-bar { flex-grow: 1; max-width: 500px; margin: 0 30px; position: relative; display: flex; }
.search-results { 
    position: absolute; top: 100%; left: 0; width: 100%; background: var(--card-bg); 
    border: 1px solid #ddd; border-top: none; border-radius: 0 0 var(--border-radius) var(--border-radius); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); z-index: 2000; 
    display: none; max-height: 400px; overflow-y: auto;
}
.search-result-item { 
    display: flex; align-items: center; gap: 15px; padding: 10px 15px; 
    border-bottom: 1px solid #f0f0f0; transition: var(--transition); cursor: pointer;
}
.search-result-item:hover { background: #f9f9f9; }
.search-result-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
.search-result-item .name { font-size: 14px; font-weight: 500; }
.search-result-item .price { font-size: 13px; color: var(--primary-color); font-weight: 700; }
.search-bar input { width: 100%; padding: 10px 15px; border: 2px solid var(--primary-color); border-radius: 25px 0 0 25px; outline: none; }
.search-bar button { padding: 10px 20px; background: var(--primary-color); color: white; border: none; border-radius: 0 25px 25px 0; cursor: pointer; font-size: 16px; }
.nav-icons { display: flex; align-items: center; gap: 20px; }
.nav-icons a { font-size: 18px; color: #555; display: flex; align-items: center; gap: 5px; }
.nav-icons a span { font-size: 14px; font-weight: 500; }
.cart-icon { position: relative; }
#cart-count { position: absolute; top: -8px; right: -8px; background: var(--primary-color); color: white; font-size: 10px; padding: 2px 6px; border-radius: 50%; font-weight: 700; }

.category-nav { background: var(--card-bg); padding: 10px 0; }
.category-nav ul { display: flex; overflow-x: auto; gap: 25px; white-space: nowrap; }
.category-nav ul li a { font-size: 14px; font-weight: 500; color: #666; }
.category-nav ul li a:hover { color: var(--primary-color); }

/* Hero / Banners */
.hero { margin: 20px auto; position: relative; }
.banner-slider { height: 400px; border-radius: var(--border-radius); overflow: hidden; background: #ddd; position: relative; }
.banner-item { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.8s ease-in-out; }
.banner-item.active { opacity: 1; z-index: 10; }
.banner-item img { width: 100%; height: 100%; object-fit: cover; }

.slider-btn { 
    position: absolute; top: 50%; transform: translateY(-50%); 
    background: rgba(255,255,255,0.7); color: #333; width: 45px; height: 45px; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center; 
    cursor: pointer; z-index: 20; transition: var(--transition); border: none; font-size: 18px;
}
.slider-btn:hover { background: #fff; color: var(--primary-color); }
.prev-btn { left: 20px; }
.next-btn { right: 20px; }

/* Section Titles */
.section-title { display: flex; justify-content: space-between; align-items: center; margin: 40px 0 20px; }
.section-title h2 { font-size: 22px; font-weight: 700; color: var(--secondary-color); }
.section-title a { color: var(--primary-color); font-weight: 600; font-size: 14px; }

/* Category Grid */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; }
.category-card { background: var(--card-bg); padding: 20px; border-radius: 10px; text-align: center; transition: var(--transition); border: 1px solid transparent; }
.category-card:hover { border-color: var(--primary-color); box-shadow: 0 5px 15px rgba(255,71,87,0.1); transform: translateY(-3px); }
.category-card img { width: 80px; height: 80px; object-fit: contain; margin-bottom: 15px; }
.category-card h3 { font-size: 15px; font-weight: 600; }

/* Product Grid & Cards */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.product-card { background: var(--card-bg); border-radius: 10px; overflow: hidden; transition: var(--transition); position: relative; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.product-image { height: 220px; background: #f8f9fa; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.product-image img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.product-card:hover .product-image img { transform: scale(1.1); }
.product-info { padding: 15px; }
.product-cat { font-size: 12px; color: #999; margin-bottom: 5px; display: block; }
.product-name { font-size: 15px; font-weight: 600; color: var(--secondary-color); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 42px; }
.product-price { display: flex; align-items: center; gap: 10px; }
.price-main { font-size: 18px; font-weight: 700; color: var(--primary-color); }
.price-old { font-size: 14px; color: #999; text-decoration: line-through; }
.add-to-cart { position: absolute; bottom: 15px; right: 15px; background: var(--secondary-color); color: white; width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); border: none; }
.add-to-cart:hover { background: var(--primary-color); transform: rotate(90deg); }

/* Out of Stock UI */
.out-of-stock-card { opacity: 0.8; }
.stock-badge { 
    position: absolute; top: 10px; left: 10px; 
    background: #e74c3c; color: white; padding: 4px 10px; 
    border-radius: 4px; font-size: 11px; font-weight: 700; z-index: 5;
}
.product-stock.out-of-stock { color: #e74c3c; font-weight: 700; }

/* Footer */
footer { background: var(--secondary-color); color: #fff; padding: 60px 0 30px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 40px; }
.footer-col h3 { font-size: 18px; margin-bottom: 25px; }
.footer-col p { color: #bdc3c7; font-size: 14px; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul li a { color: #bdc3c7; font-size: 14px; }
.footer-col ul li a:hover { color: #fff; padding-left: 5px; }
.footer-bottom { border-top: 1px solid #34495e; margin-top: 40px; padding-top: 20px; text-align: center; color: #bdc3c7; font-size: 14px; }

/* Responsive */
.disflex { display: flex; gap: 20px; }
.disflex > div { flex: 1; }
.hidden { display: none; }

@media (max-width: 992px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .search-bar { margin: 0 15px; }
}
@media (max-width: 768px) {
    .search-bar { display: none; }
    .banner-slider { height: 250px; }
}
