/* Custom animations and base styles */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

main>.relative.z-10 {
    animation: fadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

html {
    scroll-behavior: smooth;
}

.hero-title {
    font-size: clamp(48px, 10vw, 92px);
    line-height: 1;
    letter-spacing: -0.02em;
}

/* Ensure video covers full viewport and stays sharp */
.hero-video {
    image-rendering: -webkit-optimize-contrast;
    object-position: center 5%;
    /* Lifting the focal point to show the robot's head clearly */
    transition: transform 0.6s ease;
}

/* Mobile specific video zoom */
@media (max-width: 768px) {
    .hero-video {
        transform: scale(1.1);
        object-position: center 70%;
        image-rendering: auto;
    }

    .mobile-title {
        font-size: clamp(32px, 8vw, 42px) !important;
        line-height: 1.1;
    }
}

.hero-overlay {
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.2) 0%,
            rgba(0, 0, 0, 0.4) 50%,
            rgba(0, 0, 0, 0.7) 100%);
}

.btn-primary-ai {
    background: #fff;
    color: #000;
    padding: 14px 32px;
    border-radius: 40px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary-ai:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.2);
}

/* Chatbot input field styles */
#chat-input {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 12px 20px;
    color: #fff;
    width: 100%;
    box-sizing: border-box;
}

#chat-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#chat-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.15);
}

.no-scroll {
    overflow: hidden !important;
}

html {
    scroll-behavior: smooth;
}

section {
    position: relative;
    z-index: 5;
}

#navbar {
    color: white;
}

#navbar.nav-scrolled {
    color: #44170e;
    padding-top: 1rem;
    padding-bottom: 1rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(68, 23, 14, 0.1);
}

#navbar.nav-scrolled button {
    color: #44170e;
}

/* Service Item Enhancements */
.service-item {
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.service-item h4 {
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.service-item:hover {
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.1);
}

/* CTA & Footer Polish */
#contact-cta {
    background-image: radial-gradient(circle at 10% 20%, rgba(115, 48, 33, 0.4) 0%, transparent 50%);
}

#back-to-top {
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

#back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(68, 23, 14, 0.2);
}

@keyframes wave {
    0% {
        transform: scale(1);
        opacity: 0.1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.2;
    }

    100% {
        transform: scale(1);
        opacity: 0.1;
    }
}

#contact-cta svg {
    animation: wave 10s infinite linear;
}

/* Products Fan Carousel */
.perspective-px {
    perspective: 2000px;
}

.product-card {
    position: absolute;
    width: 320px;
    height: 480px;
    background: #fff;
    border-radius: 2.5rem;
    overflow: hidden;
    box-shadow: 0 30px 60px -12px rgba(68, 23, 14, 0.15);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center bottom;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    will-change: transform, opacity;
}

@media (min-width: 768px) {
    .product-card {
        width: 400px;
        height: 550px;
    }
}

.product-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s ease;
}

.product-card:hover img {
    transform: scale(1.05);
}

.product-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: white;
    text-align: left;
}

.product-info h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-info p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.product-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fff;
    opacity: 0.9;
}

.product-link:hover {
    opacity: 1;
    gap: 0.8rem;
}

/* Transitions States */
.product-card.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(0, 0, 0) rotateY(0deg);
    z-index: 30;
}

.product-card.prev {
    opacity: 0.4;
    pointer-events: auto;
    transform: translate3d(-105%, 10%, -200px) rotateY(20deg) rotateZ(-8deg);
    z-index: 20;
}

.product-card.next {
    opacity: 0.4;
    pointer-events: auto;
    transform: translate3d(105%, 10%, -200px) rotateY(-20deg) rotateZ(8deg);
    z-index: 20;
}

.product-card.hidden-prev {
    opacity: 0;
    transform: translate3d(-150%, 20%, -500px) rotateY(45deg);
    z-index: 10;
}

.product-card.hidden-next {
    opacity: 0;
    transform: translate3d(150%, 20%, -500px) rotateY(-45deg);
    z-index: 10;
}

/* Dots */
.product-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #44170e;
    opacity: 0.1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-dot.active {
    opacity: 1;
    transform: scale(1.5);
}

@media (max-width: 767px) {
    .product-card.prev {
        transform: translate3d(-50%, 5%, -200px) rotateY(15deg) rotateZ(-5deg);
        opacity: 0.4;
    }

    .product-card.next {
        transform: translate3d(50%, 5%, -200px) rotateY(-15deg) rotateZ(5deg);
        opacity: 0.4;
    }

}

/* Info Modal Styles */
#info-modal {
    transition: opacity 0.4s ease;
    will-change: opacity;
}

.info-modal-content {
    animation: scaleUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: center;
    will-change: transform, opacity;
    backface-visibility: hidden;
    perspective: 1000px;
}

.info-modal-content.closing {
    animation: scaleDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.8) translateZ(0);
    }

    to {
        opacity: 1;
        transform: scale(1) translateZ(0);
    }
}

@keyframes scaleDown {
    from {
        opacity: 1;
        transform: scale(1) translateZ(0);
    }

    to {
        opacity: 0;
        transform: scale(0.8) translateZ(0);
    }
}

.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}