/* ═══════════════════════════════════════════════════════════════════════════
   The Port Dental Clinic — Layout System (Header, Footer, Grid, Sections)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Container ─────────────────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-lg {
    max-width: var(--container-2xl);
}

.container-sm {
    max-width: var(--container-md);
}

/* ── Sections ──────────────────────────────────────────────────────────── */
.section {
    padding: var(--space-20) 0;
}

.section-sm {
    padding: var(--space-12) 0;
}

.section-lg {
    padding: var(--space-24) 0;
}

.section-alt {
    background: var(--color-bg-alt);
}

.section-dark {
    background: var(--color-secondary);
    color: var(--color-white);
}

.section-dark h2,
.section-dark h3 {
    color: var(--color-white);
}

.section-dark p {
    color: rgba(255, 255, 255, 0.8);
}

.section-primary {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-dark));
    color: var(--color-white);
}

.section-primary h2,
.section-primary h3 {
    color: var(--color-white);
}

.section-primary .section-label::before {
    background: var(--color-primary);
}

.section-primary .section-label {
    color: var(--color-primary-light);
}

/* ── Grid System ───────────────────────────────────────────────────────── */
.grid {
    display: grid;
    gap: var(--space-8);
}

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

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

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

.grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* ── Flex Utilities ────────────────────────────────────────────────────── */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

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

.items-start {
    align-items: flex-start;
}

.justify-between {
    justify-content: space-between;
}

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

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ═══════════════════════════════════════════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════════════════════════════════════════ */
.top-bar {
    background: var(--color-secondary);
    color: var(--color-white);
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.top-bar a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    transition: color var(--transition-fast);
    font-size: var(--text-sm);
}

.top-bar a:hover {
    color: var(--color-primary-light);
}

.top-bar svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.top-bar .social-links {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.top-bar .social-links a:hover {
    color: var(--color-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN HEADER / NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════ */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border-light);
    transition: all var(--transition-base);
}

.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) 0;
    min-height: 72px;
}

/* Logo */
.site-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
    flex-shrink: 0;
}

.site-logo .logo-img {
    height: auto;
    width: 160px;
    border-radius: 0;
    display: block;
}

.site-logo .logo-tagline {
    font-family: var(--font-body);
    font-size: 10px;
    color: var(--color-text-muted);
    font-weight: var(--weight-regular);
    letter-spacing: 0.5px;
    margin-top: 2px;
    padding-left: 2px;
}

/* Main Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.main-nav .nav-link {
    padding: var(--space-2) var(--space-4);
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.main-nav .nav-link:hover,
.main-nav .nav-link.active {
    color: var(--color-primary);
    background: var(--color-primary-subtle);
}

.main-nav .nav-link .nav-arrow {
    width: 14px;
    height: 14px;
    transition: transform var(--transition-fast);
}

/* Services Mega Menu */
.nav-dropdown {
    position: relative;
}

/* Bridge pseudo-element — prevents the menu from closing when crossing the gap */
.nav-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: -50%;
    right: -50%;
    height: 24px;
    pointer-events: none;
}

.nav-dropdown:hover::after,
.nav-dropdown:focus-within::after {
    pointer-events: auto;
}

.mega-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: min(860px, 90vw);
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow:
        0 20px 50px -10px rgba(0, 0, 0, 0.18),
        0 8px 20px -8px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: var(--z-dropdown);
    overflow: hidden;
}

.nav-dropdown:hover .mega-menu,
.nav-dropdown:focus-within .mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown:hover .nav-arrow {
    transform: rotate(180deg);
}

/* Top accent bar */
.mega-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    z-index: 1;
}

.mega-menu-grid {
    display: grid;
    /* Proportional widths: General(3) ≈ 0.8fr, Restorative(7) ≈ 1.2fr, Cosmetic(5) ≈ 1fr, Specialized(7) ≈ 1.2fr */
    grid-template-columns: 0.85fr 1.15fr 1fr 1.15fr;
    gap: 0;
    padding: var(--space-6) var(--space-5) var(--space-4);
    align-items: start;
}

.mega-menu-category {
    padding: 0 var(--space-4);
}

.mega-menu-category:first-child {
    padding-left: var(--space-2);
}

.mega-menu-category:last-child {
    padding-right: var(--space-2);
}

.mega-menu-category:not(:last-child) {
    border-right: 1px solid var(--color-border-light);
}

.mega-menu-category h4 {
    font-size: 10.5px;
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-secondary);
    margin-bottom: var(--space-2);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-primary);
    display: block;
    line-height: 1.4;
    white-space: nowrap;
}

.mega-menu-category a {
    display: block;
    padding: 5px 8px;
    font-size: 13px;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
    line-height: 1.5;
    position: relative;
}

.mega-menu-category a:hover {
    background: var(--color-primary-subtle);
    color: var(--color-secondary);
    padding-left: 12px;
}

/* Mega menu footer bar */
.mega-menu-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-5);
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border-light);
}

.mega-menu-footer span {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* Header CTA Buttons */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.header-phone {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-secondary);
    text-decoration: none;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.header-phone:hover {
    color: var(--color-primary);
    background: var(--color-primary-subtle);
}

.header-phone svg {
    width: 18px;
    height: 18px;
    color: var(--color-primary);
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-2);
    cursor: pointer;
}

.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */
.site-footer {
    background: var(--color-secondary);
    color: rgba(255, 255, 255, 0.85);
}

.footer-main {
    padding: var(--space-16) 0 var(--space-12);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: var(--space-10);
}

/* Footer About / Brand */
.footer-brand .footer-logo {
    display: inline-block;
    margin-bottom: var(--space-4);
}

.footer-brand .footer-logo-img {
    width: 150px;
    height: auto;
    display: block;
    filter: brightness(0) invert(1);
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-6);
}

.footer-brand .footer-social {
    display: flex;
    gap: var(--space-3);
}

.footer-brand .footer-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: var(--color-white);
    transition: all var(--transition-base);
}

.footer-brand .footer-social a:hover {
    background: var(--color-primary);
    transform: translateY(-2px);
}

.footer-brand .footer-social a svg {
    width: 18px;
    height: 18px;
}

/* Footer Columns */
.footer-column h4 {
    font-family: var(--font-heading);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
    margin-bottom: var(--space-5);
}

.footer-column ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.footer-column ul li a {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--text-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.footer-column ul li a:hover {
    color: var(--color-primary-light);
    padding-left: var(--space-2);
}

/* Footer Contact Info */
.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.footer-contact-item svg {
    width: 18px;
    height: 18px;
    color: var(--color-primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.footer-contact-item a,
.footer-contact-item span {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--text-sm);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-contact-item a:hover {
    color: var(--color-primary-light);
}

/* Footer Hours */
.footer-hours {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.footer-hours .hour-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-sm);
}

.footer-hours .hour-day {
    color: var(--hour-day-color, rgba(255, 255, 255, 0.7));
}

.footer-hours .hour-time {
    color: var(--hour-time-color, var(--color-white));
    font-weight: var(--weight-medium);
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-6) 0;
}

.footer-bottom .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-bottom p {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FLOATING MOBILE CTA BAR
   ═══════════════════════════════════════════════════════════════════════════ */
.mobile-cta-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    background: var(--color-white);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    padding: var(--space-3) var(--space-4);
    gap: var(--space-3);
}

.mobile-cta-bar a {
    flex: 1;
    text-align: center;
}

/* ── Two Column Layout ─────────────────────────────────────────────────── */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    align-items: center;
}

.two-col-reverse {
    direction: rtl;
}

.two-col-reverse > * {
    direction: ltr;
}

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #0A2540 0%, var(--color-secondary) 30%, #003A54 65%, #002A3E 100%);
    color: var(--color-white);
}

.hero-bg-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(0, 188, 201, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 20%, rgba(0, 188, 201, 0.10) 0%, transparent 40%),
        radial-gradient(circle at 60% 85%, rgba(0, 188, 201, 0.08) 0%, transparent 35%),
        radial-gradient(circle at 40% 10%, rgba(0, 188, 201, 0.06) 0%, transparent 30%);
    pointer-events: none;
}

/* Subtle dot texture overlay */
.hero-bg-pattern::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

/* Floating decorative circle accents */
.hero-bg-pattern::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    border: 1px solid rgba(0, 188, 201, 0.1);
    top: -150px;
    right: -100px;
    pointer-events: none;
    animation: floatSlow 20s ease-in-out infinite;
}

@keyframes floatSlow {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-20px, 15px) rotate(3deg); }
}

/* Bottom curve separator — homepage only */
.home-hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 32px;
    background: var(--color-white);
    clip-path: ellipse(55% 100% at 50% 100%);
    z-index: 2;
}

.hero .container {
    position: relative;
    z-index: 1;
}
