/* --- 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;
}