/* Custom Header Widget Styles */

.custom-header-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: 120px;
    z-index: 999;
}

/* Desktop Navigation */
.nav-bar {
    position: relative;
    width: 100%;
    height: 80px;
    background: linear-gradient(135deg, #e8e8e87d 0%, #f7e0e0d1 100%);
    border: 2px solid #ddd;
    clip-path: polygon(
        60px 0%, 
        calc(100% - 60px) 0%, 
        calc(100% - 35px) 12%, 
        calc(100% - 20px) 25%, 
        calc(100% - 8px) 40%, 
        100% 50%, 
        calc(100% - 8px) 60%, 
        calc(100% - 20px) 75%, 
        calc(100% - 35px) 88%, 
        calc(100% - 60px) 100%, 
        60px 100%, 
        35px 88%, 
        20px 75%, 
        8px 60%, 
        0% 50%, 
        8px 40%, 
        20px 25%, 
        35px 12%
    ) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 100px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}


.nav-left {
    display: flex;
    gap: 30px;
    flex: 1;
    align-items: center;
}

.nav-right {
    display: flex;
    gap: 25px;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
    margin-right: 40px;
}

.menu-item, 
.contact-item {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.menu-item:hover, 
.contact-item:hover {
    color: #8B0000;
    transform: translateY(-2px);
}

.menu-item i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.menu-item:hover i {
    transform: rotate(180deg);
}

.cta-button {
    background: linear-gradient(135deg, #DAA520, #FFD700);
    color: #333;
    padding: 10px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    border: 1px solid #B8860B;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-block;
}

.cta-button:hover {
    background: linear-gradient(135deg, #B8860B, #DAA520);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.25);
    color: #333;
}

/* Logo Styling */
/* Logo Container - Simplified */
.logo-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.logo {
    /* Remove all background, border, and shape styling */
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    
    /* Only keep size properties */
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-image {
    /* Make image fill the container completely */
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain;
    display: block;
}

/* Remove all logo decorative elements */
.ribbon {
    display: none !important;
}

.ribbon::before,
.ribbon::after {
    display: none !important;
}

/* Hide text logo when using image */
.logo-text,
.logo-subtitle {
    display: none;
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

.mobile-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.mobile-logo img,
.mobile-logo-text {
    height: 40px;
    max-width: 150px;
    object-fit: contain;
}

.mobile-logo-text {
    font-size: 24px;
    font-weight: bold;
    color: #8B0000;
    line-height: 40px;
}

.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    background: none;
    border: none;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Off-Canvas Menu */
.off-canvas-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    transition: right 0.3s ease;
}

.off-canvas-menu.active {
    right: 0;
}

.off-canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.off-canvas-menu.active .off-canvas-overlay {
    opacity: 1;
}

.off-canvas-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 80vw;
    height: 100%;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
}

.off-canvas-menu.active .off-canvas-content {
    transform: translateX(0);
}

.off-canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f8f8;
}

.off-canvas-logo img,
.off-canvas-logo span {
    height: 35px;
    max-width: 120px;
    object-fit: contain;
}

.off-canvas-logo span {
    font-size: 20px;
    font-weight: bold;
    color: #8B0000;
    line-height: 35px;
}

.off-canvas-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    color: #666;
    transition: color 0.3s ease;
}

.off-canvas-close:hover {
    color: #8B0000;
}

.off-canvas-menu-items {
    padding: 20px;
}

.off-canvas-menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.off-canvas-menu-item:hover {
    color: #8B0000;
}

.off-canvas-menu-item:last-child {
    border-bottom: none;
}

.off-canvas-menu-item i {
    font-size: 12px;
    color: #999;
}

.off-canvas-contacts {
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.off-canvas-contact {
    display: block;
    padding: 10px 0;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.off-canvas-contact:hover {
    color: #8B0000;
}

.off-canvas-cta {
    display: block;
    background: linear-gradient(135deg, #DAA520, #FFD700);
    color: #333;
    padding: 15px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.off-canvas-cta:hover {
    background: linear-gradient(135deg, #B8860B, #DAA520);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    color: #333;
}

/* Custom scrollbar for off-canvas */
.off-canvas-content::-webkit-scrollbar {
    width: 6px;
}

.off-canvas-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.off-canvas-content::-webkit-scrollbar-thumb {
    background: #8B0000;
    border-radius: 3px;
}

.off-canvas-content::-webkit-scrollbar-thumb:hover {
    background: #660000;
}

/* Loading animation */
@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.custom-header-container {
    animation: slideInFromTop 0.6s ease-out;
}

/* Focus styles for accessibility */
.menu-item:focus,
.contact-item:focus,
.cta-button:focus,
.mobile-menu-toggle:focus,
.off-canvas-close:focus,
.off-canvas-menu-item:focus {
    outline: 2px solid #8B0000;
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .nav-bar {
        padding: 0 80px;
        clip-path: polygon(50px 0%, calc(100% - 50px) 0%, 100% 50%, calc(100% - 50px) 100%, 50px 100%, 0% 50%);
    }
    
    .nav-left,
    .nav-right {
        gap: 20px;
    }
    
    .nav-right {
        margin-right: 30px;
    }
}

@media (max-width: 1024px) {
    .nav-bar {
        padding: 0 60px;
        clip-path: polygon(40px 0%, calc(100% - 40px) 0%, 100% 50%, calc(100% - 40px) 100%, 40px 100%, 0% 50%);
    }
    
    .nav-left,
    .nav-right {
        gap: 15px;
    }
    
    .nav-right {
        margin-right: 20px;
    }
    
    .menu-item,
    .contact-item {
        font-size: 13px;
    }
    
    .logo {
        width: 90px;
        height: 90px;
    }
    
    .logo-text {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .custom-header-container {
        height: 70px;
    }

    .nav-bar,
    .logo-container {
        display: none !important;
    }
    
    .mobile-nav {
        display: block !important;
    }
    
    .off-canvas-content {
        width: 280px;
    }
}

@media (max-width: 480px) {
    .mobile-header-content {
        padding: 12px 15px;
    }
    
    .mobile-logo img,
    .mobile-logo-text {
        height: 35px;
    }
    
    .mobile-logo-text {
        font-size: 20px;
        line-height: 35px;
    }
    
    .mobile-menu-toggle span {
        width: 22px;
        height: 2px;
    }
    
    .off-canvas-content {
        width: 250px;
    }
    
    .off-canvas-header {
        padding: 15px;
    }
    
    .off-canvas-menu-items {
        padding: 15px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nav-bar {
        border-width: 3px;
        box-shadow: 0 6px 12px rgba(0,0,0,0.3);
    }
    
    .logo {
        border-width: 4px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    }
    
    .menu-item,
    .contact-item,
    .cta-button {
        border: 1px solid transparent;
    }
    
    .menu-item:hover,
    .contact-item:hover {
        border-color: #8B0000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .menu-item,
    .contact-item,
    .cta-button,
    .off-canvas-menu,
    .off-canvas-content,
    .off-canvas-overlay,
    .mobile-menu-toggle span,
    .logo,
    .nav-bar {
        transition: none !important;
        animation: none !important;
    }
    
    .custom-header-container {
        animation: none !important;
    }
    
    .menu-item:hover,
    .contact-item:hover,
    .cta-button:hover,
    .logo:hover {
        transform: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .nav-bar {
        background: linear-gradient(135deg, #e8e8e87d 0%, #f7e0e0d1 100%);
       
    }
    
    .logo {
        background: #2a2a2a;
        border-color: #8B0000;
    }
    
    .logo-subtitle {
        background: #444;
        color: #8B0000;
    }
    
    .mobile-nav {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .off-canvas-content {
        background: #2a2a2a;
    }
    
    .off-canvas-header {
        background: #1a1a1a;
        border-color: #444;
    }
    
    .off-canvas-menu-item,
    .off-canvas-contact {
        color: #e0e0e0;
        border-color: #444;
    }
    
    .off-canvas-menu-item:hover,
    .off-canvas-contact:hover {
        color: #ff6b6b;
    }
    
    .mobile-menu-toggle span {
        background: #e0e0e0;
    }
    
    .off-canvas-close {
        color: #e0e0e0;
    }
    
    .off-canvas-close:hover {
        color: #ff6b6b;
    }
}

/* Print styles */
@media print {
    .custom-header-container {
        display: none !important;
    }
}

/* RTL support */
[dir="rtl"] .nav-left {
    order: 2;
}

[dir="rtl"] .nav-right {
    order: 1;
    margin-right: 0;
    margin-left: 40px;
}

[dir="rtl"] .off-canvas-menu {
    right: auto;
    left: -100%;
}

[dir="rtl"] .off-canvas-menu.active {
    left: 0;
}

[dir="rtl"] .off-canvas-content {
    right: auto;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
}

[dir="rtl"] .off-canvas-menu.active .off-canvas-content {
    transform: translateX(0);
}

[dir="rtl"] .ribbon::before {
    right: -8px;
    left: auto;
    border-width: 8px 0 8px 8px;
    border-color: transparent transparent transparent #f0f0f0;
}

[dir="rtl"] .ribbon::after {
    left: -8px;
    right: auto;
    border-width: 8px 8px 8px 0;
    border-color: transparent #f0f0f0 transparent transparent;
}

/* Accessibility improvements */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 999999;
    padding: 8px 16px;
    background: #000;
    color: #fff;
    text-decoration: none;
}

.skip-link:focus {
    left: 6px;
    top: 7px;
}

/* Loading state */
.custom-header-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.custom-header-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #8B0000;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Sticky header variant */
.custom-header-container.sticky {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
}

.custom-header-container.sticky .nav-bar {
    height: 70px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.custom-header-container.sticky .logo {
    width: 80px;
    height: 80px;
}

.custom-header-container.sticky .logo-text {
    font-size: 24px;
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}