/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f7f6;
    color: #1a1a1a;
    line-height: 1.6;
}

/* ===== Color Scheme ===== */
:root {
    --primary: #00a86b;    /* emerald green */
    --primary-dark: #008a56;
    --white: #ffffff;
    --black: #1a1a1a;
    --gray: #f0f2f1;
    --shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* ===== Navbar ===== */
.navbar {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

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

.brand i {
    margin-right: 0.5rem;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--black);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

.admin-link {
    background: var(--primary);
    color: var(--white) !important;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
}

.admin-link:hover {
    background: var(--primary-dark);
}

/* ===== Hero ===== */
.hero {
    background: #1a1a1a;
    color: var(--white);
    padding: 6rem 2rem;
    text-align: center;
    position: relative; 
    min-height: 400px;   
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); 
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero-content .highlight {
    color: var(--primary);
}

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

.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 0.8rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, background 0.2s;
    border: none;
    cursor: pointer;
}

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

/* ===== Features ===== */
.features {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

/* ===== Catalogue ===== */
.catalogue {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.catalogue-header {
    text-align: center;
    margin-bottom: 3rem;
}

.category-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary);
    color: var(--white);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
}

.product-img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 8px 8px 0 0;
}

.product-info {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.product-category {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.3rem;
}

.product-desc {
    font-size: 0.9rem;
    color: #555;
    flex: 1;
    margin-bottom: 1rem;
}

.whatsapp-btn {
    display: inline-block;
    background: #25D366;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: background 0.2s;
}

.whatsapp-btn:hover {
    background: #1ebe57;
}

/* ===== Admin Login ===== */
.login-container {
    min-height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.login-card {
    background: var(--white);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
}

.login-card h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
}

.error {
    color: #e74c3c;
    margin-bottom: 1rem;
    text-align: center;
}

/* ===== Admin Dashboard ===== */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.btn-logout {
    background: #e74c3c;
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
}

.btn-logout:hover {
    background: #c0392b;
}

.dashboard-actions {
    margin-bottom: 2rem;
}

#product-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

#product-table th,
#product-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

#product-table th {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
}

#product-table tr:last-child td {
    border-bottom: none;
}

.action-btn {
    padding: 0.3rem 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    margin-right: 0.3rem;
}

.btn-edit {
    background: #f39c12;
    color: white;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 0.8rem;
    right: 1.2rem;
    font-size: 1.8rem;
    cursor: pointer;
    color: #777;
}

.close-modal:hover {
    color: var(--black);
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 2rem;
    background: var(--black);
    color: var(--white);
    margin-top: 4rem;
}

/* ===== Admin: Category Manager ===== */
.dashboard-section {
    margin-bottom: 3rem;
}

.category-manager {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-width: 500px;
}

.category-input {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.category-input input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.category-list {
    list-style: none;
    padding: 0;
}

.category-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.category-list li:last-child {
    border-bottom: none;
}

.delete-cat-btn {
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
}

/* ===== Contact Section ===== */
.contact-section {
    background: #f4f7f6;
    padding: 4rem 2rem;
}

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

.contact-header {
    text-align: center;
    margin-bottom: 3rem;
}

.contact-header h2 {
    font-size: 2.5rem;
    color: var(--black);
}

.contact-header p {
    color: #666;
    font-size: 1.1rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    align-items: start;
}

.contact-socials {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.social-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--white);
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.social-btn.whatsapp { background: #25D366; }
.social-btn.tiktok { background: #000000; }
.social-btn.instagram { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.social-btn.facebook { background: #1877F2; }

.quick-contact {
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
}

.quick-contact p {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #444;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.quick-contact p i {
    color: var(--primary);
    width: 1.2rem;
}

.contact-location {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.contact-location h3 {
    margin-bottom: 1rem;
    color: var(--black);
}

.map-container {
    width: 100%;
    height: 250px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.2rem;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.map-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.map-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== Catalogue Filters Wrapper (Mobile Dropdown) ===== */
.filter-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1.5rem;
    width: 100%;
}

.category-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.category-dropdown {
    display: none;
    width: 100%;
    max-width: 300px;
    padding: 0.7rem 1rem;
    border: 2px solid var(--primary);
    border-radius: 50px;
    background: var(--white);
    font-size: 1rem;
    color: var(--primary);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    outline: none;
}

/* ===== Search Bar ===== */
.search-container {
    width: 100%;
    max-width: 500px;
    margin: 1.5rem auto 0 auto;
}

.search-input {
    width: 100%;
    padding: 0.8rem 1.5rem;
    border: 2px solid #ddd;
    border-radius: 50px;
    font-size: 1rem;
    background: var(--white);
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 168, 107, 0.15);
}

/* ===== IMAGE SLIDER (Auto-Slide + Arrows) ===== */
.img-slider {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.img-slider .product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.img-slider .product-img.active-img {
    opacity: 1;
    visibility: visible;
}

/* Navigation Arrows */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.2s;
    font-size: 14px;
}

.slider-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.slider-nav.prev { left: 8px; }
.slider-nav.next { right: 8px; }

/* Dots */
.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slider-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 0 2px rgba(0,0,0,0.2);
}

.slider-dots .dot.active {
    background: #ffffff;
    transform: scale(1.2);
}

/* ===== Desktop & Mobile Layout Overrides ===== */

/* Show at least 4 products per row on Desktop */
@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Responsive: Phones (Mobile) */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    .hero-content h1 {
        font-size: 2.2rem;
    }
    .feature-grid {
        grid-template-columns: 1fr 1fr;
    }
    .category-filters { display: none; }
    .category-dropdown { display: block; }
    .search-container { max-width: 100%; }
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .social-card {
        grid-template-columns: 1fr 1fr;
    }
    
    /* ===== 4 ITEMS VISIBLE ON PHONE SCREEN ===== */
    .product-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.8rem;
    }
    .product-card {
        border-radius: 12px;
    }
    .img-slider {
        height: 110px !important;
    }
    .product-img {
        height: 110px !important;
        padding: 0.2rem;
    }
    .product-info {
        padding: 0.6rem;
    }
    .product-info h3 {
        font-size: 0.9rem;
        margin-bottom: 0.1rem;
    }
    .product-category {
        font-size: 0.7rem;
    }
    .product-price {
        font-size: 0.9rem;
        margin-bottom: 0.1rem;
    }
    .product-desc {
        font-size: 0.7rem;
        margin-bottom: 0.3rem;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .whatsapp-btn {
        padding: 0.3rem 0.8rem;
        font-size: 0.7rem;
    }
    
    /* Mobile Arrows & Dots Adjustment */
    .slider-nav {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    .slider-nav.prev { left: 4px; }
    .slider-nav.next { right: 4px; }
    .slider-dots .dot {
        width: 6px;
        height: 6px;
    }
}