/* ===================================
   UNIDADES PAGE - STYLES
   =================================== */

/* Hero Section */
.units-hero {
    position: relative;
    height: 300px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #077840 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 72px;
    overflow: hidden;
}

.units-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../img/unity01.jpg') center/cover no-repeat;
    opacity: 0.2;
}

.units-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(5, 81, 44, 0.9) 0%, rgba(7, 120, 64, 0.85) 100%);
}

.units-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    padding: 0 20px;
}

.units-hero-content h2 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.units-hero-content h2 span {
    color: #7ee8a8;
}

.units-hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    color: white;
}

@media (max-width: 768px) {
    .units-hero {
        height: 250px;
    }

    .units-hero-content h2 {
        font-size: 2rem;
    }

    .units-hero-content p {
        font-size: 1rem;
    }
}

/* Filter Section */
.units-filter {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 72px;
    z-index: 100;
}

/* Region Menu */
.region-menu {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 0;
}

.region-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid #e9ecef;
    border-radius: 50px;
    background: white;
    color: var(--text-color-heading);
    font-family: var(--font-family-primary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.region-menu-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 81, 44, 0.15);
}

.region-menu-btn.active {
    background: linear-gradient(135deg, #05512C 0%, #077840 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(5, 81, 44, 0.3);
}

.region-menu-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5, 81, 44, 0.4);
}

.region-menu-btn i {
    font-size: 0.9rem;
}

@media (max-width: 576px) {
    .region-menu {
        gap: 8px;
    }

    .region-menu-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .region-menu-btn span {
        display: inline;
    }
}

.search-box {
    position: relative;
}

.search-box .search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1.1rem;
}

.search-box input {
    padding-left: 50px;
    border-radius: 50px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(5, 81, 44, 0.15);
}

/* Region Sections */
.units-region {
    background-color: #ffffff;
}

.units-region.region-alt {
    background-color: #f8f9fa;
}

.region-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
}

.region-header h3 {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.region-header h3 i {
    font-size: 1.2rem;
}

/* Units Grid */
.units-grid {
    gap: 1.5rem 0;
}

/* Unit Cards */
.unit-card-wrapper {
    margin-bottom: 1rem;
}

.unit-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    height: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.unit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

/* MATRIZ Cards - Special Styling */
.matriz-card {
    background: linear-gradient(135deg, #05512C 0%, #077840 100%);
    border: none;
    position: relative;
    overflow: hidden;
}

.matriz-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.matriz-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 35px rgba(5, 81, 44, 0.4);
    border-color: transparent;
}

.matriz-card .unit-card-content h4 {
    color: white;
}

.matriz-card .unit-info p {
    color: rgba(255, 255, 255, 0.9);
}

.matriz-card .unit-info i {
    color: #7ee8a8;
}

.unit-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
    color: #1a1a1a;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.unit-card-content h4 {
    color: var(--text-color-heading);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-right: 60px;
}

.unit-info p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-color-primary);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.unit-info p:last-child {
    margin-bottom: 0;
}

.unit-info i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 3px;
}

/* No Results Message */
.no-results {
    background-color: #f8f9fa;
}

.no-results i {
    color: #6c757d;
}

.no-results h4 {
    color: var(--text-color-heading);
}

.no-results p {
    color: var(--text-color-primary);
}

/* CTA Section */
.units-cta {
    background: linear-gradient(135deg, var(--primary-color) 0%, #077840 100%);
}

.units-cta h3 {
    color: white;
    font-weight: 700;
    margin-bottom: 1rem;
}

.units-cta p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
}

.units-cta .btn {
    font-weight: 700;
    padding: 12px 40px;
    border-radius: 50px;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.units-cta .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .unit-card {
        padding: 1.25rem;
    }

    .unit-card-content h4 {
        font-size: 1.1rem;
    }

    .unit-info p {
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .region-header h3 {
        font-size: 1.3rem;
    }

    .unit-card {
        padding: 1rem;
    }

    .matriz-card:hover {
        transform: translateY(-3px) scale(1.01);
    }
}

/* Animation for cards appearing */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.unit-card-wrapper {
    animation: fadeInUp 0.5s ease forwards;
}

.unit-card-wrapper:nth-child(1) {
    animation-delay: 0.05s;
}

.unit-card-wrapper:nth-child(2) {
    animation-delay: 0.1s;
}

.unit-card-wrapper:nth-child(3) {
    animation-delay: 0.15s;
}

.unit-card-wrapper:nth-child(4) {
    animation-delay: 0.2s;
}

.unit-card-wrapper:nth-child(5) {
    animation-delay: 0.25s;
}

.unit-card-wrapper:nth-child(6) {
    animation-delay: 0.3s;
}

.unit-card-wrapper:nth-child(7) {
    animation-delay: 0.35s;
}

.unit-card-wrapper:nth-child(8) {
    animation-delay: 0.4s;
}

.unit-card-wrapper:nth-child(9) {
    animation-delay: 0.45s;
}

/* Matriz Clickable Card */
.matriz-clickable {
    cursor: pointer;
}

.matriz-clickable::after {
    content: '\f054';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    bottom: 18px;
    right: 18px;
    color: white;
    font-size: 1.1rem;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.matriz-clickable:hover::after {
    background: rgba(255, 255, 255, 0.35);
    transform: translateX(3px) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Unit Clickable Card (non-matriz) */
.unit-clickable {
    cursor: pointer;
}

.unit-clickable::after {
    content: '\f054';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    bottom: 18px;
    right: 18px;
    color: white;
    font-size: 1rem;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #05512C 0%, #077840 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(5, 81, 44, 0.25);
}

.unit-clickable:hover::after {
    transform: translateX(3px) scale(1.1);
    box-shadow: 0 4px 12px rgba(5, 81, 44, 0.35);
}

/* Modal Overlay */
.matriz-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.matriz-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.matriz-modal {
    background: white;
    border-radius: 24px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.matriz-modal-overlay.active .matriz-modal {
    transform: scale(1) translateY(0);
}

/* Modal Close Button */
.matriz-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    color: #333;
    font-size: 1rem;
}

.matriz-modal-close:hover {
    background: white;
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Modal Header */
.matriz-modal-header {
    background: linear-gradient(135deg, #05512C 0%, #077840 100%);
    padding: 40px 30px 30px;
    text-align: center;
    position: relative;
}

.matriz-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.matriz-modal-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    position: relative;
}

.matriz-modal-icon i {
    font-size: 1.8rem;
    color: #7ee8a8;
}

.matriz-modal-header h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 10px;
    position: relative;
}

.matriz-modal-endereco {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    margin: 0;
    position: relative;
    line-height: 1.5;
}

/* Modal Body */
.matriz-modal-body {
    padding: 30px;
}

.matriz-modal-subtitle {
    text-align: center;
    color: #666;
    font-size: 1rem;
    margin: 0 0 25px;
}

/* Modal Buttons */
.matriz-modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.matriz-modal-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 25px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.matriz-modal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.matriz-modal-btn:hover::before {
    opacity: 1;
}

.matriz-modal-btn i {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.matriz-modal-btn span {
    flex: 1;
}

/* WhatsApp Button */
.matriz-modal-btn-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.35);
}

.matriz-modal-btn-whatsapp:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(37, 211, 102, 0.45);
    color: white;
    text-decoration: none;
}

/* Maps Button */
.matriz-modal-btn-maps {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.35);
}

.matriz-modal-btn-maps:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(107, 114, 128, 0.45);
    color: white;
    text-decoration: none;
}

/* Modal Responsive */
@media (max-width: 480px) {
    .matriz-modal {
        border-radius: 20px;
    }

    .matriz-modal-header {
        padding: 35px 25px 25px;
    }

    .matriz-modal-icon {
        width: 60px;
        height: 60px;
    }

    .matriz-modal-icon i {
        font-size: 1.5rem;
    }

    .matriz-modal-header h3 {
        font-size: 1.3rem;
    }

    .matriz-modal-body {
        padding: 25px;
    }

    .matriz-modal-btn {
        padding: 16px 20px;
        font-size: 0.95rem;
    }

    .matriz-modal-btn i {
        font-size: 1.2rem;
    }
}