/* =============================================
   HOMENEEDS E-COMMERCE - MAIN STYLESHEET
   ============================================= */

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

:root {
    --primary-color: #dc2626;
    --secondary-color: #92400e;
    --accent-color: #16a34a;
    --text-color: #1f2937;
    --bg-color: #ffffff;
    --bg-secondary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-color);
    background: var(--bg-color);
    line-height: 1.6;
}

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

/* =============================================
   HEADER
   ============================================= */

.header {
    background: white;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
}

.search-bar {
    flex: 1;
    max-width: 600px;
    display: flex;
    gap: 0.5rem;
}

.search-bar input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.search-bar button {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.25rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.header-btn {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: all 0.3s;
    position: relative;
}

.header-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* =============================================
   CATEGORIES NAVIGATION
   ============================================= */

.categories-nav {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: none;
}

.categories-nav::-webkit-scrollbar {
    display: none;
}

.category-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    white-space: nowrap;
    transition: all 0.3s;
}

.category-nav-item:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.category-icon {
    font-size: 1.25rem;
}

/* =============================================
   HERO SECTION
   ============================================= */

.hero {
    background: linear-gradient(135deg, #dc2626 0%, #92400e 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* =============================================
   BUTTONS
   ============================================= */

.btn-primary {
    padding: 1rem 2rem;
    background: white;
    color: var(--primary-color);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    color: var(--text-color);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s;
}

.btn-full {
    width: 100%;
}

/* =============================================
   SECTIONS
   ============================================= */

.categories-section,
.products-section {
    padding: 3rem 0;
}

.categories-section h2,
.products-section h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.categories-section p,
.products-section p {
    color: #6b7280;
    margin-bottom: 2rem;
}

/* =============================================
   CATEGORIES GRID
   ============================================= */

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

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid var(--border-color);
}

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

.category-icon-large {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.category-card p {
    color: #6b7280;
    font-size: 0.875rem;
}

/* =============================================
   PRODUCTS GRID
   ============================================= */

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

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    border: 2px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow);
}

.product-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.product-badge.sale {
    background: var(--primary-color);
}

.product-badge.new {
    background: var(--accent-color);
}

.product-info {
    padding: 1rem;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-category {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

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

.price-original {
    font-size: 1rem;
    text-decoration: line-through;
    color: #9ca3af;
}

.btn-add-cart {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add-cart:hover {
    background: #991b1b;
}

/* =============================================
   FOOTER
   ============================================= */

.footer {
    background: #1f2937;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col a {
    color: #d1d5db;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
}

.footer-col a:hover {
    color: white;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    color: #9ca3af;
}

/* =============================================
   FLOATING CART
   ============================================= */

.floating-cart {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.3s;
    z-index: 1000;
    text-decoration: none;
}

.floating-cart:hover {
    transform: scale(1.1);
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
    }

    .search-bar {
        order: 3;
        max-width: 100%;
        width: 100%;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .categories-grid,
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* ================================
   PRICE DISPLAY FIX
   Ensures discount rendering styles
================================= */
.price-old{
  text-decoration: line-through;
  color: #9ca3af;
  font-size: 0.95rem;
}

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

/* =============================================
   QUANTITY STEPPER (Add-to-cart +/-) - Modern UI
   ============================================= */

.product-actions{
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Container */
.qty-stepper{
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--primary-color);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Buttons */
.qty-btn{
  width: 38px;
  height: 38px;
  border: none;
  background: var(--primary-color);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.2s ease, transform 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}

.qty-btn:hover{
  filter: brightness(0.92);
}

.qty-btn:active{
  transform: scale(0.92);
}

/* Value */
.qty-val{
  min-width: 44px;
  padding: 0 10px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  background: #fff;
}

/* Small screens - slightly tighter */
@media (max-width: 480px){
  .qty-btn{ width: 34px; height: 34px; font-size: 18px; }
  .qty-val{ min-width: 40px; font-size: 14px; }
}

/* ================================
   PRICE DISPLAY (Current + Old)
   main.js uses .price and .price-old
   ================================ */
.price{
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
}

.price-old{
  font-size: 1rem;
  text-decoration: line-through;
  color: #9ca3af;
}
