/* Custom CSS for Machado de Assis Marcenaria */

/* Smooth scrolling behavior */
html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #f59e0b #1e293b;
}

.site-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background-color: rgba(15, 23, 42, 0.95);
    border-radius: 0.5rem;
    padding: 0.25rem;
    display: block;
    flex-shrink: 0;
    line-height: 0;
}

.site-header nav {
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
}

@media (max-width: 640px) {
    header {
        overflow: visible;
    }

    header nav {
        padding-right: 1.25rem;
    }
}

@media (max-width: 768px) {
    .lightbox-content {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        padding: 3.5rem 1rem 2.5rem;
        width: 100vw;
        height: 100vh;
        max-height: none;
    }

    .lightbox-next {
        right: 1.25rem;
    }

    .lightbox-close {
        top: calc(env(safe-area-inset-top, 0) + 0.75rem);
        right: calc(env(safe-area-inset-right, 0) + 0.75rem);
        width: 42px;
        height: 42px;
    }

    .lightbox-close-icon {
        font-size: 1.75rem;
        line-height: 1;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #f59e0b;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #d97706;
}

/* Background sliders */
.background-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 1;
    transition: opacity 0.6s ease;
    z-index: 0;
}

.background-slider[data-single="true"] {
    transition: none;
}

.background-slider.fade-out {
    opacity: 0;
}

.hero-overlay {
    background: linear-gradient(120deg, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0.65) 50%, rgba(15, 23, 42, 0.45) 100%);
    pointer-events: none;
    z-index: 1;
}

.featured-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.2) 0%, rgba(15, 23, 42, 0.55) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Gallery layout */
.gallery-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    justify-items: center;
}

.gallery-card {
    background: #ffffff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-card,
.gallery-card > * {
    width: 100%;
}

.portfolio-gallery-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.portfolio-gallery-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.portfolio-gallery-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

.gallery-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(245, 158, 11, 0.25);
}

.gallery-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.gallery-info {
    padding: 1.25rem 1.5rem;
}

.gallery-info h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-family: 'Playfair Display', serif;
}

.gallery-info p {
    color: #4b5563;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
        gap: 1.5rem;
    }

    .gallery-item,
    .gallery-card {
        width: 100%;
        max-width: none;
    }

    .gallery-image {
        height: auto;
        min-height: 260px;
    }

    .gallery-info {
        padding: 1rem 1.25rem;
    }
}

/* Custom gallery lightbox */

.lightbox {
    position: fixed;
    inset: 0;
    padding: 2rem 1.5rem;
    background: rgba(15, 23, 42, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease;
    z-index: 2000;
    pointer-events: none;
}

.lightbox.show {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lightbox .lightbox-caption,
.lightbox .lightbox-description,
.lightbox .lb-data,
.lightbox .lb-caption,
.lightbox .lb-details {
    display: none !important;
}


.lightbox-content {
    position: relative;
    width: min(1000px, 96vw);
    max-height: 92vh;
    padding: clamp(1.25rem, 4vw, 2rem) clamp(1.25rem, 6vw, 2.5rem) clamp(2rem, 6vw, 2.75rem);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}


.lightbox-media {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.lightbox-media::-webkit-scrollbar {
    width: 0;
    height: 0;
}
.lightbox-media.zoomed {
    overflow: auto;
    cursor: grab;
}

.lightbox-media.zoomed::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.lightbox-media.zoomed:active {
    cursor: grabbing;
}


.lightbox-image {
    width: min(90vw, 960px);
    height: min(80vh, 720px);
    object-fit: contain;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
    display: block;
    cursor: zoom-in;
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.lightbox-image.is-zoomed {
    max-width: none;
    max-height: none;
    cursor: zoom-out;
    transform: scale(1.8);
}

@media (max-width: 768px) {
    .lightbox-content {
        width: 100vw;
        height: 100vh;
        max-height: none;
        padding: 1.5rem 1rem;
        padding-top: calc(env(safe-area-inset-top, 0) + 1.5rem);
        border-radius: 0;
    }

    .lightbox-media {
        height: calc(100vh - 3rem);
    }

    .lightbox-image {
        width: calc(100vw - 2.5rem);
        height: calc(100vh - 5rem);
        object-fit: contain;
    }

    .lightbox-nav {
        top: auto;
        bottom: 1.25rem;
        transform: none;
    }

    .lightbox-close {
        top: 1.25rem;
        right: 1.25rem;
        width: 44px;
        height: 44px;
        border-radius: 999px;
        background: rgba(245, 158, 11, 0.95);
        color: #0f172a;
    }

    .lightbox-close-icon {
        font-size: 1.75rem;
        line-height: 1;
    }
}


.lightbox-close {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0) + 1rem);
    right: calc(env(safe-area-inset-right, 0) + 1rem);
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.95);
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    z-index: 2100;
}

.lightbox-close-icon {
    font-size: 2rem;
    line-height: 1;
    display: block;
    transform: translateY(-1px);
}

.lightbox-close:hover {
    background: #fbbf24;
    color: #0f172a;
    transform: scale(1.05);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: none;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    z-index: 5;
}

.lightbox-nav:hover {
    background: rgba(245, 158, 11, 0.85);
    transform: translateY(-50%) scale(1.05);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}



/* Anchored section offset for smooth scroll */
.section-scroll-target {
    scroll-margin-top: 140px;
}

/* Floating actions stack */
.floating-actions {
    position: fixed;
    bottom: 5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 50;
}

.floating-actions a,
.floating-actions button {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-actions a:hover,
.floating-actions button:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 18px 32px -10px rgba(245, 158, 11, 0.5);
}

/* Custom font classes */
.font-playfair {
    font-family: 'Playfair Display', serif;
}

.font-montserrat {
    font-family: 'Montserrat', sans-serif;
}

/* Custom animations and effects */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Hero background with subtle animation */
.hero-bg {
    background: linear-gradient(-45deg, #1e293b, #334155, #0f172a, #1e293b);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Card hover effects */
.service-card {
    transition: all 0.3s ease;
    transform: translateY(0);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(245, 158, 11, 0.15);
}

/* Portfolio item hover effects */
.portfolio-item {
    transition: all 0.3s ease;
}

.portfolio-item:hover {
    transform: scale(1.05);
}

/* Button animations */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

/* Loading animation for images */
.image-placeholder {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* WhatsApp floating button pulse animation */
.whatsapp-float {
    animation: whatsappPulse 2s infinite;
}

@keyframes whatsappPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Text reveal animation */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    transition: transform 0.6s ease;
}

.text-reveal.animate span {
    transform: translateY(0);
}

/* Mobile menu animation */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-menu.open {
    max-height: 500px;
}

/* Focus styles for accessibility */
.focus-visible:focus {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .text-slate-600 {
        color: #000 !important;
    }

    .text-slate-300 {
        color: #333 !important;
    }
}

/* Custom gradient backgrounds */
.bg-wood-texture {
    background:
        linear-gradient(45deg, #8b4513 25%, transparent 25%),
        linear-gradient(-45deg, #8b4513 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #a0522d 75%),
        linear-gradient(-45deg, transparent 75%, #a0522d 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    opacity: 0.1;
}

/* Stats counter animation */
.counter {
    transition: all 0.3s ease;
}

.counter.animate {
    transform: scale(1.1);
}

/* Form validation styles */
.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
}

.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input.success {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Tooltip styles */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: calc(100% - 5px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Custom shadow utilities */
.shadow-amber {
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.15);
}

.shadow-amber-lg {
    box-shadow: 0 20px 40px rgba(245, 158, 11, 0.2);
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    background: #f59e0b;
    color: #0f172a;
    border: none;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease;
    z-index: 60;
    box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.45);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-2px);
}

.whatsapp-button {
    background: #22c55e;
    color: #fff;
}

.whatsapp-button:hover {
    background: #16a34a;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox .close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Contact form enhancements */
.contact-form {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #1e293b;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    outline: none;
    border-color: #f59e0b;
    background: white;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* Service cards enhanced animations */
.service-icon {
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Portfolio filter buttons */
.filter-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.3), transparent);
    transition: left 0.5s;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn.active {
    background: #f59e0b;
    color: white;
}

.filter-btn:not(.active) {
    background: #e2e8f0;
    color: #374151;
}

.filter-btn:not(.active):hover {
    background: #cbd5f5;
    color: #1f2937;
    transform: translateY(-1px);
}

/* Map container */
.map-container {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    height: 400px;
}

/* Team member cards (for future use) */
.team-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.team-card img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.5rem;
    border: 4px solid #f59e0b;
}

/* Testimonial styles (for future use) */
.testimonial {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    position: relative;
}

.testimonial::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 4rem;
    color: #f59e0b;
    font-family: serif;
    line-height: 1;
}

.testimonial .author {
    margin-top: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.testimonial .company {
    color: #64748b;
    font-size: 0.875rem;
}

/* Cookie consent banner (for future use) */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e293b;
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner .btn {
    background: #f59e0b;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.cookie-banner .btn:hover {
    background: #d97706;
}

/* Progress bar for reading (for future use) */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    z-index: 1001;
    transition: width 0.3s ease;
}

/* Custom utilities */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bg-mesh {
    background-image:
        radial-gradient(circle at 1px 1px, rgba(245, 158, 11, 0.3) 1px, transparent 0);
    background-size: 20px 20px;
}

/* Animation delays for staggered animations */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-500 { animation-delay: 0.5s; }
.delay-700 { animation-delay: 0.7s; }
.delay-1000 { animation-delay: 1s; }

/* Responsive typography */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.1;
    }

    .section-title {
        font-size: 2rem;
    }
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 4rem;
        line-height: 1.1;
    }

    .section-title {
        font-size: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .hero-title {
        font-size: 5rem;
        line-height: 1;
    }

    .section-title {
        font-size: 3rem;
    }
}

/* Performance optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
}

/* Print optimizations */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    .container {
        max-width: none;
        padding: 0;
    }
}
