/* --- Color Palette & Global Settings --- */
:root {
    --primary-color: #3498db; /* A friendly, professional blue */
    --secondary-color: #2ecc71; /* A vibrant green for success/buy buttons */
    --accent-color: #f1c40f; /* A bright yellow/gold for call-to-action */
    --header-bg: #ffffff;
    --footer-bg: #2c3e50; /* A dark, classy slate blue */
    --bg-color: #ecf0f1; /* A very light, soft grey */
    --card-bg: #ffffff;
    --text-light: #ffffff;
    --text-dark: #34495e; /* A softer, slate-grey text color */
    --text-muted: #7f8c8d;
    --border-radius: 8px;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0; /* Fixes "floating" header */
    padding-top: 75px; /* Leave space for the sticky header */
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
}

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

/* --- Sticky Header --- */
.site-header {
    background-color: var(--header-bg);
    padding: 1rem 0;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
}

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

.site-title {
    margin: 0;
    font-size: 1.8rem;
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
}

.site-title span {
    color: var(--accent-color); /* Makes "Online" yellow */
}

.header-nav a {
    background-color: var(--accent-color);
    color: var(--text-dark);
    padding: 10px 20px;
    text-decoration: none;
    font-weight: bold;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
}
.header-nav a:hover {
    background-color: #f39c12;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* --- Page Welcome & Search Bar --- */
.page-welcome {
    text-align: center;
    padding: 2rem 1rem;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    margin-top: 30px;
    border: 1px solid #dee2e6;
    margin-bottom: 30px; /* Adds space below the welcome box */
}
.page-welcome h1 { font-size: 2.2rem; margin-top: 0; color: var(--primary-color); }
.page-welcome p { color: var(--text-muted); max-width: 600px; margin: 0.5rem auto 0; }

.search-bar {
    position: relative;
}
.search-bar input[type="search"] {
    width: 100%;
    box-sizing: border-box; 
    padding: 16px 20px 16px 50px; 
    font-size: 1.2rem; 
    border-radius: var(--border-radius);
    border: 2px solid #ced4da; 
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.search-bar input[type="search"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.4); 
}
.search-bar::before {
    content: '🔍';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem; 
    color: var(--text-muted);
    pointer-events: none;
}

/* --- Product Grid & Cards --- */
.product-grid {
    padding-top: 30px;
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(2, 1fr); /* Default: 2 columns for small screens */
}
.product-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border-radius: var(--border-radius);
}
.product-card-link:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}
.product-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #e9ecef;
}
.product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}
.product-card h3 { margin: 15px; font-size: 1.1rem; }
.product-card .price { margin: 0 15px 15px; font-size: 1.1rem; font-weight: bold; color: var(--primary-color); margin-top: auto; }

/* --- Product Detail Page --- */
.product-detail-layout { display: grid; grid-template-columns: 1fr; gap: 30px; margin-top: 20px; }
.product-detail-image-gallery { display: grid; grid-template-columns: 1fr; gap: 15px; }
.product-detail-image-gallery img { width: 100%; border-radius: var(--border-radius); box-shadow: var(--shadow); border: 1px solid #eee; }
.product-detail-info h1 { margin-top: 0; font-size: 2.5rem; }
.product-detail-info .price { color: var(--accent-color); font-size: 1.8rem; }
.product-detail-info .description { margin-top: 1.5rem; }

/* --- Seller Page Auth Box --- */
#auth-container { max-width: 550px; margin: 40px auto; background-color: var(--card-bg); padding: 2rem; border-radius: var(--border-radius); box-shadow: var(--shadow); border: 1px solid #dee2e6; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 15px; width: 100%; background-color: #4285F4; color: white; border: 1px solid #4285F4; font-weight: bold; margin-bottom: 0; }
.google-btn:hover { background-color: #357ae8; }
.or-divider { text-align: center; margin: 20px 0; color: var(--text-muted); display: flex; align-items: center; gap: 15px; }
.or-divider::before, .or-divider::after { content: ''; flex-grow: 1; height: 1px; background-color: #ddd; }
.accordion-button { background-color: #f1f1f1; color: #444; cursor: pointer; padding: 18px; width: 100%; text-align: left; border: 1px solid #ddd; outline: none; transition: background-color 0.4s; font-size: 1.1rem; font-weight: bold; }
.accordion-button.active, .accordion-button:hover { background-color: #e0e0e0; }
.accordion-panel { padding: 0 18px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; background-color: white; border: 1px solid #ddd; border-top: none; }
.password-wrapper { position: relative; width: 100%; }
.password-wrapper input { padding-right: 45px !important; }
.toggle-password { position: absolute; top: 50%; right: 15px; transform: translateY(-50%); cursor: pointer; user-select: none; font-size: 1.2rem; }

/* --- Professional Product Form --- */
#product-form { display: flex; flex-direction: column; gap: 15px; border: 1px solid #dee2e6; padding: 20px; border-radius: var(--border-radius); background-color: var(--card-bg); }
#product-form label { display: block; font-weight: bold; margin-bottom: 5px; color: var(--text-dark); font-size: 0.9rem; }

/* --- Other Page Styles --- */
.page-content h2 { border-bottom: 2px solid var(--primary-color); padding-bottom: 10px; margin-top: 2rem; }
.instruction-text { padding: 1rem; background-color: #e7f5ff; border-left: 4px solid var(--primary-color); border-radius: var(--border-radius); margin-bottom: 2rem; }
.home-link { display: inline-block; margin-bottom: 20px; color: var(--primary-color); text-decoration: none; font-weight: bold; }

/* --- Footer --- */
footer { background-color: var(--footer-bg); color: var(--text-light); padding: 2.5rem 1rem; text-align: center; margin-top: 40px; }
footer h2 { color: var(--text-light); margin-bottom: 1.5rem; }
.contact-btn { color: var(--text-light); padding: 12px 25px; text-decoration: none; font-weight: bold; border-radius: var(--border-radius); transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 10px; }
.contact-btn.whatsapp { background-color: #25D366; }
.contact-btn.email { background-color: #EA4335; }
.contact-btn:hover { opacity: 0.85; transform: scale(1.05); }
.footer-links { margin-bottom: 1rem; }
.footer-link { color: var(--text-light); margin: 0 15px; text-decoration: none; opacity: 0.8; }
.footer-link:hover { opacity: 1; }
.copyright { font-size: 0.9rem; opacity: 0.6; }

/* --- Responsive Media Queries --- */
@media (min-width: 768px) {
    .product-grid { gap: 20px; grid-template-columns: repeat(3, 1fr); }
    .product-detail-layout { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1200px) {
    .product-grid { grid-template-columns: repeat(4, 1fr); }
}



/* --- New Modern Auth Page Design --- */
.login-card {
    max-width: 450px;
    margin: 40px auto;
    padding: 2.5rem 2rem;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    border-top: 5px solid var(--primary-color);
}

.auth-title {
    font-size: 2rem;
    color: var(--text-dark);
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.auth-tabs {
    display: flex;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.tab-link {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.tab-link.active {
    background-color: var(--primary-color);
    color: var(--text-light);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.tab-link:first-child { border-radius: 7px 0 0 7px; }
.tab-link:last-child { border-radius: 0 7px 7px 0; }

.tab-content {
    display: none;
    text-align: left;
}

.tab-content.active {
    display: block;
}

.login-card .form-group {
    margin-bottom: 1rem;
}

.login-card label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9rem;
}

.login-card input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    box-sizing: border-box;
}

.auth-button {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--secondary-color);
    color: white;
    cursor: pointer;
    margin-top: 1rem;
}
.auth-button:hover {
    background-color: #27ae60;
}

.auth-footer-text {
    margin-top: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}
.auth-footer-text span {
    color: var(--accent-color);
}


/* --- Custom Modal Styles --- */
.modal-overlay {
    position: fixed; /* Sit on top of the page content */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Black background with opacity */
    z-index: 2000; /* Display over everything */
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.modal-content h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.modal-content p {
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

#modal-close-btn {
    width: auto;
    min-width: 100px;
}
/* WhatsApp button on product detail page */
.whatsapp-btn {
  background-color: #25D366;   /* WhatsApp green */
  color: white;                /* text color */
  padding: 10px 15px;          /* space inside button */
  border-radius: 8px;          /* rounded corners */
  text-decoration: none;       /* remove underline */
  font-weight: bold;           /* make text bold */
  display: inline-block;       /* so padding works */
  transition: background 0.3s; /* smooth hover effect */
}

.whatsapp-btn:hover {
  background-color: #1ebe5b;   /* darker green on hover */
}

/* back 2 header */
.back-home-btn {
  display: inline-block;
  background-color: #ffc107; /* yellow */
  color: #003366; /* dark blue text */
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 15px;
  transition: 0.3s;
  box-shadow: 0px 2px 5px rgba(0,0,0,0.1);
}

.back-home-btn:hover {
  background-color: #003366; /* dark blue on hover */
  color: #ffffff; /* white text */
}
/* --- New Two-Row Filter Styles --- */

/* Main container for the filters */
.filters {
    display: flex;
    flex-direction: column; /* Stacks the rows vertically */
    gap: 10px; /* Space between the category row and price row */
    margin-top: 15px;
}

/* This is the new group for the price inputs and button */
.price-filter-group {
    display: flex;
    gap: 10px; /* Space between the price inputs and the button */
}

/* Shared styles for all input fields and the select dropdown */
.filters select,
.filters input[type="number"] {
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

/* Make the category dropdown take the full width of its row */
#category-filter {
    width: 100%;
}

/* Make the price inputs flexible so they grow to fill the space */
.price-filter-group input[type="number"] {
    flex: 1; /* This makes both price inputs share the space equally */
    min-width: 100px;
}


#apply-filters-btn {
    background-color: #f0ad4e; /* This is a common gold/yellow color */
    color: #333;
    font-weight: bold;
    border: none;
}

#apply-filters-btn:hover {
    background-color: #ec971f; /* A slightly darker shade for hover */
}

/* Style for the 'Add to Deals' button in the admin dashboard */
.seller-controls .deal-btn {
    width: 100%;
    margin-bottom: 5px; /* Adds space between it and the delete button */
    padding: 8px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s; /* Smooth transition */
}

/* Style for when the product IS ON DEAL (the button turns green) */
.seller-controls .deal-btn.on-deal {
    background-color: #28a745; /* A nice green color */
    color: white;
    border-color: #218838;
    font-weight: bold;
}
/* Styling for the "DEAL" badge on product cards */
.product-card {
    position: relative; 
    overflow: hidden;
}

.deal-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #ff4757;
    color: white;
    padding: 5px 10px;
    font-size: 0.8em;
    font-weight: bold;
    border-radius: 5px;
    z-index: 2;
}

/* --- Default style for larger screens (horizontal scroll) --- */
.horizontal-scroll-grid {
    display: flex;
    overflow-x: auto;
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

.horizontal-scroll-grid .product-card-link {
    flex: 0 0 250px; 
    margin-right: 15px;
}

.horizontal-scroll-grid::-webkit-scrollbar {
    display: none;
}

/* --- Added style for small screens (2-column grid) --- */
@media (max-width: 768px) {
    .horizontal-scroll-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* Creates 2 equal columns */
        gap: 15px; /* Sets the space between cards */
        overflow-x: visible; /* Removes horizontal scroll */
        padding-bottom: 0;
    }

    .horizontal-scroll-grid .product-card-link {
        flex: auto; /* Resets the fixed width */
        margin-right: 0; /* Removes the margin used for scrolling */
    }
}

/* --- Skeleton Loader Styles --- */

/* The container for a single skeleton card */
.skeleton-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
}

/* The base style for any shimmering element */
.skeleton {
    background-color: #e0e0e0; /* Light gray for the placeholder */
    border-radius: 4px;
    animation: shimmer 1.5s infinite linear;
    background-image: linear-gradient(90deg, #e0e0e0 0px, #f0f0f0 40px, #e0e0e0 80px);
    background-size: 600px; /* Make the gradient wider than the element */
}

/* Specific placeholder elements */
.skeleton-image {
    height: 150px; /* Approximate height of your product images */
    margin-bottom: 10px;
}

.skeleton-title {
    height: 20px;
    width: 80%; /* Title doesn't take up the full width */
    margin-bottom: 8px;
}

.skeleton-price {
    height: 18px;
    width: 50%; /* Price is usually shorter */
}

/* The shimmer animation */
@keyframes shimmer {
    0% {
        background-position: -300px; /* Start gradient off-screen to the left */
    }
    100% {
        background-position: 300px; /* End gradient off-screen to the right */
    }
}
/* ================== LOAD MORE BUTTON STYLE ================== */

#load-more-btn {
  /* Sizing and Spacing */
  padding: 12px 28px;
  font-size: 16px;
  font-weight: bold;
  
  /* Colors and Appearance */
  background-color: #f0ad4e; /* A nice yellow/orange color */
  color: #ffffff;             /* White text */
  border: none;
  border-radius: 8px;          /* Rounded corners */
  cursor: pointer;
  
  /* Smooth transition for hover effect */
  transition: background-color 0.3s ease;
}

/* Style for when the user hovers their mouse over the button */
#load-more-btn:hover {
  background-color: #ec9b3b; /* A slightly darker shade */
}
/* --- Styles for the Search Bar & Button --- */

.search-bar {
    display: flex; /* Aligns the input and button horizontally */
    gap: 10px;     /* Adds a small space between them */
    align-items: center; /* Vertically aligns them nicely */
}

.search-bar input[type="search"] {
    flex-grow: 1; /* Allows the search input to take up available space */
    margin: 0;    /* Removes default margins */
}

/* This is the general style for all Call-to-Action buttons, including Search */
.cta-button {
    background-color: #007BFF;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #0056b3;
}

/* --- CSS for Seller Call-to-Action Section --- */
#cta-seller-section {
    background-color: #f8f9fa; /* A light grey background */
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid #eee;
    margin-top: 30px;
}
#cta-seller-section h2 {
    font-size: 1.8em;
    margin-bottom: 10px;
}
#cta-seller-section p {
    color: #6c757d; /* A softer text color */
    margin-bottom: 25px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.cta-buttons-container {
    display: flex;
    justify-content: center;
    gap: 20px; /* Space between buttons */
    flex-wrap: wrap; /* Allows buttons to stack on small screens */
}
.cta-button-large {
    padding: 12px 25px;
    font-size: 1.1em;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    color: white;
    transition: transform 0.2s;
}
.cta-button-large:hover {
    transform: translateY(-2px);
}
.cta-item-btn {
    background-color: #007bff; /* Blue for items */
}
.cta-service-btn {
    background-color: #28a745; /* Green for services */
}
/* Kabale Contact Info Section - Unique Styles */
.kabale-contact-info-section {
    background-color: #2c3e50; /* Dark blue/grey background */
    color: #ecf0f1; /* Light text color */
    padding: 40px 20px;
    text-align: center;
    font-family: Arial, sans-serif; /* Or your preferred font */
}

.kabale-contact-title {
    font-size: 2em;
    margin-bottom: 25px;
    color: #ffffff;
    font-weight: bold;
}

.kabale-contact-details {
    margin-bottom: 30px;
}

.kabale-contact-item {
    font-size: 1.2em;
    margin: 10px 0;
    line-height: 1.5;
    display: block; /* Ensures each item is on its own line */
}

/* Optional: Make phone number and email clickable */
.kabale-contact-item a {
    color: #ecf0f1; /* Inherit text color */
    text-decoration: none; /* Remove underline */
    transition: color 0.3s ease;
}

.kabale-contact-item a:hover {
    color: #3498db; /* Light blue on hover */
}


.kabale-footer-links {
    margin-top: 25px;
    margin-bottom: 20px;
}

.kabale-footer-link {
    color: #bdc3c7; /* Lighter grey for links */
    text-decoration: none;
    font-size: 1em;
    margin: 0 15px;
    transition: color 0.3s ease;
}

.kabale-footer-link:hover {
    color: #ffffff; /* White on hover */
    text-decoration: underline;
}

.kabale-copyright {
    font-size: 0.9em;
    color: #7f8c8d; /* Even lighter grey for copyright */
    margin-top: 15px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .kabale-contact-title {
        font-size: 1.6em;
    }
    .kabale-contact-item {
        font-size: 1em;
    }
    .kabale-footer-link {
        display: block;
        margin: 10px 0;
    }
}
/* --- CSS for Competitive Hero Section --- */
.hero-section {
    background-color: #0056b3; /* A nice shade of blue */
    background-image: linear-gradient(145deg, #007bff, #003d7a);
    color: white;
    text-align: center;
    padding: 50px 20px;
}

.hero-section h1 {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

.hero-section p {
    font-size: 1.2em;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.hero-buttons a {
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: transform 0.2s;
}

.hero-buttons a:hover {
    transform: scale(1.05);
}

.hero-start-selling {
    background-color: #ffc107; /* Yellow */
    color: #212529;
}

.hero-browse {
    background-color: white;
    color: #007bff;
}
/* --- STICKY ACTION HEADER --- */
.header-actions-sticky {
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 1000;
    padding: 6px 10px;
    display: flex;
    justify-content: flex-start; /* Default for mobile scrolling */
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid #eee;
    flex-wrap: nowrap;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.header-actions-sticky::-webkit-scrollbar {
    display: none;
}
.action-btn {
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9em;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: #f0f2f5;
    color: #333;
    flex-shrink: 0;
}
.action-btn:hover {
    background-color: #e2e6ea;
}
.nav-link.active {
    background-color: #007bff;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

/* This rule centers the buttons on screens wider than 768px */
@media (min-width: 768px) {
    .header-actions-sticky {
        justify-content: center;
    }
}
/* styles.css */
.notification-bell {
    position: relative;
    color: var(--text-dark);
    font-size: 22px;
    text-decoration: none;
}
.notification-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: #d9534f;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
}
/* --- STYLES FOR SERVER-RENDERED PRODUCT PAGE --- */

.product-detail-content .product-images {
  display: flex;
  flex-direction: column;
  gap: 10px; /* Adds space between images if there are multiple */
  margin-bottom: 20px;
}

.product-detail-content .product-images img {
  width: 100%; /* Makes the image responsive */
  height: auto; /* Maintains aspect ratio */
  max-width: 500px; /* Prevents image from being too large on desktop */
  border-radius: 8px; /* Optional: adds rounded corners */
  border: 1px solid #eee; /* Optional: adds a light border */
  object-fit: cover;
  margin: 0 auto; /* Centers the image */
  display: block;
}