/* Form container */
.add-product-section {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background-color: none;
    border-radius: 8px;
    box-shadow: none;
}

.add-product-section h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
}

/* Form elements */
#add-product-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
    margin-top: 10px;
}

#add-product-form input,
#add-product-form textarea,
#add-product-form select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

#add-product-form textarea#product-blurb {
    resize: vertical;
    height: 60px;
}

#add-product-form input:focus,
#add-product-form textarea:focus,
#add-product-form select:focus {
    border-color: #EF5A10;
    outline: none;
    box-shadow: 0 0 4px rgba(0, 123, 255, 0.25);
}

#add-product-form button {
    width: 100%;
    padding: 10px;
    background-color: #EF5A10;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#add-product-form button:hover {
    background-color: #d64700;
}

/* Align category fields in a row */
.category-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.category-row .form-group {
    flex: 1;
}

.category-row select {
    width: 100%;
}

/* Align name and brand fields in a row */
.name-brand-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.name-brand-row .form-group {
    flex: 1;
}

.name-brand-row select,
.name-brand-row input {
    width: 100%;
}

/* Quill editor styles */
#product-description-editor {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background-color: #fff;
    font-size: 14px;
    font-family: 'Roboto', Arial, sans-serif;
    box-sizing: border-box;
    min-height: 200px;
}

/* Quill toolbar styles */
#toolbar {
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    padding: 5px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

#toolbar .ql-formats {
    display: flex;
    gap: 5px;
}

#toolbar button,
#toolbar select {
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    padding: 5px;
    cursor: pointer;
    font-size: 14px;
}

#toolbar button:hover,
#toolbar select:hover {
    background-color: #e0e0e0;
}

#toolbar button.ql-active {
    background-color: #d0d0d0;
}

#toolbar select {
    padding: 5px 10px;
}

/* Product card grid styles */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Ensure 4 cards per row */
    gap: 20px;
    padding: 20px;
}

@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(1, 1fr); /* 3 cards per row for medium screens */
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(1, 1fr); /* 2 cards per row for small screens */
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr; /* 1 card per row for very small screens */
    }
}

.product-card {
    position: relative; /* Enable positioning for child elements */
    max-width: 100%;
    background-color: #fff;
    border: none;
    border-radius: 8px;
    box-shadow: none;
    text-align: center;
    padding: 15px;
    transition: transform 0.3s ease;
}

.product-card .status-ribbon {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #EF5A10 ; /* Default color for the ribbon */
    color: #fff;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    z-index: 2;
    text-transform: uppercase;
}

.brand-label {
    position: absolute;
    top: 185px;
    right: 35px;
    width: 40px;
    height: 40px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

@media (max-width: 768px) {
    .brand-label {
        top: 140px; /* Adjust position for smaller screens */
        right: 35px;
        width: 30px; /* Reduce size for mobile view */
        height: 30px;
    }
}

.brand-label img {
    max-width: 100%; /* Adjust size to fit within the label */
    max-height: 100%; /* Adjust size to fit within the label */
    border-radius: 50%;
    object-fit: contain; /* Ensure the image fits without distortion */
    margin: auto; /* Center the image */
}

.brand-image {
    max-width: 100px;
    max-height: 60px;
    margin-bottom: 5px; /* Add spacing below the brand image */
    object-fit: contain;
    display: block;
}

.product-card img {
    width: 100%;
    object-fit: cover; /* Ensures the image fits within the container without distortion */
    border-radius: 8px 8px 8px 8px;
    margin-bottom: 10px;
}

.product-card h3 {
    font-size: 18px;
    color: #333;
    margin: 10px 0;
}

.product-card p {
    font-size: 16px;
    color: #666;
    font-weight: bold;
    margin: 5px 0; /* Reduced margin to decrease space between paragraphs */
}

.product-card .product-blurb {
    font-size: 14px;
    font-weight: 100;
    color: #666;
    margin: 10px 0;
    line-height: 1.4;
}

.product-card:hover {
    transform: none;
    box-shadow: none;
}

.product-card h3,
.product-card .product-blurb,
.product-card p {
    text-align: left; /* Align text to the left */
}

.product-card .product-category {
    font-size: 12px;
    font-weight: 100;
    color: #999;
    margin: 5px 0;
    line-height: 1.2;
    text-align: left; /* Align text to the left */
}

.product-image {
    width: 100%;
    height: auto;
    object-fit: cover; /* Ensures the image fits within the container without distortion */
    border-radius: 8px 8px 0 0;
    transition: opacity 0.3s ease; /* Smooth transition for image changes */
}

/* Adjust spacing for product description paragraphs */
#product-description p {
    margin: 3px 0; /* Further reduced margin for paragraphs inside product description */
}

/* Product management table styles */
.manage-products-section {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: none;
    border-radius: 8px;
    box-shadow: none;
}

.manage-products-section h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.product-table th,
.product-table td {
    border-bottom: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    font-size: 12px; /* Reduced font size */
}

.product-table th {
    background-color: #999;
    color: #fff;
    font-weight: bold;
}

.product-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.product-table tr:hover {
    background-color: #e9ecef;
}

.product-table .action-buttons {
    display: flex;
    gap: 10px;
}

.product-table .action-buttons button {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px; /* Reduced font size */
}

.product-table .action-buttons .delete-btn {
    background-color: #dc3545;
    color: #fff;
}

.product-table .action-buttons .toggle-btn {
    background-color: #28a745;
    color: #fff;
}

.sales-price-input {
    width: 100%;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    box-sizing: border-box;
}

/* Slider styles */
.slider {
    position: relative;
    max-width: 100%; /* Increase the width to make the slider wider */
    margin: 10px auto;
    overflow: hidden;
    aspect-ratio: 16 / 9; /* Maintain the aspect ratio */
}

.slider-images {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.slider-image {
    min-width: 100%;
    display: none;
}

.slider-image.active {
    display: block;
}

.slider-image img {
    width: 100%;
    border-radius: 8px;
    aspect-ratio: 16 / 9; /* Ensure images maintain the same aspect ratio */
}

.slider-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: none;
    color: #d64700;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
}

.slider-button.prev {
    left: 20px;
}

.slider-button.next {
    right: 20px;
}

.slider-button:hover {
    color: #dc3545;
}

/* Layout for product view */
.product-main {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.slider {
    flex: 0 0 70%; /* Slider takes 60% of the width */
    max-width: 605px; /* Fixed width for the slider */
}

.product-info {
    flex: 0 0 30%; /* Product info takes 40% of the width */
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px; /* Standardized spacing between child elements */
}

.product-info h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 5px; /* Reduced margin below the product name */
}

.product-info p {
    font-size: 16px;
    color: #666;
    margin: 1px 0; /* Further reduced margin for product info paragraphs */
}

.product-info p#product-category {
    font-size: 14px; /* Reduced font size for product category */
    color: #666;
    margin-bottom: 5px; /* Reduced margin below the category */
}

#product-prices {
    display: flex;
    align-items: center;
    gap: 10px; /* Standardized spacing between price elements */
}

#product-price {
    font-size: 18px;
    color: #666;
    margin: 0;
}

.sales-price {
    font-size: 18px;
    color: #28a745; /* Highlight sales price */
    font-weight: bold;
    margin: 0;
}

.product-description {
    margin-top: 20px;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

.product-name {
    font-size: 12px;
    color: #666;
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-main {
        flex-direction: column;
    }

    .slider {
        max-width: 100%;
    }

    .product-info {
        flex: 0 0 auto;
    }
}

/* Styles for the status label next to the product name */
.product-header {
    display: flex;
    flex-direction: column; /* Stack elements vertically */
    align-items: flex-start; /* Left-align the brand image, product name, and status label */
    gap: 8px; /* Standardized spacing between elements in the header */
}

.status-label {
    display: inline-block;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.brand-name {
    font-size: 12px;
    color: #666;
    font-weight: bold;
    margin: -2; /* Remove individual margin */
    display: block;
}

br {
    display: block; /* Ensure <br> behaves like a block element */
    margin: 2px 0; /* Add consistent vertical spacing */
}

.product-link {
    text-decoration: none; /* Remove underline from product card links */
    color: inherit; /* Ensure text color is inherited */
}

.brand-image {
    max-width: 100px;
    max-height: 60px;
    margin: 0; /* Remove individual margin */
}

#product-name {
    font-size: 24px;
    color: #333;
    margin: 0; /* Remove individual margin */
}

#product-category {
    font-size: 14px;
    color: #666;
    margin: 0; /* Remove individual margin */
}

#product-price,
.sales-price {
    margin: 0; /* Remove individual margin */
}

#product-status {
    margin: 0; /* Remove individual margin */
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 50%;
    border-radius: 8px;
    text-align: center;
}

.modal-content h2 {
    margin-bottom: 20px;
}

.modal-content input[type="file"] {
    margin-bottom: 20px;
}

.modal-content ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.modal-content li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-image-preview {
    max-width: 100px;
    max-height: 100px;
    border-radius: 4px;
    margin-right: 10px;
}

.delete-image-btn {
    background-color: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
}

.delete-image-btn:hover {
    background-color: #c82333;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    background-color: transparent;
    border: none;
    outline: none;
    transition: color 0.3s ease;
}

.close:hover {
    color: #dc3545; /* Highlight color on hover */
}

#evolve-category {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

#evolve-category:focus {
    border-color: #EF5A10;
    outline: none;
    box-shadow: 0 0 4px rgba(0, 123, 255, 0.25);
}

.evolve-category-dropdown {
    width: 100%;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    box-sizing: border-box;
}

/* Filter bar styles */
.filter-bar {
    display: flex;
    justify-content: center;
    border-radius: 5px;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    background-color: #f9f9f9;
    border-bottom: none;
    margin-bottom: 20px;
    flex-wrap: wrap; /* Allow wrapping for smaller screens */
}

.filter-bar select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    width: 200px;
    box-sizing: border-box;
}

.filter-bar button {
    padding: 10px 20px;
    background-color: #EF5A10;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.filter-bar button:hover {
    background-color: #d64700;
}

/* Mobile-friendly adjustments */
@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column; /* Stack elements vertically */
        gap: 10px; /* Reduce gap between elements */
    }

    .filter-bar select,
    .filter-bar button {
        width: 100%; /* Make elements take full width */
    }
}
