/* ============================================
   GLOBAL SETUP
   ============================================ */

:root {
    --color-cream: #F0E7DD;
    --color-sand: #C9B8A6;
    --color-brown: #8A5A43;
    --color-dark-gray: #2C2C2C;
    --color-black: #1D1D1F;
    --color-white: #FFFFFF;

    --color-cream-transparent: rgba(240, 231, 221, 0.9);
    --color-overlay: rgba(0, 0, 0, 0.5);
}

* {
    font-family: "Lato", sans-serif;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

/* ============================================
   LAYOUT & COMMON
   ============================================ */

section {
    background-color: var(--color-cream);
    padding: 2px 5% 10px;
    color: var(--color-brown);
    overflow: visible;
}

.titles {
    font-size: 14pt;
}

.divScrollLine {
    display: flex;
    width: 100%;
}

.leftLine,
.rightLine {
    width: 5%;
    height: 2px;
    background-color: var(--color-cream);
}

.middleLine {
    width: 90%;
    height: 2px;
    background-color: var(--color-brown);
}

.placeholder {
    height: 100px;
    background-color: var(--color-cream);
}

/* ============================================
   HEADER
   ============================================ */

header {
    background-color: var(--color-cream);
}

.headerMasterContainer {
    padding: 25px 5% 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
}

#header {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    height: 75px;
    width: auto;
    border-radius: 50px;
    background-color: var(--color-sand);
    align-items: center;
    padding: 5px 26px;
}

#headerLogo {
    height: auto;
}

#headerMenu ul {
    text-align: right;
    list-style-type: none;
}

#headerMenu li {
    display: inline-block;
    margin-left: 20px;
    color: var(--color-brown);
}

#headerMenu li a {
    color: var(--color-brown);
    font-size: 12pt;
}

/* ============================================
   INTRO SECTION
   ============================================ */

#intro {
    padding: 40px 0;
    font-size: 32pt;
    text-align: center;
}

/* ============================================
   MEUS SERVIÇOS SECTION
   ============================================ */

#servicosAutoCol {
    display: grid;
    gap: 30px;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.servico-item {
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
    min-height: 110px;
    height: 110px;
}

.servico-item:hover {
    transform: translateY(-5px);
}

.servico-icon {
    width: 100%;
    max-width: 180px;
    height: auto;
    transition: all 0.3s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    will-change: transform;
}

/* ============================================
   PORTFÓLIO SECTION
   ============================================ */

#portfolio {
    padding-bottom: 60px;
    position: relative;
    overflow: hidden;
}

.carrossel-container {
    position: relative;
    width: 100%;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.carrossel {
    position: relative;
    width: 100%;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.imagens {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.imagem {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    pointer-events: none;
    z-index: 1;
    will-change: transform, opacity;
}

/* Active State (Center) */
.imagem.active {
    opacity: 1;
    z-index: 10;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

/* Previous State (Left) */
.imagem.prev {
    opacity: 1;
    z-index: 5;
    transform: translate(-110%, -50%) scale(0.85) perspective(1000px) rotateY(5deg);
    pointer-events: auto;
}

/* Next State (Right) */
.imagem.next {
    opacity: 1;
    z-index: 5;
    transform: translate(10%, -50%) scale(0.85) perspective(1000px) rotateY(-5deg);
    pointer-events: auto;
}

/* Hover effects for side images */
.imagem.prev:hover,
.imagem.next:hover {
    opacity: 1;
    transform: translate(-110%, -50%) scale(0.87) perspective(1000px) rotateY(5deg);
}

.imagem.next:hover {
    transform: translate(10%, -50%) scale(0.87) perspective(1000px) rotateY(-5deg);
}

/* Navigation Buttons */
.seta {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--color-cream);
    color: var(--color-brown);
    border: none;
    cursor: pointer;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 20;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    outline: none;
}

.seta:hover {
    background-color: var(--color-brown);
    color: var(--color-cream);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.seta:active {
    transform: translateY(-50%) scale(0.95);
}

.seta-esquerda {
    left: 20px;
}

.seta-direita {
    right: 20px;
}

.indicadores {
    display: none;
}

/* ============================================
   FOOTER
   ============================================ */

.footerMasterContainer {
    background-color: var(--color-dark-gray);
    display: flex;
    width: 100%;
    padding-bottom: 10px;
}

.leftFooterMargem {
    width: 5%;
}

#footerLeftLogoContainer {
    margin-top: 30px;
    width: 30%;
    flex-direction: column;
    display: flex;
    align-items: center;
    color: var(--color-white);
    padding-bottom: 25px;
}

#footerMenuContainer {
    width: 30%;
    flex-direction: column;
    display: flex;
    align-items: center;
}

.footerContainer {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 40px;
}

#footerMenu ul {
    margin-top: 30px;
    list-style-type: none;
    color: var(--color-white);
    line-height: 1.4;
}

#footerMenuLinks li a {
    color: var(--color-white);
    text-decoration: none;
}

#footerRightLogoContainer {
    width: 30%;
    flex-direction: column;
    display: flex;
    align-items: center;
    position: relative;
    text-align: center;
}

#footerSquareLogo {
    position: absolute;
    width: 240px;
    height: auto;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
}

#logoLinks {
    position: absolute;
    top: 140px;
    left: 50%;
    transform: translateX(-50%);
}

#logoLinks ul {
    list-style-type: none;
}

#logoLinks li {
    display: inline-block;
}

#rightFooterMargem {
    width: 5%;
}

.btleftLine,
.btrightLine {
    width: 5%;
    height: 1px;
    background-color: var(--color-dark-gray);
}

.btmiddleLine {
    width: 90%;
    height: 1px;
    background-color: var(--color-white);
}

#builderInfo {
    width: 45%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 0 25px;
    color: var(--color-white);
}

#builderLinks {
    width: 45%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 5px;
    color: var(--color-white);
}

#footerInfoLinks ul {
    list-style-type: none;
}

#footerInfoLinks li {
    display: inline-block;
    margin-right: 20px;
    cursor: pointer;
    color: var(--color-white);
}

#footerInfoLinks li a {
    color: var(--color-white);
    text-decoration: none;
}

/* ============================================
   POP-UP STYLES
   ============================================ */

.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-overlay);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background-color: var(--color-cream);
    padding: 20px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.popup h2 {
    color: var(--color-brown);
    margin-bottom: 20px;
    text-align: center;
}

.popup-text {
    color: var(--color-dark-gray);
    margin-bottom: 20px;
    line-height: 1.6;
}

.popup-close {
    display: block;
    width: 200px;
    margin: 0 auto;
    padding: 10px;
    background-color: var(--color-brown);
    color: var(--color-white);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14pt;
}

.popup-close:hover {
    background-color: var(--color-sand);
    color: var(--color-black);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

/* --- Large Screens (1024px+) --- */
@media screen and (min-width: 1024px) {
    #intro {
        font-size: 26pt;
    }

    .textCenter {
        font-size: 16pt;
    }

    .btContato button {
        width: 250px;
    }

    textarea {
        width: 500px;
    }

    .carrossel {
        height: 450px;
    }

    .imagem {
        max-width: 800px;
    }
}

/* --- Desktop (961px+) --- */
@media screen and (min-width: 961px) {
    #headerLogo {
        justify-self: start;
    }

    #headerMenu {
        justify-self: end;
    }

    /* Serviços - 4 columns */
    #servicosAutoCol {
        grid-template-columns: repeat(4, 1fr);
        gap: 50px;
        padding: 60px 5%;
    }

    .servico-icon {
        max-width: 220px;
        min-width: 180px;
    }

    .servico-item {
        min-height: 125px;
        height: 125px;
    }
}

/* --- Tablet / Medium (Max 1024px) --- */
@media screen and (max-width: 1024px) {
    .carrossel {
        height: 200px;
    }

    .imagem {
        width: 80%;
    }

    .imagem.prev {
        transform: translate(-105%, -50%) scale(0.8);
    }

    .imagem.next {
        transform: translate(5%, -50%) scale(0.8);
    }
}

/* --- Tablet (481px - 960px) --- */
@media screen and (min-width: 481px) and (max-width: 960px) {

    /* Serviços - 2 columns */
    #servicosAutoCol {
        grid-template-columns: repeat(2, 1fr);
        gap: 120px;
        padding: 80px 5%;
    }

    .servico-icon {
        max-width: 250px;
    }

    .servico-item {
        min-height: 90px;
        height: 90px;
    }

    .servico-item:hover {
        transform: translateY(-3px);
    }
}

/* --- Mobile / Tablet Common (Max 768px) --- */
@media screen and (max-width: 768px) {
    .headerMasterContainer {
        padding-top: 15px;
    }

    #header {
        height: auto;
        padding: 10px 0;
        grid-auto-flow: row;
        text-align: center;
        justify-items: center;
    }

    #headerLogo {
        margin-left: 15px;
    }

    #headerLogo img {
        max-width: 120px;
    }

    #headerMenu li {
        margin-left: 10px;
    }

    #headerMenu li a {
        font-size: 10pt;
    }

    #intro {
        font-size: 22pt;
        padding: 30px 15px;
    }

    /* Portfolio Adjustments */
    .carrossel {
        height: 100px;
    }

    .imagem {
        width: 100%;
        border-radius: 8px;
    }

    .imagem.prev,
    .imagem.next {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
        pointer-events: none;
    }

    .seta {
        width: 40px;
        height: 40px;
        font-size: 18px;
        background-color: rgba(240, 231, 221, 0.8);
    }

    .seta-esquerda {
        left: 10px;
    }

    .seta-direita {
        right: 10px;
    }

    /* Fale Comigo */
    .faleComigoAutoCol {
        grid-auto-flow: row;
        gap: 10px;
        margin: 15px 0;
    }

    .faleComigoAutoCol div {
        text-align: center;
    }

    .inputContato {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .inputContato label {
        margin-bottom: 5px;
        align-self: flex-start;
        padding-left: 10%;
    }

    input,
    textarea {
        width: 80% !important;
        max-width: 400px;
    }

    .textCenter {
        padding: 0 15px;
    }

    /* Footer */
    .footerMasterContainer {
        flex-direction: column;
        align-items: center;
        padding: 30px 15px;
        box-sizing: border-box;
    }

    .leftFooterMargem,
    .rightFooterMargem {
        display: none;
    }

    #footerLeftLogoContainer,
    #footerMenuContainer,
    #footerRightLogoContainer {
        width: 100%;
        margin-bottom: 20px;
        text-align: center;
        padding: 0;
    }

    #footerLeftLogoContainer img {
        max-width: 220px;
        width: 70%;
    }

    #footerMenu ul {
        margin-top: 10px;
        padding: 0;
    }

    #footerRightLogoContainer {
        min-height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 0;
    }

    #footerSquareLogo {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: 130px;
        margin-bottom: 15px;
    }

    #logoLinks {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
    }

    .footerContainer {
        gap: 15px;
        justify-content: center;
    }

    #builderInfo,
    #builderLinks {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }

    #builderLinks ul {
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: center;
        padding: 0;
    }

    #footerInfoLinks li {
        margin: 0;
    }
}

/* --- Tablet Specific (481px - 768px) --- */
/* Overrides general max-width: 768px settings for tablet size */
@media screen and (min-width: 481px) and (max-width: 768px) {
    #header {
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: center;
        /* Resets the row flow from max-width: 768px */
        grid-auto-flow: column;
        justify-items: stretch;
        text-align: left;
    }

    #headerLogo {
        justify-self: start;
        margin-left: 0;
        /* Reset margin */
    }

    #headerMenu {
        justify-self: end;
    }

    .seta {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .seta-esquerda {
        left: 10px;
    }

    .seta-direita {
        right: 10px;
    }
}

/* --- Mobile Specific (Max 480px) --- */
@media screen and (max-width: 480px) {

    /* Header */
    #headerLogo {
        margin: 10px 0;
        text-align: center;
        display: flex;
        justify-content: center;
        width: 100%;
    }

    #headerLogo img {
        display: block;
        margin: 0 auto;
    }

    #headerMenu {
        margin: 5px 0 10px 0;
        width: 100%;
    }

    #headerMenu ul {
        text-align: center;
        margin-right: 0;
        padding: 0;
        display: flex;
        justify-content: center;
        gap: 15px;
    }

    #headerMenu li {
        margin: 0;
    }

    /* Intro */
    #intro {
        font-size: 18pt;
        padding: 20px 10px;
    }
}