
/* --- Sidebar --- */
.sidebar {
    margin: 0;
    padding: 0;
    width: 200px;
    background-color: #f1f1f1;
    position: absolute;
    height: 100%;
    overflow: auto;
}

.sidebar a {
    display: block;
    color: black;
    padding: 16px;
    text-decoration: none;
}

.sidebar a.active {
    background-color: #04AA6D;
    color: white;
}

.sidebar a:hover:not(.active) {
    background-color: #555;
    color: white;
}

/* --- Main Content Area --- */
div.content {
    margin-left: 200px;
    padding: 1px 16px; /* Sheet 2 overrides this to 1px 6px further down */
    min-height: calc(100vh - 100px); /* Added from Sheet 2 */
    box-sizing: border-box; /* Added from Sheet 2 */
    padding-top: 20px; /* Added from Sheet 2 */
    background-color: #fbfeffb3; /* Added from Sheet 2 */
}

/* Note: div.content padding is overridden again in Sheet 2 from 1px 16px to 1px 6px */
div.content {
    padding: 1px 6px;
}

main.content-area {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 6px; /* Existing padding for content sections */
    max-width: calc(100% - 40px); /* Adjust max-width within the content div */
    margin: 0 auto; /* Center content within its div */
}
.content-form {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 30px; /* Existing padding for content sections */
    max-width: calc(100% - 40px); /* Adjust max-width within the content div */
    margin: 0 auto; /* Center content within its div */
}
/* --- Form Styling --- */
form {
    margin-top: 1px;
}

form label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

form input[type="tel"],
form input[type="text"],
form input[type="email"],
form input[type="password"],
form textarea {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

form button {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

form button:hover {
    background-color: #0056b3;
}
/* --- Footer --- */
footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 0px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 999;
}

body {
    /* Sheet 2 overrides Sheet 1's font-family, background-color, and color for body */
    font-family: 'Inter', sans-serif; /* OVERRIDDEN: Sheet 1 had 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; */
    margin: 0; /* Consistent */
    padding: 0; /* OVERRIDDEN: Sheet 1 had 20px */
    background-color: #f4f4f4; /* OVERRIDDEN: Sheet 1 had #f4f7f6 */
    color: #333; /* Consistent */
    height: 100%; /* Added from Sheet 2 */
}

html, body {
    height: 100%; /* From Sheet 2 */
    margin: 0; /* From Sheet 2 */
    padding: 0; /* From Sheet 2 */
}

/* New class from Sheet 2 */
body.no-scroll {
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
    border-radius: 8px;
}

        .content {
            /* If your header/nav have padding, adjust this. */
            padding-top: 20px; /* Space from header */
        }
        main.content-area {
            max-width: 1200px; /* This limits overall content width */
            margin: 0 auto;
            padding: 6px;
            background-color: #fff;
            box-shadow: 0 0 15px rgba(0,0,0,0.05);
            border-radius: 8px;
        }
        h1 {
            text-align: center;
            color: #2c3e50;
            margin-bottom: 30px;
            font-size: 2.5em;
            font-weight: 600;
        }
        h2 {
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.filter-sort-bar {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            margin-bottom: 12px;
            padding: 3px 12px;
            background-color: #eaf1f8;
            border-radius: 5px;
            box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
        }

        /* Make the form itself a flex container */
        .filter-sort-bar form {
            display: flex; /* This is the key change */
            align-items: center; /* Vertically align label and select */
            /* You might want to remove padding/margin from the form itself if it's causing issues */
        }

        .filter-sort-bar label {
            font-weight: 500;
            margin-right: 10px; /* Space between label and dropdown */
            color: #555;
            margin-bottom: 0; /* Ensure no bottom margin pushes the dropdown */
        }
        .filter-sort-bar select {
            padding: 10px 15px;
            border: 1px solid #c9d8e6;
            border-radius: 5px;
            background-color: #fff;
            font-size: 1em;
            cursor: pointer;
            appearance: none; /* Remove default select arrow */
            -webkit-appearance: none;
            -moz-appearance: none;
            background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23000000%22%20d%3D%22M287%2C114.7L154.5%2C247.2c-2.4%2C2.4-5.6%2C3.9-8.9%2C3.9s-6.5-1.4-8.9-3.9L5.4%2C114.7c-4.8-4.8-4.8-12.5%2C0-17.3c4.8-4.8%2C12.5-4.8%2C17.3%2C0l131.7%2C131.8L269.7%2C97.4c4.8-4.8%2C12.5-4.8%2C17.3%2C0C291.8%2C102.2%2C291.8%2C109.9%2C287%2C114.7z%22%2F%3E%3C%2Fsvg%3E');
            background-repeat: no-repeat;
            background-position: right 10px center;
            background-size: 10px;
        }

/* Add these styles to your existing style.css */

/* Styles from view.php adapted for add_product.php form layout */
.product-detail-upper {
    display: flex;
    flex-wrap: wrap;
    gap: 30px; /* Space between left and right columns */
    margin-bottom: 30px; /* Space between upper and lower sections */
}
.product-image-upload { /* Renamed from .product-image to be specific for upload area */
    flex: 1 1 300px; /* Allows it to grow/shrink, minimum 300px width */
    display: flex; /* For centering content vertically */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8; /* Light background for the upload area */
    border: 1px dashed #ccc; /* Dashed border to indicate drop/upload zone */
    border-radius: 10px;
    padding: 20px;
    min-height: 300px; /* Ensure enough height for the image area */
    box-sizing: border-box;
}
.product-image-upload img {
    max-width: 100%;
    max-height: 250px; /* Limit image preview height */
    object-fit: contain; /* Ensures entire image is visible */
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #eee;
}
.product-image-upload label {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
    font-weight: normal; /* Override default form label bold */
}
.product-image-upload input[type="text"] {
    width: calc(100% - 20px); /* Adjust to fit padding */
    margin-bottom: 10px;
}
.product-image-upload .upload-button {
    background-color: #28a745; /* Green for upload */
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    margin-top: 10px;
}
.product-image-upload .upload-button:hover {
    background-color: #218838;
}


.product-info-form { /* Renamed from .product-info for form content */
    flex: 2 1 500px; /* Allows it to grow/shrink, minimum 500px width */
    /* Remove padding from this div if main.content-area already has padding */
}

/* Styles for tabs, copied directly from view.php as they are well-suited */
.description-tabs-section {
    margin-top: 20px;
    line-height: 1.6;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding-bottom: 32px; /* Adjusted if needed, or remove !important */
}
.tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
}
.tab-button {
    padding: 10px 15px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 1em;
    font-weight: bold;
    color: #555;
    transition: color 0.3s ease, border-bottom 0.3s ease;
}
.tab-button.active {
    color: #007bff;
    border-bottom: 2px solid #007bff;
}
.tab-button:hover:not(.active) {
    color: #0056b3;
}
.tab-content {
    display: none;
    padding-top: 10px;
}
.tab-content.active {
    display: block;
}

/* Adjustments for general form elements within the new structure */
.product-info-form .form-group input[type="text"],
.product-info-form .form-group input[type="number"],
.product-info-form .form-group textarea,
.description-tabs-section .form-group input[type="text"],
.description-tabs-section .form-group input[type="number"],
.description-tabs-section .form-group textarea,
.description-tabs-section .form-group select {
    width: 100%; /* Make inputs full width within their columns */
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

/* Specific adjustment for textarea within the split tab content */
.tab-content .form-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* Space between columns in a tab */
}
.tab-content .form-group > div { /* A column inside the tab-content form-group */
    flex: 1 1 calc(50% - 10px); /* Two columns */
    box-sizing: border-box;
}
/* If you want single column for description/textarea in tab, adjust this */
.tab-content .form-group.full-width-textarea > div {
    flex: 1 1 100%; /* Make single column for textarea */
}


/* Responsive adjustments for product form */
@media (max-width: 768px) {
    .product-detail-upper {
        flex-direction: column; /* Stack image and info vertically */
        align-items: center; /* Center items when stacked */
        gap: 20px; /* Reduce gap when stacked */
    }
    .product-image-upload, .product-info-form {
        flex: none; /* Remove flex sizing */
        width: 100%; /* Take full width */
        min-height: auto; /* Remove min-height when stacked */
        padding: 15px;
    }
    .product-image-upload {
        min-height: 250px;
    }
    .product-image-upload img {
        max-height: 200px;
    }

    .description-tabs-section .tab-content .form-group {
        flex-direction: column; /* Stack columns within tabs vertically */
        gap: 15px;
    }
    .description-tabs-section .tab-content .form-group > div {
        flex: none;
        width: 100%;
    }
    .tabs {
        flex-wrap: wrap; /* Allow tabs to wrap on smaller screens */
    }
    .tab-button {
        flex: 1 1 auto; /* Allow buttons to take available space */
        text-align: center;
        margin-bottom: 5px;
    }
}

/* Ensure the main.content-area has consistent padding if it contains the form */
main.content-area {
    padding: 30px; /* Adjust padding to match the form content */
}

        /* --- Product Grid (photo-grid-item equivalent) Styles --- */
        .product-catalog { /* This acts as your .photo-grid-container */
            display: grid;
            gap: 6px; /* Space between grid items */
            padding: 3px; /* Padding for the grid itself */

            /* DEFAULT: 2 columns on all screens by default (smallest breakpoint) */
            grid-template-columns: repeat(2, 1fr);
        }

        /* Tablet screens (768px and up): 3 columns, 33.33% width each */
        @media (min-width: 500px) {
            .product-catalog {
                grid-template-columns: repeat(3, 1fr); /* 3 columns */
            }
        }

        /* Desktop screens (992px and up): 4 columns, 25% width each */
        @media (min-width: 768px) {
            .product-catalog {
                grid-template-columns: repeat(4, 1fr); /* 4 columns */
            }
        }

        /* Large desktop screens (1200px and up): 6 columns, 16.66% width each */
        @media (min-width: 1200px) {
            .product-catalog {
                grid-template-columns: repeat(6, 1fr); /* 6 columns */
            }
            main.content-area {
                max-width: 1400px; /* Adjust max-width to allow 6 columns to breathe */
            }
        }

        .product-card { /* This is your .photo-grid-item equivalent */
            background-color: #fff;
            border: 1px solid #ddd;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            text-align: center;
            display: flex;
            flex-direction: column;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .product-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 4px 15px rgba(0,0,0,0.15);
        }

        .product-card img {
            width: 100%;
            height: 200px; /* Fixed height for consistent image size */
            object-fit: cover; /* Ensures image covers the area, cropping if necessary */
            display: block;
            border-bottom: 1px solid #eee;
        }

        .product-content {
            padding: 6px;
            flex-grow: 1; /* Allows content to push footer to bottom */
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .product-title {
            font-size: 1em;
            font-weight: 600;
            color: #34495e;
            margin-top: 0;
            margin-bottom: 6px;
            line-height: 1.3;
            min-height: 3em; /* Limit title to 2 lines */
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }

        .product-short-desc {
            font-size: 0.9em;
            color: #7f8c8d;
            margin-bottom: 15px;
            line-height: 1.5;
            min-height: 4.5em; /* Limit short description to 3 lines */
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
        }

        .product-price {
            font-size: 1em;
            font-weight: 700;
            color: #e74c3c;
            margin-top: auto; /* Pushes price to the bottom if content above is shorter */
            margin-bottom: 8px;
            display: flex;
            align-items: baseline;
            justify-content: center;
            flex-wrap: wrap; /* Allow prices to wrap on smaller cards */
        }
        .product-regular-price {
            font-size: 0.8em;
            color: #95a5a6;
            text-decoration: line-through;
            margin-left: 8px;
        }
        .product-sku, .product-stock {
            font-size: 0.8em;
            color: #7f8c8d;
            margin-top: 4px;
            display: none;
        }
        .product-stock {
            font-weight: bold;
            color: #27ae60; /* Green for in-stock */
            display:block;
        }
        .product-stock.outofstock {
            color: #e74c3c; /* Red for out-of-stock */
        }
        .no-products-found {
            text-align: center;
            font-size: 1.2em;
            color: #888;
            padding: 50px;
        }

        /* --- Pagination Styles matching new product-card aesthetic --- */
        .pagination-container {
            text-align: center;
            padding: 9px 0;
            margin-top: 30px;
        }

        .pagination-links {
            display: inline-flex;
            border-radius: 8px; /* Matching product card border-radius */
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1); /* Matching product card shadow */
            background-color: #fff; /* White background like cards */
            border: 1px solid #ddd; /* Subtle border like cards */
        }

        .pagination-links a,
        .pagination-links span {
            display: block;
            padding: 12px 20px;
            text-decoration: none;
            color: #34495e; /* Text color matching product titles */
            background-color: #fcfcfc; /* Slightly off-white for non-active links */
            border-right: 1px solid #eee; /* Light separator between links */
            transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
            font-weight: 500;
        }

        .pagination-links a:last-child,
        .pagination-links span:last-child {
            border-right: none; /* No border on the last item */
        }

        .pagination-links a:hover {
            background-color: #eaf1f8; /* Light blue on hover */
            color: #2c3e50;
        }

        .pagination-links .current-page,
        .pagination-links .current-page:hover {
            background-color: #2c3e50; /* Dark background for active page */
            color: #ffffff;
            border-color: #2c3e50;
            cursor: default;
            font-weight: 700;
        }

        .pagination-links .disabled {
            background-color: #f8f8f8;
            color: #b0b0b0;
            cursor: not-allowed;
            border-color: #eee;
        }
        
        /* Hidden class for JavaScript to toggle visibility */
        .product-card.hidden {
            display: none;
        }

        /* Tablet screens (768px and up): 3 columns, 33.33% width each */
        @media (min-width: 500px) {
            .product-catalog {
                grid-template-columns: repeat(3, 1fr); /* 3 columns */
            }
        }
        /* No specific @media (max-width: 599px) for grid anymore,
           as the default 2 columns covers it.
           You can keep it for general padding/centering if desired. */
        @media (max-width: 599px) { /* This will ensure overall layout adjusts */
            
            main.content-area {
                padding: 10px;
                box-shadow: none;
                border-radius: 0;
            }
            h1 {
                font-size: 2em;
                margin-bottom: 20px;
            }
            .product-catalog {
                padding: 0; /* Remove padding if 2 columns too tight on very small screens */
            }
            .product-card {
                /* No longer need max-width for single column, as it's now 2 columns */
                /* width: 100%; is handled by grid's 1fr */
            }
            
            /* Responsive pagination for small screens */
            .pagination-links {
                flex-wrap: wrap; /* Allow links to wrap */
                justify-content: center;
                border-radius: 0;
                box-shadow: none;
                border: none;
                background-color: transparent;
            }
            .pagination-links a,
            .pagination-links span {
                margin: 5px 2px; /* Space out wrapped buttons */
                border-radius: 5px; /* Individual button look */
                border: 1px solid #ddd; /* Individual button border */
                border-right: 1px solid #ddd; /* Ensure right border for all */
                flex-shrink: 0;
            }
            .pagination-links .prev-next-button {
                flex-basis: 100%; /* Make prev/next take full width if needed */
                margin-bottom: 10px;
            }

        }
        /* Desktop screens (992px and up): 4 columns, 25% width each */
        @media (min-width: 768px) {
            .product-catalog {
                grid-template-columns: repeat(4, 1fr); /* 4 columns */
            }
        }

        /* Large desktop screens (1200px and up): 6 columns, 16.66% width each */
        @media (min-width: 1200px) {
            .product-catalog {
                grid-template-columns: repeat(6, 1fr); /* 6 columns */
            }
            main.content-area {
                max-width: 1400px; /* Adjust max-width to allow 6 columns to breathe */
            }
        }


@media screen and (max-width: 700px) { /* From Sheet 2 */
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .sidebar a {
        float: left;
    }
    div.content {
        margin-left: 0;
    }
}
        