/* Universal Styles & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Ensures consistent box model */

    font-size: 62.5%; /* 1rem = 10px, for easier rem-based sizing */
    font-family: "Roboto", sans-serif;
}

:root {
    --bg-color: #0e0e0e;
    --txt-color: #fffeff;
    --primary-color: #0788D9;
    --secondary-color: #0669BF;
    --light-blue: #48a9ff; /* Added for consistency in footer hover */
}

html {
    scroll-behavior: smooth;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 1.2rem;
    border-radius: 1rem;
    background-color: transparent;
}

::-webkit-scrollbar-thumb:vertical {
    background-image: linear-gradient(to top, var(--primary-color), var(--primary-color));
    border-radius: 1rem;
}

/* Body Styles */
body {
    padding: 0 6rem;
    background-color: var(--bg-color);
    color: var(--txt-color);
    overflow-x: hidden; /* Prevent horizontal scroll on small screens */
}

/* Section Styles */
section {
    min-height: 100vh; /* Use min-height to allow content to expand */
    display: flex; /* Apply flex to all sections for consistent alignment */
    flex-direction: column; /* Default to column, adjust as needed */
    align-items: center; /* Center content horizontally by default */
    justify-content: center; /* Center content vertically by default */
}

/* Specific Section Adjustments */
.section {
    align-items: flex-end; /* Overrides section default for specific sections */
    justify-content: flex-end; /* Overrides section default for specific sections */
}

/* Menu Styles */
.menu {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    width: 100%; /* Ensure menu spans full width */
    margin-top: 2rem;
    padding: 0 2rem; /* Add some horizontal padding for smaller screens */
}

.menu h1,
.menu .destaque {
    font-size: 3rem;
}

.destaque {
    color: var(--primary-color);
}

.menu ul {
    display: flex;
    align-items: center;
    gap: 8rem;
    list-style: none; /* Explicitly remove list style */
}

.menu ul li a {
    font-size: 2.2rem;
    text-decoration: none;
    color: #fffeffb1;
    position: relative;
    font-weight: bold;
    letter-spacing: .2rem;
    transition: color 0.3s ease; /* Smooth transition for color */
}

.menu ul li a:before {
    content: "";
    width: 0; /* Changed from 0px for consistency */
    height: 3px;
    background: var(--primary-color);
    position: absolute;
    top: 100%;
    left: 0;
    transition: width 0.2s ease; /* Smooth transition for width */
}

.menu ul li:hover a:before {
    width: 100%;
}

.menu ul li:hover a {
    color: var(--txt-color);
}

.menu button {
    padding: 1rem 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    border-radius: 4rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease; /* Combined transitions */
    outline: none; /* Consider alternative focus indicator for accessibility */
}

.menu button:hover {
    background-color: var(--secondary-color);
    box-shadow: 0 0 1rem var(--secondary-color);
    transform: scale(1.05);
}

.menu button a {
    color: var(--txt-color);
    text-decoration: none;
    font-size: 2.2rem;
    font-weight: bold;
}

/* Main Content Styles */
.menu + main {
    min-height: 100vh; /* Use min-height */
}

main {
    padding: 16rem 0; /* Vertical padding only */
    display: flex; /* Ensure main is a flex container */
    align-items: center;
    justify-content: center;
    gap: 8rem;
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
}

main .flex{
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    gap: 6rem;
}

main img {
    width: 60rem;
    height: 60rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color); /* Use variable for consistency */
}

main .conteudo-main {
    max-width: 100rem; /* Use max-width for responsiveness */
    text-align: center; /* Default text alignment for content-main */
}

main h2 {
    font-size: 3.5rem;
    letter-spacing: 0.3rem;
    margin: 0 0 2rem;
}

main .destaque {
    font-size: 3.5rem;
}

main p {
    font-size: 2.5rem;
    text-align: justify;
}

/* About Section Styles */
#sobre {
    min-height: 100vh; /* Use min-height */
    display: flex;
    flex-direction: row; /* Default to row for desktop */
    align-items: center;
    justify-content: center;
    padding: 2rem; /* Add padding for overall section */
    gap: 8rem; /* Consistent gap with main */
    flex-wrap: wrap; /* Allow items to wrap */
}

#sobre #poste-de-barbeiro {
    border: none;
    width: 12rem;
    height: 14rem;
    animation: flutuar 2s infinite ease-in-out;
    flex-shrink: 0; /* Prevent shrinking */
}

#sobre .conteudo-sobre {
    max-width: 70rem; /* Use max-width */
    text-align: right; /* Default text alignment */
}

#sobre .conteudo-sobre h1,
#sobre .conteudo-sobre h1 .destaque {
    font-size: 3.5rem;
    margin-bottom: 2rem;
}

#sobre .conteudo-sobre p {
    font-size: 2.5rem;
}

#sobre img {
    border-right: 4px solid var(--primary-color);
    border-bottom: 4px solid var(--primary-color);
    width: 50rem; /* Example fixed width, adjust as needed */
    height: 50rem; /* Example fixed height, adjust as needed */
    object-fit: cover;
}

/* Works Section Styles */
#trabalhos {
    min-height: 100vh; /* Use min-height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0; /* Add vertical padding */
}

.slider {
    display: flex;
    margin: 0 auto;
    max-width: 90%;
    max-height: 60rem;
    overflow: hidden;
    position: relative;
}

.slides {
    display: flex;
    gap: 2rem;
    /* Calculate width based on known slide width and gap */
    width: calc((50rem + 2rem) * 4); /* (slide width + gap) * number of slides */
    height: 100%;
    animation: slide 20s infinite linear;
}

.slider:hover .slides {
    animation-play-state: paused;
}

.slide {
    width: 50rem;
    height: 100%;
    flex-shrink: 0;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes slide {
    0%   { transform: translateX(0); }
    25%  { transform: translateX(calc(-1 * (50rem + 2rem))); } /* Move by one slide + gap */
    50%  { transform: translateX(calc(-2 * (50rem + 2rem))); }
    75%  { transform: translateX(calc(-3 * (50rem + 2rem))); }
    100% { transform: translateX(0); }
}

/* Prices Section Styles */
#precos {
    width: 80%;
    min-height: 100vh; /* Use min-height */
    margin: 0 auto;
    padding: 4rem 0; /* Add vertical padding */
    display: flex; /* Ensure #precos is a flex container */
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.txt-posi {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center; /* Ensure text within is centered */
}

.txt-posi h2 {
    font-size: 3rem;
    padding-bottom: 2rem;
}

.titulo {
    font-size: 6rem;
    text-transform: uppercase;
    padding-bottom: 6rem;
}

#precos .titulo {
    padding-bottom: 2rem;
}

#precos .bg-precos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
    gap: 4rem;
    padding: 2rem;
    justify-items: center;
    width: 100%; /* Ensure grid takes full width available in #precos */
}

.card {
    position: relative;
    width: 30rem;
    height: 25.4rem;
    color: var(--txt-color); /* Use variable */
    transition: transform 0.5s ease;
    cursor: pointer; /* Indicate interactivity */
}

.card:hover {
    transform: translateY(-10px) scale(1.05);
}

.card:hover::after {
    filter: blur(10px);
}

.card::before {
    content: '';
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 1.2em;
    z-index: 1; /* Ensure it's below the content */
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    transition: filter .3s ease; /* Apply transition to filter */
    border-radius: 1.2em; /* Ensure consistent border-radius */
    z-index: 0; /* Ensure it's the furthest back */
}

.card span {
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2;
    border-radius: 1em;
}

.card .card-content {
    position: relative;
    padding: 10px;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card .card-content h2 {
    position: absolute;
    margin-bottom: 18rem;
    font-size: 2.3rem;
    font-weight: bolder;
    text-transform: uppercase;
    text-align: center; /* Center text within h2 */
}

.card .card-content img {
    width: 10rem;
    height: 10rem;
    object-fit: contain; /* Ensure image fits well */
}

.card .card-content p {
    position: absolute;
    margin-top: 18rem;
    letter-spacing: .3rem;
    font-size: 4rem;
    text-transform: uppercase;
    text-align: center; /* Center text within p */
}

/* Contact Section Styles */
#contatos {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Use min-height */
    padding: 4rem 0; /* Add vertical padding */
}

#contatos .btns-contatos {
    display: flex;
    gap: 4rem;
    margin-top: 2rem;
    flex-wrap: wrap; /* Allow buttons to wrap */
    justify-content: center; /* Center wrapped buttons */
}

#contatos .btns-contatos a {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .5rem;
    font-size: 2rem;
    padding: 1rem 6rem;
    border: 2px solid var(--primary-color);
    border-radius: 3rem;
    text-decoration: none;
    color: var(--txt-color);
    transition: background-color 0.3s ease, transform 0.3s ease; /* Combined transitions */
}

#contatos .btns-contatos a:hover {
    background-color: var(--primary-color);
    transform: scale(1.05);
}

#contatos .btns-contatos a i {
    font-size: 2rem;
}

/* Footer Styles */
footer {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    background-color: #0669bf98; /* Use rgba for transparency if desired, or define a variable */
    padding: 3rem 0;
    flex-wrap: wrap; /* Allow footer content to wrap */
    text-align: center; /* Center text for wrapped content */
}

footer h2 {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem; /* Add margin for spacing */
}

footer .line {
    border: 1px solid var(--txt-color); /* Use variable for consistency */
    margin-bottom: .5rem;
    width: 80%; /* Give the line a width */
}

footer p,
footer a,
footer i {
    font-size: 1.8rem;
    color: var(--txt-color);
}

footer p {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: center; /* Align icon and text */
    justify-content: center; /* Center text items */
}

footer p:hover a,
footer p:hover i {
    color: var(--light-blue); /* Use defined variable */
}

/* Copyright Styles */
#copyright {
    min-height: 3rem; /* Use min-height */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background-color: var(--bg-color); /* Ensure background for clarity */
}

#copyright p, #copyright a{
    font-size: 1.5rem;
    text-align: center;
}

#copyright a{
    color: var(--light-blue);
    text-decoration: none;
}

#copyright a:hover{
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Animations */
@keyframes flutuar {
    0% { transform: translate(0, 0); } /* Removed 0px */
    50% { transform: translate(0, 20px); }
    100% { transform: translate(0, 0); } /* Consistent 0 */
}

/* --- MEDIA QUERIES --- */
@media screen and (max-width: 1200px) {
    body {
        width: 100%;
        display: block; /* Revert to block for better flow on small screens */
        padding: 0; /* Remove body padding */
    }

    /* General flex adjustments for mobile */
    .flex-mobile {
        flex-direction: column !important; /* Use !important if needed to override */
    }

    .flex-inverse {
        flex-direction: column-reverse !important; /* Use !important if needed to override */
    }

    /* Menu adjustments */
    .menu {
        flex-direction: column; /* Stack menu items */
        justify-content: center;
        align-items: center;
        gap: 1rem; /* Add gap for stacked items */
    }

    .menu ul,
    .menu button {
        display: none; /* Keep hidden as per original */
    }

    .menu h1,
    .menu .destaque {
        font-size: 2.5rem;
    }

    /* Main Section Adjustments */
    main {
        height: auto;
        padding: 3rem 0;
        flex-direction: column; /* Stack content for mobile */
        text-align: center;
        gap: 3rem; /* Adjust gap for stacked items */
    }

    main img {
        width: 20rem;
        height: 20rem;
    }

    main .conteudo-main {
        max-width: 90%; /* Adjust max-width for mobile */
        padding: 0 1rem; /* Add horizontal padding */
    }

    main h2,
    main h2 .destaque {
        font-size: 2.5rem;
        margin-bottom: 1.2rem;
        width: auto; /* Allow width to be determined by content */
        text-align: center; /* Ensure centered */
    }

    main p {
        font-size: 1.6rem;
        text-align: justify;
        width: 90%; /* Adjust width for better readability */
        margin: 0 auto; /* Center paragraph */
    }

    /* About Section Adjustments */
    #sobre {
        height: auto;
        flex-direction: column; /* Stack content for mobile */
        gap: 3rem; /* Adjust gap */
        padding: 3rem 0; /* Vertical padding */
    }

    #sobre .conteudo-sobre {
        width: 90%; /* Adjust width for mobile */
        text-align: center; /* Center text content */
        padding: 0 1rem;
    }

    #sobre .conteudo-sobre h1,
    #sobre .conteudo-sobre h1 .destaque {
        text-align: center;
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
    }

    #sobre img {
        width: 30rem;
        height: 35rem;
        border: none; /* Removed borders for mobile */
    }

    #sobre .conteudo-sobre p {
        font-size: 1.6rem;
        text-align: justify;
        width: 90%; /* Adjust width for better readability */
        margin: 0 auto; /* Center paragraph */
    }

    /* Works Slider Adjustments */
    .slider {
        max-width: 100%;
        padding: 0 1rem; /* Add padding to prevent overflow */
    }

    .slides {
        width: max-content;
        gap: 1rem;
    }

    .slide {
        width: 90%;
        height: auto;
        flex-shrink: 0;
        scroll-snap-align: start; /* Snap to start of slide */
    }

    .slide img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    /* Prices Section Adjustments */
    #precos {
        width: 100%;
        padding: 3rem 0;
        text-align: center;
    }

    #precos .bg-precos {
        grid-template-columns: repeat(auto-fit, minmax(200px, 2fr));
        gap: 2rem; /* Adjust gap */
    }

    .card {
        aspect-ratio: 1 / 1;
        max-width: 20rem; /* Set a reasonable max-width */
        max-height: 20rem;
        margin-bottom: 1rem; /* Smaller margin */
    }

    .card .card-content {
        text-align: center;
    }

    .card .card-content h2 {
        font-size: 1.7rem;
        margin-bottom: 12rem; /* Adjusted for better spacing */
    }

    .card .card-content img {
        width: 8rem;
        height: 8rem;
    }

    .card .card-content p {
        font-size: 3.2rem;
        margin-top: 12rem; /* Adjusted for better spacing */
    }

    /* Contact Section Adjustments */
    #contatos .btns-contatos {
        flex-direction: column; /* Stack buttons */
        gap: 2rem; /* Adjust gap */
    }

    #contatos .btns-contatos a {
        padding: 1rem 3rem; /* Adjust padding for smaller buttons */
        width: 30rem; /* Limit max width */
    }

    #contatos iframe{
        max-width: 90%;
        height: 40rem;
    }

    /* Footer Adjustments */
    footer {
        flex-direction: column; /* Stack footer content */
        gap: 1.5rem; /* Add gap between stacked items */
        padding: 2rem 1rem; /* Add horizontal padding */
    }

    footer .line {
        width: 90%; /* Adjust line width for mobile */
    }

    footer h2 {
        font-size: 2.5rem; /* Adjust font size */
    }

    footer p, footer a, footer i {
        font-size: 1.6rem; /* Adjust font size */
    }

    #copyright {
        padding: 1.5rem;
    }

    #copyright p, #copyright a {
        font-size: 1.2rem;
    }
}

@media screen and (max-width: 500px) {
  #precos .bg-precos {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 colunas fixas e seguras */
    gap: 1rem;
    padding: 0 1rem;
    box-sizing: border-box;
  }

  .card {
    width: 100%;
    height: 100%;
    max-width: 15rem;
    max-height: 15rem;
    aspect-ratio: 1 / 1;
    margin-bottom: 1rem;
    box-sizing: border-box;
  }

  .card .card-content h2 {
    font-size: 1.3rem;
    margin-bottom: 30rem;
  }

  .card .card-content img {
    width: 6rem;
    height: 6rem;
  }

  .card .card-content p {
    font-size: 2.8rem;
    margin-top: 30rem;
  }
}
