/* ========================================
   PRODUCTS - COMMON STYLES
   ======================================== */

/* Common Product Card Styles */
.product-card-base {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.product-card-base:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image-base {
    position: relative;
    overflow: hidden;
}

.product-image-base img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card-base:hover .product-image-base img {
    transform: scale(1.05);
}

/* Product Content Base */
.product-content-base {
    padding: 20px;
}

.product-title-base {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    color: #333;
}

.product-title-base a {
    color: inherit;
    text-decoration: none;
}

.product-title-base a:hover {
    color: #007bff;
}

.product-brand-base {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.product-description-base {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

/* Button Styles */
.btn-primary-custom {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    transition: background 0.3s ease;
    font-weight: 500;
    display: inline-block;
}

.btn-primary-custom:hover {
    background: #0056b3;
    color: white;
}

.btn-success-custom {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    transition: background 0.3s ease;
    font-weight: 500;
    display: inline-block;
}

.btn-success-custom:hover {
    background: #218838;
    color: white;
}

/* Header Styles */
.page-header-gradient {
    padding: 40px 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.page-header-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.3;
}

.page-header-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.page-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Stats Card */
.stats-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin: -30px auto 40px;
    max-width: 600px;
    position: relative;
    z-index: 3;
}

.stats-grid-base {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    text-align: center;
}

.stat-item-base {
    padding: 15px;
}

.stat-number-base {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    display: block;
}

.stat-label-base {
    color: #666;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Filter and Control Bars */
.control-bar {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.control-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.control-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form Controls */
.form-select-custom {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 0.95rem;
}

.form-input-custom {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 0.95rem;
}

.form-input-custom:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* Search Form */
.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.search-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-btn:hover {
    background: #0056b3;
}

/* Grid Layouts */
.product-grid-base {
    display: grid;
    gap: 25px;
    margin-bottom: 40px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 40px 0;
}

.empty-state-icon {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #333;
    margin-bottom: 15px;
}

.empty-state p {
    color: #666;
    margin-bottom: 25px;
}

/* Pagination */
.pagination-custom {
    margin-top: 40px;
    text-align: center;
}

/* Badges and Tags */
.badge-primary {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-warning {
    background: #ffc107;
    color: #212529;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.tag-item {
    background: #e9ecef;
    color: #495057;
    padding: 6px 12px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tag-item:hover {
    background: #007bff;
    color: white;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .control-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .control-left,
    .control-right {
        justify-content: center;
    }

    .search-form {
        flex-direction: column;
    }

    .search-input {
        min-width: auto;
    }

    .product-grid-base {
        gap: 20px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .stats-grid-base {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.5rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .stats-grid-base {
        grid-template-columns: 1fr;
    }

    .tag-list {
        justify-content: center;
    }
}
