/* Product Shop CSS */

/* Container Styles */
.product-shop-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Search Form Styles */
.product-search-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-fields {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.search-fields input[type="text"] {
    flex: 2;
    min-width: 200px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-fields select {
    flex: 1;
    min-width: 150px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-fields button {
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.search-fields button:hover {
    background: #005177;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.product-item {
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.product-item:hover,
.product-item.product-hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-item:hover .product-image img {
    transform: scale(1.05);
}

.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f5f5f5;
    color: #666;
    font-size: 14px;
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    line-height: 1.3;
}

.product-info h3 a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s;
}

.product-info h3 a:hover {
    color: #0073aa;
}

.product-price {
    font-size: 20px;
    font-weight: bold;
    color: #e47911;
    margin: 10px 0;
}

.product-stock {
    font-size: 14px;
    color: #666;
    margin: 5px 0;
}

.product-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin: 10px 0;
}

.view-product-btn {
    display: inline-block;
    background: #0073aa;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
    margin-top: 10px;
}

.view-product-btn:hover {
    background: #005177;
    color: white;
}

/* Pagination */
.products-pagination {
    text-align: center;
    margin: 40px 0;
}

.products-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 3px;
    background: #f7f7f7;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
}

.products-pagination .page-numbers:hover,
.products-pagination .page-numbers.current {
    background: #0073aa;
    color: white;
}

/* Single Product Page */
.single-product-details {
    max-width: 800px;
    margin: 0 auto;
}

.product-meta {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.product-meta p {
    margin: 0;
    font-weight: bold;
}

.product-price {
    color: #e47911;
    font-size: 18px;
}

.user-balance {
    color: #28a745;
}

.total-price {
    color: #dc3545;
    font-size: 16px;
}

/* Order Form */
.order-form {
    background: white;
    border: 2px solid #0073aa;
    border-radius: 8px;
    padding: 25px;
    margin: 30px 0;
}

.order-form h4 {
    margin-top: 0;
    color: #0073aa;
}

.order-form label {
    display: block;
    margin: 15px 0 5px 0;
    font-weight: bold;
}

.order-form input[type="number"],
.order-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.order-form textarea {
    min-height: 80px;
    resize: vertical;
}

.order-form button {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 15px;
}

.order-form button:hover {
    background: #218838;
}

#order-result {
    margin-top: 20px;
}

.success-message {
    color: #28a745;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 10px;
    border-radius: 4px;
}

.error-message {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 4px;
}

/* User Orders */
.user-orders {
    max-width: 800px;
    margin: 0 auto;
}

.orders-tabs {
    display: flex;
    border-bottom: 2px solid #e1e1e1;
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 16px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    border-bottom-color: #0073aa;
    color: #0073aa;
    font-weight: bold;
}

.tab-btn:hover {
    background: #f5f5f5;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.order-item {
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.order-item p {
    margin: 8px 0;
}

.order-item strong {
    color: #333;
}

/* Admin Orders */
.admin-orders {
    max-width: 1000px;
    margin: 0 auto;
}

.admin-order {
    border-left: 4px solid #ffc107;
    position: relative;
}

.complete-order-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.complete-order-btn:hover {
    background: #218838;
}

.complete-order-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.success-notice {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-shop-container {
        padding: 15px;
    }
    
    .search-fields {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-fields input[type="text"],
    .search-fields select {
        min-width: auto;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .product-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .orders-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        border-bottom: 1px solid #e1e1e1;
        border-right: none;
    }
    
    .tab-btn.active {
        border-bottom-color: #0073aa;
        border-left: 3px solid #0073aa;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-item {
        margin-bottom: 20px;
    }
    
    .order-form {
        padding: 20px 15px;
    }
}