/* GLOBAL FIXES & SMOOTH SCROLL */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important; 
    position: relative; 
}

/* Custom Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: white;
    overflow: hidden;
}
.triangle-left, .triangle-right {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    z-index: 2;
}
.triangle-left {
    left: 0;
    background-color: #1e3a8a;
    clip-path: polygon(0 0, 100% 0, 0 100%);
}
.triangle-right {
    right: 0;
    background-color: #dc2626; 
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.hero-pattern {
    background-color: #0f172a;
    background-image: url("images/comat.png");
    background-blend-mode: overlay;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    width: 100%;
}

.product-card-img {
    height: 220px;
    object-fit: cover;
    width: 100%;
    transition: transform 0.5s ease;
}
.product-card:hover .product-card-img {
    transform: scale(1.05);
}

/* Gallery Styles - Responsive Aspect Ratio */
.gallery-container {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #e2e8f0;
}

.gallery-slide {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover; 
    object-position: center;
    transition: opacity 0.5s ease-in-out;
}

.gallery-slide.active {
    display: block;
    animation: fadeIn 0.5s;
}
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    border: 1px solid rgba(255,255,255,0.2);
}
.nav-arrow:hover {
    background: #dc2626;
    border-color: #dc2626;
}
.prev-arrow { left: 15px; }
.next-arrow { right: 15px; }

/* Mobile Menu Animation */
#mobile-menu {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-20px) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    pointer-events: none !important;
}

#mobile-menu.menu-active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: white;
    -webkit-box-shadow: 0 0 0px 1000px #111827 inset;
    transition: background-color 5000s ease-in-out 0s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body.stop-scrolling {
    height: 100vh;
    overflow: hidden !important;
}

/* Hover Nested Dropdown Fixes */
.group:hover .group-hover\:block {
    display: block;
}

/* Hide scrollbar for dropdown menus if too long */
.overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}
.overflow-y-auto::-webkit-scrollbar-track {
    background: #f1f1f1; 
}
.overflow-y-auto::-webkit-scrollbar-thumb {
    background: #ccc; 
    border-radius: 3px;
}
.overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #aaa; 
}


#logistic-text-wrapper {
    transition: max-height 0.5s ease-in-out;
}

@media (min-width: 768px) {
    #logistic-text-wrapper {
        max-height: none !important; /* Pe desktop arata tot textul mereu */
    }
}

#logistic-text-wrapper {
    transition: max-height 0.5s ease-in-out;
}


/* Highlight produs după navigare (scroll + focus) */
@keyframes productFocusPulse {
  0%   { transform: scale(1);   box-shadow: 0 0 0 0 #092052; }
  40%  { transform: scale(1.02); box-shadow: 0 0 0 10px #041a49; }
  100% { transform: scale(1);   box-shadow: 0 0 0 0 #010714; }
}

.product-focus {
  outline: 5px solid #010b22;
  outline-offset: 4px;
  border-radius: 12px;
animation: productFocusPulse 1.1s ease-in-out 0s 5;
}