/* MOBILE FIRST - Padrão para Telas Pequenas (< 768px) */
@media (max-width: 767px) {
    .hero-slider-wrapper {
        height: 75vh;
        min-height: 480px;
    }

    .hero-content h1 {
        font-size: 1.85rem;
    }

    .hero-content p {
        font-size: 0.9rem;
    }

    .slider-arrow {
        display: none;
        /* Em celular, navega via toque (swipe) ou dots */
    }

    .about-features {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .legal-card {
        padding: 1.5rem;
    }
}

/* TABLET - 768px e acima */
@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }

    .hero-content h1 {
        font-size: 2.75rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.75rem;
    }

    .reviews-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }

    .about-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    .about-image-container img {
        height: 400px;
    }

    .cta-box {
        padding: 4rem 2rem;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* DESKTOP - 1024px e acima */
@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
    }

    .hero-slider-wrapper {
        height: 85vh;
        max-height: 700px;
    }

    .hero-content h1 {
        font-size: 3.2rem;
    }

    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gallery-item {
        height: 220px;
    }

    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr 1.25fr;
        gap: 2.5rem;
    }

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

@media (max-width: 900px) {
    .admin-page-head {
        align-items: flex-start;
        flex-direction: column
    }

    .admin-toolbar {
        grid-template-columns: 1fr 1fr
    }

    .admin-toolbar .btn {
        width: 100%
    }

    .admin-client-grid,
    .period-grid,
    .admin-service-grid,
    .banner-admin-grid {
        grid-template-columns: 1fr
    }
}

@media (max-width: 767px) {
    body {
        line-height: 1.7
    }

    .container {
        padding: 0 1rem
    }

    .header .container {
        align-items: flex-start
    }

    .header nav {
        max-width: 55vw
    }

    .header nav a {
        padding: .45rem .6rem;
        font-size: .82rem
    }

    .admin-layout {
        position: relative
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 3000;
        width: min(84vw, 300px);
        transform: translateX(-105%);
        transition: transform .25s ease;
        box-shadow: 12px 0 35px rgba(0, 0, 0, .55)
    }

    .admin-layout.sidebar-open .sidebar {
        transform: translateX(0)
    }

    .admin-content {
        width: 100%;
        padding: 1.15rem .9rem
    }

    .admin-menu-button {
        display: grid;
        place-items: center;
        position: fixed;
        right: 1rem;
        top: 1rem;
        z-index: 3100;
        width: 44px;
        height: 44px;
        border-radius: 12px;
        background: var(--red);
        color: white;
        font-size: 1.25rem;
        box-shadow: 0 8px 20px var(--red-glow)
    }

    .admin-page-head {
        padding-right: 3.5rem;
        margin-bottom: 1.25rem
    }

    .admin-page-head h1 {
        font-size: 1.7rem
    }

    .admin-page-head .btn {
        width: 100%
    }

    .admin-card {
        padding: 1rem;
        margin-bottom: 1rem
    }

    .admin-card-head {
        align-items: flex-start;
        flex-direction: column
    }

    .admin-stats {
        grid-template-columns: 1fr 1fr !important;
        gap: .65rem
    }

    .admin-stats .stat-card {
        min-height: 120px;
        padding: 1rem
    }

    .admin-stats .stat-card .number {
        font-size: 1.45rem
    }

    .admin-list-item {
        align-items: flex-start;
        flex-direction: column
    }

    .admin-toolbar {
        grid-template-columns: 1fr;
        gap: .65rem
    }

    .appointment-admin-card {
        flex-direction: column;
        padding: 1rem
    }

    .appointment-main {
        gap: .75rem;
        width: 100%;
    }

    .appointment-date {
        flex: 0 0 92px;
        width: 92px;
        min-width: 92px;
    }

    .appointment-side {
        align-items: flex-start;
        min-width: 0
    }

    .admin-actions {
        justify-content: flex-start
    }

    .admin-actions .btn {
        flex: 1;
        min-width: 110px
    }

    .client-card {
        grid-template-columns: auto 1fr;
        gap: .8rem
    }

    .client-card-stats {
        grid-column: 2;
        text-align: left;
        align-items: flex-start
    }

    .client-card>.btn {
        grid-column: 1/-1;
        width: 100%
    }

    .detail-grid {
        grid-template-columns: 1fr
    }

    .detail-history>div {
        grid-template-columns: 1fr auto
    }

    .detail-history em {
        grid-column: 1/-1
    }

    .form-grid {
        grid-template-columns: 1fr
    }

    .duration-row {
        grid-template-columns: 1fr 100px 25px
    }

    .service-admin-card {
        grid-template-columns: 56px 1fr
    }

    .service-admin-icon {
        width: 56px;
        height: 56px
    }

    .banner-admin-card {
        grid-template-columns: 1fr
    }

    .banner-preview {
        min-height: 160px
    }

    .banner-admin-content {
        padding: 1rem
    }

    /* Cliente: cartões no lugar de tabelas apertadas */
    #agendamentosContainer .table-wrapper {
        overflow: visible;
        border: 0
    }

    .client-appointments-table thead {
        display: none
    }

    .client-appointments-table,
    .client-appointments-table tbody,
    .client-appointments-table tr,
    .client-appointments-table td {
        display: block;
        width: 100%
    }

    .client-appointments-table tr {
        background: var(--black-card);
        border: 1px solid var(--border);
        border-radius: 14px;
        padding: 1rem;
        margin-bottom: 1rem
    }

    .client-appointments-table td {
        border: 0 !important;
        padding: .35rem 0 !important;
        text-align: left !important;
        white-space: normal !important
    }

    .client-appointments-table td::before {
        content: attr(data-label);
        display: block;
        color: var(--gray-light);
        font-size: .75rem;
        text-transform: uppercase;
        letter-spacing: .06em;
        margin-bottom: .1rem
    }

    .client-appointments-table td:last-child {
        padding-top: .8rem !important
    }

    .client-appointments-table .btn {
        width: 100%
    }

    .client-dashboard {
        padding: 1rem !important
    }

    .client-dashboard .section-title {
        font-size: 1.65rem
    }

    .client-dashboard .section-header {
        margin-bottom: 1.25rem
    }
}

@media (max-width: 767px) {
    .booking-dashboard .step {
        padding: 1.1rem .95rem;
        margin-bottom: 1rem
    }

    .booking-dashboard .step-title {
        gap: .65rem;
        font-size: 1rem;
        line-height: 1.35
    }

    .booking-dashboard .step p {
        line-height: 1.65;
        margin-bottom: .75rem
    }

    .grid-services-select {
        gap: .7rem
    }

    .service-select-card {
        display: grid;
        grid-template-columns: 24px 1fr auto;
        gap: .7rem;
        padding: .9rem;
        align-items: center
    }

    .service-select-card .service-select-check {
        display: none
    }

    .service-select-card.selected .service-select-check {
        display: none
    }

    .service-select-info strong {
        font-size: .94rem;
        line-height: 1.35
    }

    .service-select-info small {
        display: block;
        font-size: .78rem;
        line-height: 1.55;
        margin-top: .18rem
    }

    .service-select-price {
        font-size: .88rem
    }

    .booking-dashboard #selectedSummary {
        line-height: 1.65;
        padding: .15rem 0
    }

    .booking-dashboard #timeSlots {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .5rem;
        margin-top: .8rem
    }

    .booking-dashboard .time-slot {
        min-height: 48px;
        padding: .65rem .35rem;
        font-size: .82rem;
        border-radius: 10px
    }

    .payment-option-card {
        padding: .85rem;
        line-height: 1.5
    }

    .booking-dashboard .btn-lg {
        min-height: 50px
    }
}

.header nav {
    overflow: hidden;
    overflow-x: hidden;
    scrollbar-width: none;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end
}

.header nav::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0
}

@media(max-width:767px) {
    .header .container {
        flex-wrap: wrap;
        gap: .6rem;
        align-items: center
    }

    .header nav {
        width: 100%;
        justify-content: center;
        gap: .25rem;
        max-width: 100%;
        white-space: normal
    }

    .header nav a {
        font-size: .78rem;
        padding: .42rem .55rem
    }

    .single-media-manager {
        grid-template-columns: 1fr
    }

    .media-manager-actions {
        flex-direction: row;
        flex-wrap: wrap
    }

    .gallery-admin-grid {
        grid-template-columns: 1fr
    }

    .duration-row-price {
        grid-template-columns: 1fr 90px 110px 25px
    }

    .auth-page {
        padding: .75rem
    }

    .auth-card {
        padding: 1.35rem 1.1rem
    }

    .auth-logo img {
        width: 72px;
        height: 72px
    }

    .auth-heading h1 {
        font-size: 1.7rem
    }

    .auth-form-row {
        grid-template-columns: 1fr;
        gap: 0
    }
}


/* Navbar compacta: uma única linha, sem rolagem, inclusive no celular. */
@media (max-width: 767px) {
    .header .container {
        flex-wrap: nowrap;
        align-items: center;
        gap: .35rem;
        min-width: 0;
    }

    .header .logo-section {
        gap: .35rem;
        min-width: 0;
        flex: 0 1 auto;
    }

    .header .logo img {
        height: 30px;
        width: 30px;
        flex-shrink: 0;
    }

    .header .logo-text {
        min-width: 0;
    }

    .header .logo-text h2 {
        font-size: .9rem;
        white-space: nowrap;
    }

    .header nav {
        width: auto;
        max-width: none;
        min-width: 0;
        flex: 1 1 auto;
        justify-content: flex-end;
        align-items: center;
        gap: .08rem;
        flex-wrap: nowrap;
        white-space: nowrap;
        overflow: visible;
        overflow-x: hidden;
    }

    .header nav a {
        flex: 0 1 auto;
        padding: .34rem .42rem;
        font-size: .68rem;
        white-space: nowrap;
    }
}

@media (max-width: 360px) {
    .header {
        padding: .65rem 0;
    }

    .header .container {
        padding-left: .65rem;
        padding-right: .65rem;
        gap: .2rem;
    }

    .header .logo-section {
        gap: .25rem;
    }

    .header .logo img {
        width: 26px;
        height: 26px;
    }

    .header .logo-text h2 {
        font-size: .78rem;
    }

    .header nav {
        gap: 0;
    }

    .header nav a {
        padding: .28rem .3rem;
        font-size: .62rem;
    }
}

/* Ajustes finais de espaçamento e alinhamento mobile solicitados. */
@media (max-width: 767px) {

    /* Navbar: sem o nome ao lado da logo, os links permanecem na mesma linha. */
    .header .logo-text {
        display: none;
    }

    .header .logo-section {
        gap: 0;
    }

    /* Conteúdo da seção Sobre centralizado no celular. */
    .about-content {
        text-align: center;
    }

    .about-content .about-features {
        justify-items: center;
    }

    .about-content .feature-item {
        justify-content: center;
    }

    /* Rodapé centralizado no celular, mantendo o mapa sem alterações de estrutura. */
    .footer-brand,
    .footer-column {
        align-items: center;
        text-align: center;
    }

    .footer-logo,
    .footer-socials,
    .footer-info-item {
        justify-content: center;
    }

    .footer-links {
        align-items: center;
    }

    .footer-column h4::after {
        margin-left: auto;
        margin-right: auto;
    }

    /* Login/cadastro: mais respiro lateral para o card não encostar nas bordas. */
    .auth-page {
        padding: 1.25rem;
    }

    .auth-shell {
        width: min(100%, 380px);
    }

    .auth-card {
        padding: 1.5rem 1.25rem;
    }

    .auth-card-register {
        width: 100%;
    }
}