/* --- Global Styles & Variables --- */
/* --- Global Styles & Variables --- */
:root {
    --primary-color: #A03472; /* Deep Rose Pink */
    --secondary-color: #E2CFE9; /* Soft Lavender */
    --accent-color: #55A630; /* Fresh Green */
    --text-dark: #333;
    --text-light: #f4f4f4;
    --bg-light: #ffffff;
    --bg-soft: #fbf8f0; /* Off-White for Background */
    --page-overlay-color: rgba(255, 255, 255, 0.85); 
}
/* ... rest of your style.css ... */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- BODY: Applies the full background image and the new overlay --- */
body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    
    /* Background Image Setup */
    background-image: url('images/bg.jpeg'); 
    background-size: cover; 
    background-position: center;
    background-attachment: fixed; 
    background-color: #f7f7f7; 
    position: relative; 
}

/* --- BODY OVERLAY: Creates a semi-transparent layer over the image --- */
body::before {
    content: '';
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--page-overlay-color);
    z-index: -1; 
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
}

/* --- Header & Navigation: NOW FULLY TRANSPARENT --- */
.main-header {
    background: transparent; 
    border-bottom: 1px solid var(--secondary-color);
    padding: 15px 0;
    position: relative; 
    z-index: 10;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-dark);
    padding: 10px 15px;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.user-actions .btn {
    margin-left: 10px;
}

/* --- Buttons --- */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: #8a2a62;
}

.btn-secondary {
    background-color: var(--accent-color);
    color: var(--text-light);
}

.btn-secondary:hover {
    background-color: #4c9429;
}

.btn-login, .btn-cart {
    background: none;
    color: var(--text-dark);
    border: 1px solid var(--primary-color);
}
.btn-cart {
    background-color: var(--secondary-color);
}

/* --- Hero Section: NOW FULLY TRANSPARENT --- */
.hero-section {
    background: transparent;
    padding: 80px 0;
    text-align: center;
}

.hero-section h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.hero-section p {
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-light); 
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.search-form input {
    flex-grow: 1;
    padding: 15px;
    border: none;
    font-size: 1rem;
}

.search-form button {
    padding: 15px 30px;
    border-radius: 0 8px 8px 0;
}

/* --- Product Grid --- */
.main-content {
    background: transparent;
    padding: 40px 0;
}

.product-grid h3 {
    margin-bottom: 25px;
    font-size: 2rem;
    text-align: center;
}

.grid-container {
    display: grid;
    /* Keeps 5 columns per row */
    grid-template-columns: repeat(5, 1fr); 
    gap: 30px;
}

/* --- PRODUCT CARD ALIGNMENT & IMAGE CLICKABILITY --- */
.product-card {
    background: transparent;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column; 
    height: 100%; 
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    /* NEW: Indicates the image is clickable */
    cursor: pointer; 
}

.product-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
}

.product-info h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.product-info .price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: block;
}

.product-info .seller {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 15px;
    display: block;
}

/* MODIFIED: This container now only holds the single Add to Cart button */
.card-actions {
    margin-top: auto; /* Pushes the button to the bottom */
    display: flex;
}

/* Ensures the Add to Cart button takes up the full width again */
.product-info .card-actions .btn {
    width: 100%; 
    margin-top: 0; 
}

.product-info .card-actions .btn-add {
    background-color: var(--accent-color);
    color: var(--text-light);
}


/* --- Seller Call-to-Action: Remains a strong, solid contrasting box --- */
.seller-cta {
    background-color: var(--secondary-color);
    padding: 50px 0;
    margin: 40px 0;
    text-align: center;
    border-radius: 10px;
}

.cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.seller-cta h3 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.seller-cta p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* --- Footer --- */
.main-footer {
    background-color: var(--text-dark);
    color: var(--text-light);
    padding: 20px 0;
    font-size: 0.9rem;
}

.main-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    margin: 0 5px;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* --- Future-Proofing: Motion Accessibility --- */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-delay: -1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- Media Queries for Mobile Responsiveness (Max Width: 768px) --- */
@media (max-width: 768px) {
    
    /* 1. Header and Navigation Adjustments */
    .main-header .container {
        flex-direction: column;
        text-align: center;
    }

    .main-nav ul {
        flex-direction: column;
        padding: 10px 0;
        width: 100%;
    }

    .main-nav li {
        margin: 5px 0;
    }

    .user-actions {
        margin-top: 10px;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .btn-login, .btn-cart {
        flex: 1; 
        margin: 0 5px;
        max-width: 150px;
    }

    /* 2. Hero Section and Search Form Adjustments */
    .hero-section {
        padding: 50px 0;
    }
    
    .hero-section h2 {
        font-size: 1.8rem;
    }

    .search-form {
        flex-direction: column; 
    }

    .search-form input, 
    .search-form button {
        width: 100%;
        padding: 12px;
        border-radius: 5px !important;
        margin-top: 5px; 
    }

    /* 3. Product Grid Behavior */
    .grid-container {
        grid-template-columns: 1fr; 
    }

    /* 4. Footer Adjustment */
    .main-footer .container {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        margin-top: 10px;
    }
}

/* --- Modal Styles --- */

/* The Modal (background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top of everything */
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

/* Modal Content/Box */
.modal-content {
    background-color: var(--bg-light);
    margin: 5% auto; /* 5% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 800px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* The Close Button */
.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close-button:hover,
.close-button:focus {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

/* Modal Headers */
#modalProductName {
    text-align: center;
    margin-bottom: 20px;
}

/* --- Slideshow Styles --- */

.slideshow-container {
    max-width: 100%;
    position: relative;
    margin: auto;
    border-radius: 8px;
    overflow: hidden;
}

.slideshow-images {
    /* Ensures the slideshow container controls the image sizing */
    width: 100%; 
}

/* Individual Slides */
.mySlides {
    display: none; /* Hidden by JS by default */
}

.mySlides img {
    /* Critical to ensure images fit the container */
    max-width: 100%;
    height: auto; 
    display: block;
}

/* Next & previous buttons */
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.5); /* Semi-transparent background */
}

/* Position the "next button" to the right */
.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

/* On hover, add a darker background color */
.prev:hover, .next:hover {
    background-color: rgba(0,0,0,0.8);
}

/* Caption text (1/3, 2/3, etc.) */
.numbertext {
    color: var(--text-light);
    font-size: 12px;
    padding: 8px 12px;
    position: absolute;
    top: 0;
    left: 0;
    background-color: rgba(0,0,0,0.5);
    border-radius: 0 0 5px 0;
}

/* Fading animation */
.fade {
  animation-name: fade;
  animation-duration: 1.5s;
}

@keyframes fade {
  from {opacity: .4} 
  to {opacity: 1}
}

/* MODAL PRODUCT DETAILS */
#modalProductDetails {
    text-align: center;
    padding-top: 20px;
}
#modalProductDetails p {
    margin-bottom: 5px;
}
#modalProductDetails .btn-primary {
    margin-top: 15px;
}

/* --- CART SIDEBAR STYLES --- */

.cart-sidebar {
    /* Initially hidden and off-screen */
    position: fixed;
    top: 0;
    right: 0;
    width: 380px; /* Standard sidebar width */
    height: 100%;
    background-color: var(--bg-light);
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.2);
    z-index: 2000; /* Higher than the product modal */
    transform: translateX(100%); /* Hides the sidebar off-screen */
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

/* Class added by JavaScript to show the sidebar */
.cart-sidebar.open {
    transform: translateX(0);
}

.cart-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--secondary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.cart-close-btn {
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.cart-close-btn:hover {
    color: var(--primary-color);
}

/* Scrollable area for items */
.cart-items-container {
    flex-grow: 1;
    padding: 20px 25px;
    overflow-y: auto;
}

.cart-empty-message {
    text-align: center;
    color: #777;
    padding: 40px 0;
}

/* Styling for an individual item (when added) */
.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px dashed #eee;
    align-items: flex-start;
}

.item-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 5px;
}

.item-details {
    flex-grow: 1;
}

.item-name {
    font-size: 1rem;
    margin-bottom: 2px;
}

.item-seller {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 8px;
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-price {
    font-weight: 700;
    color: var(--primary-color);
}

.item-quantity {
    width: 50px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
}

.btn-remove {
    background: none;
    color: #e74c3c;
    border: none;
    padding: 5px;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Footer (Subtotal and Checkout Buttons) */
.cart-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--secondary-color);
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.btn-checkout {
    width: 100%;
    margin-bottom: 10px;
}

.btn-continue {
    width: 100%;
    background-color: var(--text-dark); /* Use dark color for secondary action */
    color: var(--text-light);
}

.btn-continue:hover {
    background-color: #555;
}

/* Media Query for smaller screens (if sidebar is too wide) */
@media (max-width: 480px) {
    .cart-sidebar {
        width: 100%;
    }
}

/* --- LOGIN MODAL SPECIFIC STYLES --- */

/* Reuses the base .modal class for full-screen overlay */

.login-modal-content {
    /* Slightly smaller max-width for login forms */
    max-width: 450px; 
    margin: 10% auto; /* Centers it better vertically */
    padding: 30px;
    text-align: center;
}

.login-header {
    font-size: 1.8rem;
    margin-bottom: 25px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.login-form input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.login-form input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.btn-full-width {
    width: 100%;
    margin-top: 10px;
}

.login-footer-links {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 0.95rem;
}

.login-footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

.login-footer-links p {
    margin-top: 10px;
}

/* --- SELLER PORTAL DASHBOARD STYLES --- */

.seller-portal-container {
    /* Use a layout similar to the main site body but more contained */
    background-color: var(--bg-soft);
    min-height: 100vh;
    padding: 0;
}

/* --- Seller Header --- */
.seller-header {
    background-color: var(--bg-light);
    border-bottom: 2px solid var(--primary-color);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.seller-header h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info p {
    font-weight: 500;
    color: var(--text-dark);
}

.btn-logout {
    padding: 8px 15px;
    background-color: #e74c3c;
    color: var(--text-light);
}

.btn-logout:hover {
    background-color: #c0392b;
}


/* --- Main Content Layout (Sidebar + Workspace) --- */
.seller-main-content {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Sidebar Navigation --- */
.seller-sidebar {
    width: 250px;
    padding: 30px 0;
    background-color: var(--bg-light);
    border-right: 1px solid #eee;
    min-height: calc(100vh - 70px); /* Adjust height based on header size */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.02);
}

.seller-sidebar ul {
    list-style: none;
}

.seller-sidebar li a {
    display: block;
    padding: 15px 30px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    border-left: 5px solid transparent;
    transition: background-color 0.3s, border-left-color 0.3s;
}

.seller-sidebar li a:hover {
    background-color: var(--secondary-color);
    border-left-color: var(--primary-color);
}

.seller-sidebar li.active a {
    background-color: var(--secondary-color);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 700;
}


/* --- Main Workspace --- */
.seller-workspace {
    flex-grow: 1;
    padding: 30px 40px;
}

.seller-workspace h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    padding-top: 15px;
    border-bottom: 2px solid var(--secondary-color);
}


/* --- Dashboard Stats --- */
.dashboard-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: var(--bg-light);
    flex: 1;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    border-top: 5px solid var(--accent-color);
}

.stat-card h3 {
    font-size: 1rem;
    color: #777;
    margin-bottom: 10px;
    font-family: 'Roboto', sans-serif;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Playfair Display', serif;
}


/* --- Product Table --- */
.btn-add-product {
    margin-bottom: 20px;
}

.product-listing-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-light);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.product-listing-table th,
.product-listing-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.product-listing-table th {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.product-listing-table tr:hover {
    background-color: #f9f9f9;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
    margin-right: 5px;
}

.btn-edit {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.btn-delete {
    background-color: #e74c3c;
    color: var(--text-light);
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .seller-main-content {
        flex-direction: column;
    }

    .seller-sidebar {
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 10px 0;
    }
    
    .seller-sidebar ul {
        display: flex;
        justify-content: space-around;
    }
    
    .seller-sidebar li a {
        padding: 10px 15px;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .seller-sidebar li.active a {
        border-left: none;
        border-bottom: 3px solid var(--primary-color);
    }

    .dashboard-stats {
        flex-direction: column;
    }

    .seller-header {
        padding: 15px 20px;
    }
}

/* ------------------------------------------------------------------ */
/* RESPONSIVENESS FOR SELLER PORTAL (Refined Table Alignment)         */
/* ------------------------------------------------------------------ */

/* Tablet & Smaller Desktop View */
@media (max-width: 992px) {
    /* ... (Existing 992px styles remain the same) ... */
    .seller-main-content {
        flex-direction: column;
    }

    .seller-sidebar {
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 2px solid var(--secondary-color);
        padding: 10px 0;
    }

    .seller-sidebar ul {
        display: flex;
        justify-content: space-around;
        gap: 10px;
        flex-wrap: wrap;
    }

    .seller-sidebar li {
        margin: 0;
    }

    .seller-workspace {
        padding: 20px;
    }

    .dashboard-stats {
        flex-direction: column;
        gap: 15px;
    }

    .stat-card {
        width: 100%;
    }
}

/* Mobile Phone View */
@media (max-width: 600px) {
    /* 1. Header Adjustments */
    .seller-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    .seller-header .user-info {
        margin-top: 10px;
        align-self: flex-end;
    }

    /* 2. Product Controls Stack */
    .product-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    .search-input, .filter-dropdown {
        width: 100%;
        box-sizing: border-box;
    }

    /* 3. Make Tables Responsive (Prioritize columns) */
    .product-listing-table,
    .product-listing-table thead,
    .product-listing-table tbody,
    .product-listing-table th,
    .product-listing-table td,
    .product-listing-table tr {
        display: block;
    }

    .product-listing-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .product-listing-table tr {
        border: 1px solid #ccc;
        margin-bottom: 15px;
        padding: 10px;
        border-radius: 8px;
    }

    .product-listing-table td {
        /* Base styles for vertical cells */
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        text-align: right; /* Aligns data text to the right side */
        font-size: 0.95rem;
    }

    .product-listing-table td::before {
        /* Displays column headers as labels */
        content: attr(data-label);
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 700;
        color: var(--primary-color);
    }
    
    /* REFINEMENT: Target the last column (Actions) and center the buttons */
    .product-listing-table td:last-child {
        text-align: center; /* Center buttons horizontally */
        padding-left: 6px; /* Reset padding to fit the center align */
        border-bottom: none;
        padding-top: 15px;
        padding-bottom: 15px;
    }
    
    /* Ensure action buttons have a small margin between them */
    .product-listing-table td:last-child .btn-sm {
        margin: 5px 5px; 
    }
}