/* Koplietojamas galvenes (header/nav) stili. */

/* AUGŠĒJĀ INFORMĀCIJAS JOSLA (TELEFONS, E-PASTS, SOCIĀLIE MEDIJI) */
.header-top-bar {
    background-color: #520505;
    color: white;
    padding: 8px 0;
    border-bottom: 2px solid #ffcc00;
}

/* GALVENAIS KONTEINERS VISAM SATURAM */
.containerr {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* KONTAKTINFORMĀCIJAS DAĪĻA */
.contact-info {
    display: flex;
    gap: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-icon {
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-icon i {
    font-size: 14px;
    color: #ffcc00;
}

.contact-text {
    display: flex;
    flex-direction: column;
}

.contact-label {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 2px;
}

.phone-link, .email-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s;
}

.phone-link:hover, .email-link:hover {
    color: #ffcc00;
}

/* SOCIĀLO MEDIJU IKONU DAĪĻA */
.social-media {
    display: flex;
    gap: 15px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: white;
    transform: translateY(-2px);
}

.social-link:hover i {
    color: #a01414;
}

.social-link i {
    font-size: 14px;
    transition: color 0.3s;
}

/* GALVENĀS NAVIGĀCIJAS DAĪĻA */
.header-main {
    background-color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: visible;
}

/* LOGO DAĪĻA */
.logo {
    flex: 0 0 auto;
    margin-right: 22px;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-image {
    max-height: 80px;
    width: auto;
    border-radius: 12px;
    transition: transform 0.3s;
}

.logo-image:hover {
    transform: scale(1.02);
}

/* AIZSTĀJĒJLOGO, JA LOGO ATTĒLS NAV ATRASTS */
.logo-fallback {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #520505, #8d0f0f);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 64, 128, 0.2);
}

.logo-icon i {
    font-size: 28px;
    color: white;
}

.logo-text h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #520505;
    line-height: 1.2;
}

.logo-text p {
    margin: 5px 0 0;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* GALVENĀ NAVIGĀCIJAS IZVĒLNE */
.main-navigation {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}

/* Palielināts starps viņu elementiem */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 14px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s;
    white-space: nowrap;
}

.nav-link span {
    white-space: nowrap;
}

.nav-link i {
    font-size: 16px;
    color: #7c0f0f;
}

.nav-link:hover {
    background-color: #f0f7ff;
    color: #911010;
}

.nav-link.active {
    background: linear-gradient(135deg, #520505, #8d0f0f);
    color: white;
}

.nav-link.active i {
    color: white;
}

/* MOBĪLĀS IZVĒLNES POGA */
.mobile-menu-toggle { 
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #660d0d;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.mobile-menu-toggle:hover {
    background-color: #f0f7ff;
}

/* ===== DROPDOWN SUBMENU STILI ===== */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > a {
    display: flex;
    justify-content: flex-start;  /* Mainīts no space-between uz flex-start */
    align-items: center;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
    gap: 5px;  /* Pievienots gap starp ikonu un tekstu */
}

.dropdown-submenu > a i:first-child {
    font-size: 14px;
    width: 18px;
    margin-right: 0;  /* Noņemts margin-right, izmantojam gap */
}

.dropdown-submenu > a .menu-text {
    display: flex;
    align-items: center;
    gap: 5px;
}

.submenu-arrow {
    font-size: 12px;
    transition: transform 0.3s;
    margin-left: auto;  /* Bultiņa paliek labajā pusē */
}

.dropdown-submenu > a:hover {
    background-color: #f0f7ff;
    color: #851010;
    padding-left: 25px;
}

.dropdown-submenu:hover .submenu-arrow {
    transform: translateX(3px);
}

.submenu {
    position: absolute;
    top: 0;
    left: 100%;
    min-width: 220px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    pointer-events: none;
}

.dropdown-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(5px);
    pointer-events: auto;
}

.submenu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    font-size: 14px;
}

.submenu li a i {
    width: 20px;
    font-size: 14px;
    color: #700c0c;
}

.submenu li a:hover {
    background-color: #f0f7ff;
    color: #851010;
    padding-left: 25px;
}

.submenu li a.active {
    background-color: #e6f0ff;
    color: #520505;
    font-weight: 500;
}

/* ===== DROP-DOWN MENU ===== */

/* APAKŠIZVĒLŅU KONTEINERS */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 240px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

/* APAKŠIZVĒLNES ELEMENTU STILI */
.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    font-size: 14px;
    pointer-events: auto;
}

.dropdown-menu a:hover {
    background-color: #f0f7ff;
    color: #851010;
    padding-left: 25px;
}

/* APAKŠIZVĒLNES IKONU KRĀSAS */
.dropdown-menu i {
    color: #700c0c;
    width: 18px;
    text-align: center;
}

/* AKTĪVĀS APAKŠIZVĒLNES SAITES */
.dropdown-menu a.active {
    background-color: #e6f0ff;
    color: #520505;
    font-weight: 500;
}

/* APAKŠIZVĒLNES BULTIŅA */
.dropdown-arrow {
    font-size: 12px;
    margin-left: 5px;
    transition: transform 0.3s;
}

/* ===== GALVENAIS HOVER FIX - VIENOTĀ VERSIJA ===== */

/* HOVER efekts - TIKAI VIENA DEFINĪCIJA */
.nav-item.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-item.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Keyboard and focus support */
.nav-item.dropdown:focus-within .dropdown-menu,
.nav-item.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* MOBĪLĀS NAVIGĀCIJAS PĀRKLĀJUMS */
.mobile-navigation-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-navigation {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background-color: white;
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-navigation.active {
    right: 0;
}

.mobile-navigation-overlay.active {
    display: block;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(to right, #520505, #8d0f0f);
    color: white;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.mobile-logo i {
    font-size: 20px;
}

.mobile-nav-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.mobile-nav-menu {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    flex: 1;
}

.mobile-nav-menu li {
    border-bottom: 1px solid #eee;
}

.mobile-nav-menu a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.mobile-nav-menu a:hover,
.mobile-nav-menu a.active {
    background-color: #f0f7ff;
    color: #800d0d;
}

.mobile-nav-menu i {
    width: 20px;
    text-align: center;
}

.mobile-contact {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-phone,
.mobile-email {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #860808;
    text-decoration: none;
    padding: 8px 0;
}

/* ATBILDĪGAIS DIZAINS (RESPONSIVE) */
@media (max-width: 992px) {
    .contact-info {
        gap: 20px;
    }
    
    .nav-link {
        padding: 10px 15px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .header-top-bar {
        padding: 10px 0;
    }
    
    .top-bar-content {
        justify-content: center;
        gap: 15px;
    }
    
    .contact-info {
        order: 2;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .social-media {
        order: 1;
    }
    
    .main-navigation {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .logo-image {
        max-height: 60px;
    }
    
    .logo-fallback .logo-text h1 {
        font-size: 16px;
    }

    .logo {
        margin-right: 12px;
    }

    .nav-menu {
        gap: 10px;
    }
    
    /* Paslēpt desktop dropdown mobilajā versijā */
    .dropdown-menu {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .contact-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 5px;
    }
    
    .contact-text {
        align-items: center;
    }
}

/* MOBĪLĀS APAKŠIZVĒLNES KONTEINERS */
.mobile-dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #f9f9f9;
    list-style: none;
    padding-left: 20px;
}

/* ATVĒRTAS MOBĪLĀS APAKŠIZVĒLNES */
.mobile-dropdown.open .mobile-dropdown-menu {
    max-height: 500px;
}

/* MOBĪLĀS APAKŠIZVĒLNES SAITES */
.mobile-dropdown-menu li {
    border-bottom: none;
}

.mobile-dropdown-menu a {
    padding: 12px 20px;
    font-size: 14px;
    color: #555;
    pointer-events: auto;
}

.mobile-dropdown-menu a:hover {
    background-color: #eef5ff;
    color: #8d0f0f
}

/* MOBĪLĀS APAKŠIZVĒLNES BULTIŅA */
.mobile-dropdown-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s;
}

.mobile-dropdown.open .mobile-dropdown-arrow {
    transform: rotate(90deg);
}

/* MOBĪLĀS APAKŠIZVĒLNES IKONAS */
.mobile-dropdown-menu i {
    width: 18px;
    text-align: center;
    color: #8d0f0f;
}

/* MOBĪLĀS APAKŠIZVĒLNES ELEMENTU ATSTARPES */
.mobile-dropdown-menu li:last-child a {
    border-bottom: none;
}

/* MOBĪLĀ VERSIJA DROPDOWN SUBMENU */
@media (max-width: 768px) {
    .dropdown-submenu {
        position: static;
    }
    
    .submenu {
        position: static;
        left: 0;
        box-shadow: none;
        padding-left: 20px;
        background: #f9f9f9;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        transition: max-height 0.3s ease;
        pointer-events: auto;
        margin-top: 0;
        border-radius: 0;
    }
    
    .dropdown-submenu.open .submenu {
        max-height: 300px;
    }
    
    .dropdown-submenu > a {
        justify-content: space-between;
    }
    
    .dropdown-submenu.open .submenu-arrow {
        transform: rotate(90deg);
    }
    
    .submenu li a {
        padding: 10px 20px;
    }
}