/*
 * DressMe - responsive fixes (mobile / tablet)
 * Loaded after every page stylesheet (see base.html), so rules here win.
 * Keep fixes grouped by area; prefer scoped selectors over global ones.
 */

/* ===================== HOME HERO ACTIONS ===================== */
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

/* Capsule buttons with a fading brand gradient and a chevron on the right.
   Scoped to .hero-actions: .hero-btn is also used by admin pages. */
.hero-actions .hero-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 15px 30px 15px 36px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(90deg, rgba(15, 15, 15, 0.78) 0%, rgba(15, 15, 15, 0.55) 45%, rgba(19, 167, 148, 0.55) 100%);
    background-size: 200% 100%;
    background-position: 0% 0;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
    transition: background-position 0.5s ease, transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.hero-actions .hero-btn::after {
    content: "\203A";
    font-size: 1.5em;
    line-height: 0.6;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.hero-actions .hero-btn:hover {
    background-position: 100% 0;
    border-color: rgba(19, 167, 148, 0.7);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(19, 167, 148, 0.3);
}

.hero-actions .hero-btn:hover::after {
    transform: translateX(4px);
}

.hero-actions .hero-btn.hero-btn-primary {
    border-color: transparent;
    background: linear-gradient(90deg, #0a5f55 0%, var(--color-primary) 50%, #4fd8c6 100%);
    background-size: 200% 100%;
    background-position: 0% 0;
    box-shadow: 0 8px 24px rgba(19, 167, 148, 0.4);
}

.hero-actions .hero-btn.hero-btn-primary:hover {
    background-position: 100% 0;
    box-shadow: 0 12px 30px rgba(19, 167, 148, 0.55);
}

.site-copyright {
    color: #888;
}

/* ===================== STAFF "EDIT SECTION" BUTTONS ===================== */
/* They sat above the fixed header (z-index 2000) and, on the hero, right where the
   menu / admin buttons are, blocking them. Keep them under the header and below it. */
.admin-edit-btn {
    z-index: 999 !important;
}

.hero-section .admin-edit-btn {
    top: 110px !important;
}

@media (max-width: 991px) {
    .hero-section .admin-edit-btn {
        top: 76px !important;
        right: 14px !important;
        font-size: 0.8rem;
        padding: 8px 12px;
    }
}

/* ===================== DARK PUBLIC PAGES ===================== */
/* Beauty Lounge / Dressmeni were designed on black, but Bootstrap's white body
   loaded later was winning, hiding the white "Dressmeni" title */
body.dark-page {
    background-color: var(--color-bg);
    color: var(--color-text);
}

/* Full-screen PDF viewer: no extra space below it */
body.viewer-page {
    background-color: #111;
    padding-bottom: 0 !important;
}

/* ===================== PUBLIC HEADER ===================== */
.nav-mobile-only {
    display: none;
}

@media (max-width: 991px) {
    /* One compact row: [profile] [logo] [menu] instead of three stacked rows */
    header {
        display: grid !important;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        flex-direction: row !important;
        padding: 10px 16px !important;
        background: rgba(0, 0, 0, 0.92) !important;
    }

    header .header-left,
    header .logo-container,
    header .header-right {
        width: auto !important;
        margin: 0 !important;
        flex: none !important;
        min-width: 0;
    }

    header .header-left {
        justify-content: flex-start !important;
    }

    header .logo-container {
        justify-content: center !important;
    }

    header .header-right {
        flex-direction: row !important;
        justify-content: flex-end !important;
    }

    header .logo-container img {
        height: 40px !important;
    }

    /* Login / dashboard / admin move into the menu */
    header .header-right > .login-btn,
    header .header-left .nav-link-mini {
        display: none !important;
    }

    /* Logged-in staff: only the profile + logout icons, so the logo keeps its space */
    header .user-profile-card-mini {
        padding: 6px 10px !important;
    }

    header .user-profile-card-mini .profile-info-mini {
        display: none;
    }

    header .user-profile-card-mini .profile-icon-mini {
        margin-right: 8px;
    }

    .header-right nav {
        top: 68px !important;
        right: 12px !important;
        left: 12px;
        padding: 24px !important;
        align-items: center;
    }

    .header-right nav .nav-link-tab {
        margin: 0 0 16px 0 !important;
    }

    .nav-mobile-only {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 14px;
        width: 100%;
        padding-top: 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-mobile-only .nav-mobile-cta {
        margin: 0 !important;
        padding: 10px 28px;
        border-radius: 30px;
        background: var(--color-primary);
        color: #000 !important;
        font-size: 1.05rem !important;
    }

    .nav-mobile-only .nav-mobile-small {
        color: #aaa;
        font-size: 0.9rem;
    }
}

/* ===================== BOOKING PAGE ===================== */
/* The page has its own "Volver al Sitio" link and the form overlay its own close button */
.booking-page .global-back-btn {
    display: none !important;
}

body.booking-page {
    padding-bottom: 0;
}

/* The form's close (X) was drawn under the form itself and could not be tapped on phones */
.booking-page .close-btn {
    z-index: 5;
}

@media (max-width: 767px) {
    /* Room to scroll "Confirmar reserva" above the WhatsApp bubble */
    .booking-page .form-container {
        padding-bottom: 96px;
    }

    .booking-page .close-btn {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        line-height: 1;
        background: rgba(0, 0, 0, 0.6);
        border-radius: 50%;
        font-size: 1.6rem;
    }
}

/* Two fields per row must shrink to fit narrow screens */
.booking-page .form-row > .form-group {
    min-width: 0;
}

.booking-page .form-group input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Assistant bubble steps aside while the booking form or its confirmation is open */
.booking-page:has(.booking-overlay.active) #dm-chat,
.booking-page:has(.success-modal) #dm-chat {
    display: none !important;
}

/* ===================== STAFF PANEL ===================== */
/* Dashboard menu cards: keep the subtitle off the teal corner */
.admin-page .menu-card p {
    max-width: 82%;
}

/* Delete button sits on the card's bottom-left corner: keep text clear of it */
.admin-page .list-card:has(> button.btn-outline-danger) > a > .mt-3 {
    padding-left: 44px;
    min-height: 32px;
}

/* Wide tables scroll sideways instead of being cut off */
.admin-page .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767px) {
    .admin-page .dashboard-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
        margin-top: 20px !important;
    }

    /* Dashboard top bar: title on its own line, controls underneath */
    .admin-page .header-capsule {
        flex-direction: column;
        gap: 10px;
        border-radius: 24px !important;
        padding: 14px 16px !important;
        margin-bottom: 24px !important;
    }

    .admin-page .header-capsule > div:first-child {
        position: static !important;
        transform: none !important;
        text-align: center;
    }

    .admin-page .header-capsule > div:nth-child(2) {
        display: none;
    }

    .admin-page .header-capsule h1 {
        font-size: 1.5rem !important;
    }

    /* Dashboard menu: two compact columns instead of eight tall cards */
    .admin-page .menu-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        margin-bottom: 30px !important;
    }

    .admin-page .menu-card {
        padding: 20px 10px !important;
        border-radius: 16px !important;
    }

    .admin-page .menu-card i {
        font-size: 2.2rem !important;
        margin-bottom: 10px !important;
    }

    .admin-page .menu-card h2 {
        font-size: 1rem !important;
    }

    .admin-page .menu-card p {
        font-size: 0.72rem !important;
        margin-top: 4px !important;
        max-width: 100%;
    }

    .admin-page .stats-bar {
        gap: 10px !important;
        margin-bottom: 24px !important;
    }

    .admin-page .mini-stat {
        min-width: 0 !important;
        flex: 1 1 28% !important;
        padding: 14px 6px !important;
    }

    /* Customers list: title + back button and the search bar fit the screen */
    .admin-page .page-header {
        gap: 12px;
    }

    .admin-page .page-title {
        font-size: 1.8rem !important;
        margin: 0;
    }

    .admin-page .action-bar {
        flex-direction: column;
        padding: 14px !important;
        gap: 10px !important;
    }

    .admin-page .action-bar > .btn-action {
        text-align: center;
    }

    .admin-page .customer-table {
        min-width: 720px;
    }

    /* Announcements: expiry date box wraps instead of overflowing the card */
    .admin-page .date-wrapper {
        flex-wrap: wrap;
        max-width: 100%;
        box-sizing: border-box;
        border-radius: 16px !important;
    }

    .admin-page .date-wrapper input[type="date"] {
        min-width: 0;
        max-width: 100%;
    }
}

/* ===================== FLOATING BUTTONS ===================== */
/* Leave room at the end of every page so the floating buttons never cover the last control */
body {
    padding-bottom: 100px;
}

@media (max-width: 767px) {
    body {
        padding-bottom: 100px;
    }

    /* Back button: compact round icon (phones also have their own back gesture) */
    .global-back-btn {
        left: 14px !important;
        bottom: 14px !important;
        width: 46px;
        height: 46px;
        padding: 0 !important;
        justify-content: center;
        border-radius: 50% !important;
        background-color: rgba(30, 30, 30, 0.85) !important;
        backdrop-filter: blur(6px);
    }

    .global-back-btn .global-back-label {
        display: none;
    }

    /* HOME HERO: buttons stacked with the same width */
    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .hero-actions .hero-btn {
        width: min(280px, 100%);
        text-align: center;
        padding: 14px 20px;
        box-sizing: border-box;
        letter-spacing: 1.5px;
        font-size: 0.85rem;
    }

    /* HOME MAP: location buttons in one row at the bottom, address stays on top */
    #section-8 .map-controls {
        top: auto !important;
        bottom: 16px;
        left: 50% !important;
        transform: translateX(-50%);
        flex-direction: row !important;
        gap: 8px !important;
    }

    #section-8 .map-btn {
        width: auto !important;
        padding: 9px 16px !important;
        white-space: nowrap;
    }

    #section-8 .map-btn:hover {
        transform: none;
    }

    #section-8 .map-overlay-title {
        top: 14px !important;
        width: max-content;
        max-width: calc(100% - 28px) !important;
        padding: 8px 16px !important;
    }

    #section-8 #map-address {
        font-size: 1rem !important;
    }
}

/* ===================== FOOTER CREDIT (Argus Sentinel) ===================== */
/* "Elaborado por" on the same line as the privacy link, at the right. The logo is grey
   and takes its colours on hover. */
.footer-bottom {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    margin-top: 14px;
}

.footer-policy {
    grid-column: 2;
    margin: 0;
    font-size: 0.9rem;
}

.site-credit {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #666;
    font-size: 0.9rem;
    transition: color 0.4s ease;
}

.site-credit img {
    height: 50px;
    width: auto;
    filter: grayscale(1) brightness(0.9);
    opacity: 0.8;
    transition: filter 0.4s ease, opacity 0.4s ease;
}

.site-credit:hover {
    color: #aaa;
}

.site-credit:hover img {
    filter: none;
    opacity: 1;
}

@media (max-width: 767px) {
    .footer-bottom {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 18px;
    }

    .footer-policy,
    .site-credit {
        grid-column: 1;
        justify-self: center;
    }

    .site-credit img {
        height: 44px;
    }
}
