/* =========================================
   UNIT USAHA (PRODUCTS & SERVICES)
   ========================================= */

/* --- 1. MODERN TAB NAVIGATION --- */
.unit-tabs-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.tab-buttons {
    display: inline-flex;
    background: #f1f3f5;
    padding: 5px;
    border-radius: 50px;
    gap: 5px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--gray);
    padding: 10px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.tab-btn i {
    font-size: 1.1rem;
}

.tab-btn:hover {
    color: var(--primary-red);
}

.tab-btn.active {
    background: var(--white);
    color: var(--primary-red);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* --- 2. DYNAMIC INTRO BANNER --- */
.unit-intro-banner {
    display: none;
    /* Hidden by default */
    background: linear-gradient(135deg, var(--white) 0%, #fff5f5 100%);
    padding: 30px 40px;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(220, 20, 60, 0.1);
    align-items: center;
    gap: 25px;
    margin-bottom: 40px;
    animation: fadeIn 0.5s ease;
}

.unit-intro-banner.active {
    display: flex;
}

.unit-intro-banner .intro-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-red);
    color: var(--white);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.unit-intro-banner .intro-text h3 {
    margin-bottom: 5px;
    color: var(--dark);
    font-size: 1.3rem;
}

.unit-intro-banner .intro-text p {
    margin: 0;
    color: var(--gray);
}

@media (max-width: 768px) {
    .unit-intro-banner {
        flex-direction: column;
        text-align: center;
    }

    .tab-buttons {
        flex-direction: column;
        width: 100%;
        border-radius: 12px;
    }

    .tab-btn {
        width: 100%;
        justify-content: center;
    }
}

/* --- 3. PRODUCT GRID SYSTEM --- */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
}

.resource-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    transition: var(--transition);
    position: relative;
    display: none;
    /* Initially hidden for JS filtering */
}

/* Show card when active class is added by JS logic */
/* Note: JS logic usually sets display:block/flex directly or removes hidden class */

.resource-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-5px);
}

/* Badge */
.card-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #ffc107;
    color: #333;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Image Cover */
.resource-cover {
    position: relative;
    height: 220px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.resource-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.resource-card:hover .resource-cover img {
    transform: scale(1.1);
}

/* Overlay Actions (Eye Icon) */
.overlay-actions {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.resource-card:hover .overlay-actions {
    opacity: 1;
}

.btn-action {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--white);
    border: none;
    color: var(--primary-red);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-action:hover {
    background: var(--primary-red);
    color: var(--white);
}

/* Info Section */
.resource-info {
    padding: 20px;
}

.resource-info .category {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.resource-info .category.text-success {
    color: #28a745;
}

.resource-info .category.text-secondary {
    color: #6c757d;
}

.resource-info h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.4;
    color: var(--dark);
    height: 44px;
    /* Limit height for 2 lines */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Price Box */
.price-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-red);
}

.stock,
.unit {
    font-size: 0.85rem;
    color: var(--gray);
}

/* Buttons */
.btn-block {
    display: block;
    width: 100%;
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary-red);
    color: var(--primary-red);
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background: var(--primary-red);
    color: var(--white);
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}