/* ================================================
   MyRestoSmart — Shared Stylesheet
   Loaded before every page's <style> block.
   Page-specific overrides go in the page's <style>.
================================================ */

/* ── CSS VARIABLES ── */
:root {
    --primary: #F26522;
    --primary-dark: #d4541a;
    --primary-light: #FF8C42;
    --dark: #1A1A1A;
    --dark-2: #2D2D2D;
    --light-2: #F5F5F0;
    --gray-light: #E8E8E3;
    --text: #2D2D2D;
    --text-muted: #6B6B6B;
    --white: #FFFFFF;
    --success: #2ECC71;
    --danger: #E74C3C;
    --font-heading: 'Sora', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.09);
    --shadow-lg: 0 20px 56px rgba(0, 0, 0, 0.14);
    --radius: 16px;
}

/* ── BASE RESET ── */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--light-2);
    overflow-x: hidden;
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
}

/* ── NAVBAR ── */
.navbar {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0px 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow);
    padding: 0px;
}

.navbar-brand-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.3rem;
    text-decoration: none;
    color: var(--dark);
}

.navbar-brand-text span {
    color: var(--primary);
}

.navbar-nav .nav-link {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--dark) !important;
    padding: 7px 12px !important;
    border-radius: 8px;
    white-space: nowrap;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: var(--primary) !important;
    background: rgba(242, 101, 34, 0.06);
}

.navbar-nav .nav-link.active {
    color: var(--primary) !important;
}

.btn-nav-register {
    background: var(--primary);
    color: var(--white) !important;
    padding: 9px 20px !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: var(--transition);
}

.btn-nav-register:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(242, 101, 34, 0.35);
}

/* ── NAV: LOGIN BUTTON ── */
.btn-nav-login {
    border: 1.5px solid var(--gray-light) !important;
    border-radius: 50px !important;
    padding: 7.5px 18px !important;
    font-weight: 600 !important;
    font-size: 0.85rem;
    color: var(--dark) !important;
    white-space: nowrap;
    transition: var(--transition);
}

.btn-nav-login:hover {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    background: rgba(242, 101, 34, 0.05);
}

/* ── NAV: PROFILE QUICK-MENU TRIGGER ── */
.btn-nav-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid var(--gray-light);
    border-radius: 50px;
    padding: 5px 14px 5px 5px;
    background: white;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--dark);
    white-space: nowrap;
    max-width: 220px;
    transition: var(--transition);
}

.btn-nav-profile:hover {
    border-color: var(--primary);
    background: rgba(242, 101, 34, 0.04);
}

.btn-nav-profile .pnp-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.btn-nav-profile .pnp-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-nav-profile .pnp-chevron {
    font-size: 0.65rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ── PROFILE QUICK-MENU MODAL ── */
.pqm-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1.5px solid var(--gray-light);
    background: white;
    color: var(--dark);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}

.pqm-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(242, 101, 34, 0.04);
}

.pqm-btn-danger {
    color: #dc2626;
    border-color: #fca5a5;
}

.pqm-btn-danger:hover {
    background: rgba(220, 38, 38, 0.05);
    border-color: #dc2626;
    color: #dc2626;
}

/* ── PROFILE QUICK-MENU DROPDOWN (anchored under the nav button) ── */
.pnp-dropdown {
    min-width: 300px;
    padding: 0;
    border: none;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    margin-top: 12px !important;
}

.pnp-dropdown-header {
    background: var(--dark);
    color: white;
    padding: 16px 20px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pnp-dropdown-header i {
    color: var(--primary);
}

.pnp-dropdown-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.navbar-toggler {
    border: none;
    padding: 4px 8px;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler i {
    font-size: 2rem!important;
    line-height: 1;
}

.navbar-brand img {
    height: 80px;
    transition: var(--transition);
}

/* ── NAVBAR RESPONSIVE ──
   Nav collapses to the offcanvas menu below 1200px (navbar-expand-xl),
   so the logo just needs to scale down for the shorter fixed header.
   This block must stay AFTER the base .navbar-brand img rule above —
   same specificity, so source order is what makes the shrink win. ── */
@media (max-width: 1199.98px) {
    .navbar-brand img {
        height: 60px;
    }
}

/* Bootstrap's .container caps at 1140px through the xl tier (1200-1399px),
   tighter than the 1320px it gets at xxl — tighten the CTA area just in
   that range so it doesn't get squeezed off the edge. */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .navbar-nav {
        gap: 0 !important;
    }

    .navbar-nav .nav-link {
        padding: 7px 9px !important;
    }

    .navbar-collapse > .d-flex {
        gap: 8px !important;
    }

    .btn-nav-register {
        padding: 8px 14px !important;
        font-size: 0.78rem;
    }
}

@media (max-width: 767.98px) {
    .navbar-brand img {
        height: 52px;
    }
}

@media (max-width: 575.98px) {
    .navbar-brand img {
        height: 46px;
    }
}

/* ── PAGE HERO (base: dark gradient, no image)
   Override `background` and/or `padding` per page for image variants. ── */
.page-hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
    padding: 130px 0 70px;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 60%, rgba(242, 101, 34, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(242, 101, 34, 0.07) 0%, transparent 40%);
}

.hero-inner {
    position: relative;
    z-index: 2;
}

.hero-inner h1 {
    font-size: clamp(1.9rem, 3.5vw, 3rem);
    font-weight: 800;
    color: white;
    line-height: 1.15;
    margin-bottom: 14px;
}

.hero-inner h1 span {
    color: var(--primary);
}

.hero-inner p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    max-width: 500px;
    font-weight: 300;
    line-height: 1.7;
    margin: 0;
}

/* ── PAGE TAG (orange default; override in page <style> for other colors) ── */
.page-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(242, 101, 34, 0.15);
    border: 1px solid rgba(242, 101, 34, 0.3);
    color: var(--primary-light);
    padding: 7px 18px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

/* ── COMMON BUTTONS ── */
.btn-white {
    background: white;
    color: var(--primary);
    padding: 14px 30px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.92rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    transition: var(--transition);
}

.btn-white:hover {
    background: var(--dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.btn-cta-orange {
    background: var(--primary);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    white-space: nowrap;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.btn-cta-orange:hover {
    background: var(--primary-light);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(242, 101, 34, 0.4);
}

.btn-primary-cta {
    background: var(--primary);
    color: white;
    padding: 14px 30px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary-cta:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(242, 101, 34, 0.4);
}

/* ── NAVBAR UTILITY ── */
.fw-600 {
    font-weight: 600;
}

/* ── FOOTER ── */
.footer {
    background: var(--dark);
    padding: 40px 0 0;
}

.footer-brand img {
    height: 100px;
    margin-bottom: 14px;
    filter: brightness(0) invert(1);
}

.footer-tagline {
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.38);
    line-height: 1.7;
    max-width: 260px;
    margin-top: 10px;
}

.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.social-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
}

.social-btn:hover {
    background: var(--primary);
    color: white;
}

.footer-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    color: white;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 9px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.38);
    text-decoration: none;
    font-size: 0.86rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.87rem;
    margin-bottom: 12px;
}

.footer-contact-item i {
    color: var(--primary);
    margin-top: 2px;
    min-width: 16px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 48px;
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-bottom p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.2);
    margin: 0;
}

.footer-bottom a {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.25);
    text-decoration: none;
    margin-left: 14px;
    transition: var(--transition);
}

.footer-bottom a:hover {
    color: var(--primary);
}

.footer-bottom-links a {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    margin-left: 16px;
    transition: var(--transition);
}

.footer-bottom-links a:hover {
    color: var(--primary);
}

/* ── SCROLL TO TOP ── */
#scrollTop {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 46px;
    height: 46px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    font-size: 1.1rem;
    box-shadow: 0 8px 20px rgba(242, 101, 34, 0.35);
}

#scrollTop.visible {
    opacity: 1;
    visibility: visible;
}

#scrollTop:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ── ANIMATIONS ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.anim {
    animation: fadeInUp 0.5s ease both;
}

.card-anim {
    animation: fadeInUp 0.45s ease both;
}

/* ── MOBILE OFFCANVAS NAV ── */
#mobileMenu {
    background: linear-gradient(160deg, #1c1c1c 0%, #131313 100%);
    border-left: 1px solid rgba(242, 101, 34, 0.18);
    width: min(300px, 88vw);
    max-width: 300px;
    overflow: hidden;
}

/* decorative glows */
#mobileMenu::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -60px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(242, 101, 34, 0.1) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

#mobileMenu::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -40px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(79, 107, 244, 0.07) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

#mobileMenu .offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 22px 26px;
    position: relative;
    z-index: 1;
}

/* orange accent line under header */
#mobileMenu .offcanvas-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 56px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), transparent);
}

/* brand text in offcanvas */
#mobileMenu .navbar-brand-text {
    color: #fff;
    font-size: 1.15rem;
    text-decoration: none;
}

#mobileMenu .btn-close {
    filter: invert(1);
    opacity: 0.38;
    transition: opacity 0.2s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#mobileMenu .btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

#mobileMenu .offcanvas-body {
    padding: 20px 26px 36px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    overflow-y: auto;
}

/* stagger slide-in animation for nav items */
#mobileMenu .navbar-nav .nav-item {
    opacity: 0;
    transform: translateX(18px);
}

#mobileMenu.show .navbar-nav .nav-item {
    animation: ocSlideIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#mobileMenu.show .navbar-nav .nav-item:nth-child(1) { animation-delay: 0.07s; }
#mobileMenu.show .navbar-nav .nav-item:nth-child(2) { animation-delay: 0.12s; }
#mobileMenu.show .navbar-nav .nav-item:nth-child(3) { animation-delay: 0.17s; }
#mobileMenu.show .navbar-nav .nav-item:nth-child(4) { animation-delay: 0.22s; }
#mobileMenu.show .navbar-nav .nav-item:nth-child(5) { animation-delay: 0.27s; }
#mobileMenu.show .navbar-nav .nav-item:nth-child(6) { animation-delay: 0.32s; }
#mobileMenu.show .navbar-nav .nav-item:nth-child(7) { animation-delay: 0.37s; }

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

#mobileMenu .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.55) !important;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1rem;
    padding: 13px 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0 !important;
    background: none !important;
    display: flex;
    align-items: center;
    letter-spacing: 0.01em;
    transition: color 0.22s ease, padding-left 0.22s ease;
}

/* chevron arrow */
#mobileMenu .navbar-nav .nav-link::after {
    content: '';
    display: block;
    margin-left: auto;
    width: 5px;
    height: 5px;
    border-right: 1.5px solid rgba(255, 255, 255, 0.2);
    border-top: 1.5px solid rgba(255, 255, 255, 0.2);
    transform: rotate(45deg);
    flex-shrink: 0;
    transition: border-color 0.22s ease, transform 0.22s ease;
}

#mobileMenu .navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.95) !important;
    padding-left: 7px !important;
}

#mobileMenu .navbar-nav .nav-link:hover::after {
    border-color: var(--primary);
    transform: rotate(45deg) translate(2px, -2px);
}

#mobileMenu .navbar-nav .nav-link.active {
    color: var(--primary) !important;
    font-weight: 600;
}

#mobileMenu .navbar-nav .nav-link.active::after {
    border-color: var(--primary);
}

/* CTA buttons fade-up */
#mobileMenu.show .mobile-nav-cta {
    animation: ocFadeUp 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.42s both;
}

@keyframes ocFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mobile-nav-cta {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-mobile-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.04);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: var(--transition);
}

.btn-mobile-login:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(242, 101, 34, 0.07);
}

.btn-mobile-register {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 4px 18px rgba(242, 101, 34, 0.32);
}

.btn-mobile-register:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(242, 101, 34, 0.42);
}

.btn-mobile-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    border-radius: 12px;
    border: 1.5px solid rgba(220, 38, 38, 0.3);
    color: #f87171;
    background: rgba(220, 38, 38, 0.06);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-mobile-logout:hover {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.12);
    color: #fca5a5;
}

/* ── FOOTER MOBILE ── */
@media (max-width: 767px) {
    .footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-brand img {
        height: 72px;
    }

    .footer-tagline {
        text-align: center;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-heading {
        margin-top: 8px;
    }
}