/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: hsl(16, 90%, 55%);
    --primary-dark: hsl(16, 90%, 45%);
    --secondary: hsl(174, 62%, 47%);
    --background: hsl(0, 0%, 98%);
    --foreground: hsl(222, 47%, 11%);
    --card: hsl(0, 0%, 100%);
    --border: hsl(214, 32%, 91%);
    --muted: hsl(210, 40%, 96%);
    --muted-foreground: hsl(215, 16%, 47%);
    --success: hsl(142, 71%, 45%);
    --warning: hsl(38, 92%, 50%);
    --destructive: hsl(0, 84%, 60%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--foreground);
    line-height: 1.6;
}


.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

a {
    text-decoration: none;
    color: inherit;
}


.toast{
    position: fixed;
    top:20px;
    right:20px;
    padding:6px 16px;
    border-radius:6px;
    color:#fff;
    font-size:14px;
    opacity:0;
    transform:translateY(-10px);
    transition:all .3s ease;
    z-index:9999;
}

.toast.show{
    opacity:1;
    transform:translateY(0);
}

.toast-success{
    background:#22c55e;
}

.toast-error{
    background:#ef4444;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* Header Styles */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.top-bar {
    background: var(--primary);
    color: #fff;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    margin-bottom: 10px;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-links {
    display: flex;
    gap: 1rem;
}

.top-links a:hover {
    text-decoration: underline;
}

.main-header {
    padding: 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.logo-icon {
    width: 2rem;
    height: 2rem;
}

.search-bar {
    flex: 1;
    max-width: 42rem;
    position: relative;
    margin-bottom: 10px;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
}

.search-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    padding: 0 1rem;
    background: var(--primary);
    color: white;
    border-radius: 0 0.5rem 0.5rem 0;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    position: relative;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.action-btn:hover {
    background: var(--muted);
}

.icon {
    width: 1.25rem;
    height: 1.25rem;
}

.badge {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    background: var(--primary);
    color: white;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.nav {
    background: var(--muted);
    border-top: 1px solid var(--border);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
    overflow-x: auto;
}

.nav-links a {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    transition: background 0.2s;
}

.nav-links a:hover {
    background: var(--card);
}

/* Note the space or the combined selector for the 'a' tag */
.nav-links a.active {
    background: var(--card);
    /* Adding a border or bolder text helps users see where they are */
    font-weight: 600; 
}

.nav-links a.flash-sale {
    color: var(--primary);
    font-weight: 600;
}

/* Hero Slider */
.hero-slider {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.slider-container {
    height: 100%;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s;
}

.slide.active {
    opacity: 1;
}

.slide-content {
    height: 100%;
    display: flex;
    align-items: center;
    color: white;
    padding: 0 4rem;
}

.slide-text {
    max-width: 36rem;
}

.slide-text h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.slide-text p {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.btn-primary {
    background: white;
    color: var(--primary);
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.slider-btn:hover {
    transform: translateY(-50%) scale(1.1);
}

.slider-btn.prev {
    left: 1rem;
}

.slider-btn.next {
    right: 1rem;
}

.slider-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active {
    width: 2rem;
    background: white;
}


.btn-outline {
    padding: 0.5rem 1.5rem;
    border: none;
    transition: all 0.2s;
}

.btn-outline:hover {
    color: var(--primary);
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.category-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
    opacity: 0;
    animation: fadeInUp 0.6s forwards;
}

.category-card:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}


/* Benefits Section */
.benefits {
    background: var(--card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 3rem 0;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.benefit-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.benefit-item h3 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.benefit-item p {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* Footer */
.footer {
    background-color: #2C3E50;
    border-top: 1px solid var(--border);
    padding: 3rem 1rem 1rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: white;
}

.footer-col p {
    color: white;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: #ccc;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.social-links a {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.social-links a:hover {
    background: var(--primary);
    color: white;
}

.payment-methods {
    margin-top: 1.5rem;
}

.payment-methods h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: white;
    font-weight: bold;
}

.payment-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.payment-badges span {
    padding: 0.375rem 0.75rem;
    background: var(--muted);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .search-bar {
        order: 3;
        width: 100%;
        margin-top: 1rem;
    }
    
    .slide-text h1 {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

.sell-btn {
    background-color: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.delivery-btn {
    background-color: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background-color 0.2s;
}



/* ===== Newsletter Section ===== */
.newsletter-section {
  background: #f9f9f9;
  padding: 40px 20px;
  text-align: center;
  border-radius: 10px;
  max-width: 600px;
  margin: 40px auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  font-family: Arial, sans-serif;
}

.newsletter-section h2 {
  font-size: 24px;
  margin-bottom: 20px;
  color: #333;
}

/* Form layout */
.newsletter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  align-items: center;
}

.newsletter input,
.newsletter select {
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 14px;
  flex: 1 1 200px;
  min-width: 150px;
  transition: border-color 0.3s;
}

.newsletter input:focus,
.newsletter select:focus {
  border-color: #ff7800;
  outline: none;
}

.newsletter button {
  padding: 12px 25px;
  background: #ff7800;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.newsletter button:hover {
  background: #e66d00;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Success/Error messages */
.newsletter-message {
  width: 100%;
  margin-top: 15px;
  font-size: 14px;
  color: #fff;
  padding: 10px;
  border-radius: 5px;
  display: none;
}

.newsletter-message.success {
  background: #28a745;
}

.newsletter-message.error {
  background: #dc3545;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .newsletter-section {
        padding: 0 20px;
        border-radius: 10px;
        margin: 30px auto;
    }

    .benefits-grid {
        row-gap: 1rem;
    }

    /*HEADER ADJUSTMENT*/
    .top-bar{
        font-size: 13px;
        padding: 0.7rem 0.2rem;
    }

    .header-content{
        row-gap: 0.1rem;
        column-gap: 1.5rem;
    }
    .location{
        gap: 0.3rem;
    }
    .logo-icon{
        width: 1.5rem;
        height: 1.5rem;
    }
}

/* 1. Hide Hamburger by default (Desktop) */
.menu-toggle {
    display: none;
}

/* Keep Desktop exactly as it is in your image */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}


.nav-links a {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    transition: background 0.2s;
}




/* Drawer base */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background: #fff;
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* When open */
.mobile-drawer.active {
    transform: translateX(0);
}

/* Overlay */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Drawer header */
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    font-weight: 600;
    border-bottom: 1px solid #eee;
}

.drawer-links {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 0.75rem;
}

.drawer-links a {
    display: flex;
    align-items: center;
    gap: 12px;

    text-decoration: none;
    color: #111;
    padding: 0.6rem;
    border-radius: 0.375rem;
    font-size: 15px;
}



.drawer-links a:hover i {
    color: #000;
}

.drawer-close {
    cursor: pointer;
    font-weight: 600;
    background-color: var(--muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.drawer-links a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    color: #555;
}


/* Mobile Adjustments */
@media (max-width: 768px) {

    .desktop-only {
        display: none;
    }   
    .header-content {
        flex-wrap: wrap; /* Allows search bar to move to a new line */
        padding: 0 10px 10px;
        gap: 0.5rem;
    }

    /* 1. Force the Logo and Hamburger to the left */
    .menu-toggle {
        display: block;
        order: 1;
    }

    .logo {
        order: 2;
        margin-right: auto; /* Pushes the actions to the far right */
        font-size: 1.3rem; 
    }

    /* 2. Force Actions (Wishlist/Cart) to the right */
    .header-actions {
        order: 3;
        display: flex;
        gap: 10px;
        align-items: center;
    }

    /* 3. Force Search Bar to its own line below the others */
    .search-bar {
        order: 4;
        flex: 0 0 100%; /* Takes up 100% width, forcing it to wrap */
        margin-top: 10px;
        max-width: none; /* Override the 180px restriction */
    }

    /* Keep the "Sell/Deliver" menu hidden until clicked */
    .mobile-menu-overlay {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        z-index: 100;
        background: white;
        flex-direction: column;
        display: none;
    }

    .mobile-menu-overlay.active {
        display: flex;
    }

    .nav-links{
        padding: 0.1rem 0;
        gap: 0.25rem;
    }

    .nav-links a{
        padding: 0.2rem 0.4rem;
        font-size: 14px;

    }
    .search-bar{
        margin-bottom: 0;
    }

    .search-bar input{
        font-size: 0.9rem;
    }

}

/* Mobile footer layout */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr; /* 2 columns for middle links */
        gap: 1rem; /* optional spacing between columns */
    }

    /* Make the first column (About) full width */
    .footer-col:nth-child(1) {
        grid-column: 1 / -1;
    }

    /* Quick Links & Customer Service remain 2 per row */
    .footer-col:nth-child(2),
    .footer-col:nth-child(3) {
        grid-column: auto;
    }

    /* Make Contact full width */
    .footer-col:nth-child(4) {
        grid-column: 1 / -1;
    }

    /* Make Social Media full width */
    .footer-col:nth-child(5) {
        grid-column: 1 / -1;
        margin-top: 1rem; /* optional spacing */
    }

    .footer {
        padding: 1rem 1rem;
    }

    /* Optional: center the social icons on mobile */
    
}


/* Mobile adjustments for Benefits Section */
@media (max-width: 768px) {
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns */
        gap: 1.5rem; /* slightly smaller gap */
    }

    .benefit-icon {
        font-size: 2rem; /* smaller icons */
        margin-bottom: 0.25rem;
    }

    .benefit-item h3 {
        font-size: 1rem; /* smaller heading */
        margin-bottom: 0.2rem;
    }

    .benefit-item p {
        font-size: 0.75rem; /* smaller text */
    }

    .benefits {
        padding: 1.5rem 1rem; /* reduce padding on mobile */
    }
}

@media (max-width: 768px) {
    .footer{
        margin-top: 2rem;
    }
    
    .btn-outline{
        padding: 0.5rem 0.5rem;
    }
}