/* Product Manager Styles */

/* Form Styles */
.pm-form-container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pm-form-row {
    margin-bottom: 20px;
}

.pm-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.pm-form-row input,
.pm-form-row textarea,
.pm-form-row select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.pm-form-row textarea {
    min-height: 100px;
}

.pm-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.pm-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.pm-btn-primary {
    background: #2271b1;
}

.pm-btn-primary:hover {
    background: #135e96;
}

/* Image Upload Styles */
.pm-image-upload {
    position: relative;
}

.pm-image-preview-container {
    margin-top: 10px;
}

.pm-image-preview-container img {
    max-width: 100px;
    max-height: 100px;
    display: inline-block;
    margin-right: 10px;
}

.pm-delete-image {
    background: #e63f3f;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
}

.pm-delete-image:hover {
    background: #c52f2f;
}

.pm-gallery-preview {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pm-gallery-item {
    position: relative;
    display: inline-block;
}

.pm-gallery-item img {
    max-width: 100px;
    max-height: 100px;
}

.pm-gallery-item button {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e63f3f;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
}

/* Sizes Container */
.pm-sizes-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pm-size-option {
    display: inline-block;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pm-size-option input[type="checkbox"] {
    margin-right: 5px;
}

.pm-size-option:hover {
    background: #e0e0e0;
}

.pm-size-option input[type="checkbox"]:checked + * {
    background: #0073aa;
    color: white;
}

/* Category Pills */
.pm-categories-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pm-category-pill {
    display: inline-block;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.pm-category-pill input[type="checkbox"] {
    margin-right: 5px;
}

.pm-category-pill:hover {
    background: #e0e0e0;
}

.pm-category-pill input[type="checkbox"]:checked + * {
    background: #2271b1;
    color: white;
}

/* Product Grid Styles */
#product-grid-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.pm-filters {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.pm-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
}

.pm-filter-item {
    flex: 1;
    min-width: 200px;
}

.pm-filter-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.pm-search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.pm-search-results {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    width: calc(100% - 2px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pm-search-result-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.pm-search-result-item:hover {
    background: #f5f5f5;
}

.pm-no-results {
    padding: 10px;
    color: #666;
    font-style: italic;
}

.pm-search-select {
    width: 100% !important;
    min-height: 40px;
}

.pm-filter-actions {
    margin-top: 15px;
    text-align: right;
}

.pm-results-info {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    font-weight: bold;
}

.pm-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.pm-product-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
    position: relative;
}

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

.pm-product-image {
    height: 200px;
    overflow: hidden;
}

.pm-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pm-product-info {
    padding: 15px;
}

/* Status Badges */
.pm-status-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pm-status-online {
    background: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
    border: 1px solid #2e7d32;
}

.pm-status-offline {
    background: rgba(158, 158, 158, 0.1);
    color: #616161;
    border: 1px solid #616161;
}

.pm-status-pending {
    background: rgba(244, 67, 54, 0.1);
    color: #c62828;
    border: 1px solid #c62828;
}

.pm-product-info h3 {
    margin: 25px 0 15px 0;
    font-size: 16px;
    line-height: 1.4;
}

/* Product Details */
.pm-product-details {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
    border-left: 3px solid #0073aa;
}

.pm-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.pm-detail-row:last-child {
    margin-bottom: 0;
}

.pm-detail-label {
    font-weight: 600;
    color: #555;
}

.pm-detail-value {
    color: #333;
    text-align: right;
}

.pm-price {
    font-size: 18px;
    font-weight: bold;
    color: #0073aa;
    margin: 15px 0;
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.pm-regular-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 10px;
}

.pm-sale-price {
    color: #e63f3f;
    font-weight: bold;
}

.pm-actions {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pm-actions .pm-btn {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    font-size: 13px;
    text-align: center;
}

/* Action Button Colors */
.pm-edit-product {
    background: #0073aa;
}

.pm-edit-product:hover {
    background: #005a87;
}

.pm-take-offline {
    background: #ff9800;
}

.pm-take-offline:hover {
    background: #f57c00;
}

.pm-show-online {
    background: #4caf50;
}

.pm-show-online:hover {
    background: #388e3c;
}

.pm-make-pending {
    background: #9e9e9e;
}

.pm-make-pending:hover {
    background: #757575;
}

.pm-delete-product {
    background: #e63f3f;
}

.pm-delete-product:hover {
    background: #c52f2f;
}

/* Pagination Styles */
.pm-pagination {
    margin-top: 30px;
    text-align: center;
}

.pm-pagination-links {
    display: inline-block;
}

.pm-page-link {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pm-page-link:hover {
    background: #0073aa;
    color: white;
}

.pm-page-link.active {
    background: #0073aa;
    color: white;
}

/* Modal Styles */
.pm-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.pm-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.pm-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.pm-close:hover {
    color: #000;
}

/* Overlay Styles */
.pm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pm-loading {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.pm-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sizes Selector on Product Page */
.pm-sizes-selector {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.pm-sizes-selector h4 {
    margin-bottom: 10px;
    color: #333;
}

.pm-size-options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pm-size-option-label {
    display: inline-block;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pm-size-option-label input[type="radio"] {
    margin-right: 5px;
}

.pm-size-option-label:hover {
    background: #e0e0e0;
}

.pm-size-option-label input[type="radio"]:checked + * {
    background: #0073aa;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pm-products-grid {
        grid-template-columns: 1fr;
    }
    
    .pm-filter-row {
        flex-direction: column;
    }
    
    .pm-filter-item {
        min-width: 100%;
    }
    
    .pm-actions {
        flex-direction: column;
    }
    
    .pm-actions .pm-btn {
        min-width: 100%;
    }
    
    .pm-pagination-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pm-page-link {
        margin: 2px;
    }
    
    .pm-product-details {
        padding: 10px;
    }
    
    .pm-detail-row {
        flex-direction: column;
        margin-bottom: 5px;
    }
    
    .pm-detail-value {
        text-align: left;
        margin-top: 2px;
    }
}