/* ===========================
   RESPONSIVE DESIGN - Mobile First Approach
   Professional Dental Clinic Website
   =========================== */

/* ===========================
   MOBILE (320px - 480px)
   =========================== */

@media (max-width: 480px) {
    /* General */
    * {
        -webkit-tap-highlight-color: transparent;
    }

    html, body {
        width: 100%;
        overflow-x: hidden;
    }

    body {
        padding-top: 106px; /* sticky-bar (46px) + navbar (60px) */
    }

    .container {
        padding: 0 15px;
    }

    /* Sticky Bar */
    .sticky-bar {
        padding: 8px 15px;
        font-size: 11px;
        position: sticky;
        top: 0;
        z-index: 999;
    }

    .sticky-bar .container {
        flex-direction: column;
        gap: 6px;
    }

    .sticky-bar span {
        display: block;
        text-align: center;
        word-wrap: break-word;
    }

    /* Navigation */
    .navbar {
        padding: 10px 15px;
        position: fixed;
        top: 46px; /* Below sticky-bar */
        width: 100%;
        left: 0;
        right: 0;
        z-index: 998;
        backface-visibility: hidden;
        will-change: transform;
        transition: transform 250ms ease;
    }
    /* When JS hides the navbar on scroll, this class provides a CSS fallback */
    .navbar--hidden {
        transform: translateY(-100%);
    }

    .nav-container {
        padding: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .logo img {
        height: 40px;
        width: auto;
    }

    /* Nav actions hidden on mobile (< 768px) */
    .nav-actions {
        display: none;
        gap: 10px;
        align-items: center;
    }

    .nav-actions .nav-phone {
        color: #0F172A;
        font-weight: 600;
        font-size: 14px;
        text-decoration: none;
        padding: 8px 10px;
    }

    .nav-actions .nav-cta {
        display: inline-block;
        padding: 10px 14px;
        border-radius: 8px;
        background: #0EA5A3;
        color: #fff;
        font-weight: 700;
        text-decoration: none;
        font-size: 14px;
    }

    /* Mobile nav uses transforms for smoother transitions and avoids layout reflow */
    .nav-menu {
        display: flex !important;
        position: fixed !important;
        top: 106px !important;
        left: 0 !important;
        width: 100% !important;
        height: calc(100vh - 106px) !important;
        background-color: #ffffff !important;
        flex-direction: column !important;
        gap: 0 !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
        z-index: 997 !important;
        overflow-y: auto !important;
        padding-top: 0 !important;
        margin: 0 !important;
        transform: translateX(-100%) !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1), opacity 300ms ease !important;
        visibility: hidden !important;
    }

    .nav-menu.active {
        transform: translateX(0) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        visibility: visible !important;
    }

    .nav-menu li {
        border-bottom: 1px solid #f0f0f0;
        margin: 0;
    }

    .nav-menu a {
        display: block;
        padding: 16px 20px;
        color: #0F172A;
        font-weight: 500;
        font-size: 15px;
        transition: all 0.3s ease;
        border-left: 4px solid transparent;
    }

    .nav-menu a:hover,
    .nav-menu a.active {
        background-color: #f0f8f7;
        color: #0EA5A3;
        border-left-color: #0EA5A3;
        padding-left: 25px;
    }

    .hamburger {
        display: flex !important;
        flex-direction: column;
        cursor: pointer;
        gap: 5px;
        background: none;
        border: none;
        padding: 5px;
        align-items: center;
        justify-content: center;
        z-index: 1000 !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }



    .hamburger span {
        width: 24px !important;
        height: 2.5px !important;
        background-color: #0F172A !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        display: block !important;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(10px, 10px) !important;
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0 !important;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px) !important;
    }

    /* Hero Section */
    .hero {
        padding: 40px 15px;
        min-height: auto;
        margin-top: 0;
    }

    .hero h1 {
        font-size: 26px;
        font-weight: 700;
        margin-bottom: 12px;
        line-height: 1.3;
    }

    .hero p {
        font-size: 15px;
        margin-bottom: 20px;
        line-height: 1.5;
    }

    .hero-ctas {
        flex-direction: column;
        gap: 10px;
    }

    .hero-ctas .btn {
        width: 100%;
        padding: 14px 16px;
        font-size: 14px;
        min-height: 48px;
    }

    /* Trust Markers */
    .trust-markers {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 25px;
    }

    .trust-marker {
        padding: 16px;
        background: rgba(14, 165, 163, 0.05);
        border-radius: 8px;
    }

    .trust-marker strong {
        display: block;
        font-size: 22px;
        margin-bottom: 4px;
    }

    .trust-marker span {
        font-size: 13px;
    }

    /* Buttons & Links */
    .btn {
        padding: 12px 18px;
        font-size: 14px;
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        transition: all 0.3s ease;
    }

    .btn:active {
        transform: scale(0.98);
    }

    .btn-large {
        padding: 14px 22px;
        font-size: 15px;
        min-height: 48px;
    }

    .btn-block {
        display: block;
        width: 100%;
    }

    a {
        -webkit-touch-callout: none;
    }

    /* Headings */
    h1 {
        font-size: 26px;
        line-height: 1.2;
    }

    h2 {
        font-size: 22px;
        line-height: 1.3;
    }

    h3 {
        font-size: 18px;
        line-height: 1.3;
    }

    h4 {
        font-size: 16px;
    }

    p {
        font-size: 15px;
        line-height: 1.6;
    }

    /* Sections */
    section {
        padding: 35px 0;
    }

    /* Cards & Grids */
    .info-grid,
    .services-grid,
    .features-grid,
    .testimonial-grid,
    .values-grid,
    .why-choose-us,
    .stats-grid,
    .team-grid,
    .commitment-grid,
    .faq-grid,
    .mission-vision,
    .process-steps {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Forms */
    input,
    textarea,
    select {
        width: 100%;
        padding: 12px;
        font-size: 16px;
        min-height: 48px;
        border: 1px solid #ddd;
        border-radius: 6px;
        font-family: inherit;
    }

    input[type="submit"],
    input[type="button"],
    button {
        min-height: 48px;
        font-size: 15px;
        cursor: pointer;
    }

    textarea {
        min-height: 120px;
        resize: vertical;
    }

    /* Footer */
    footer {
        padding: 40px 15px 20px;
    }

    footer .container {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    footer h4 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    footer p {
        font-size: 14px;
        margin-bottom: 8px;
    }

    footer ul li {
        margin-bottom: 6px;
    }

    footer a {
        font-size: 14px;
    }

    .footer-brand {
        margin-bottom: 15px;
        padding-bottom: 15px;
        border-bottom: 2px solid #333;
    }

    .footer-brand-logo {
        font-size: 28px;
    }

    .footer-brand-text h3 {
        font-size: 18px;
        margin-bottom: 3px;
    }

    .footer-brand-text p {
        font-size: 12px;
    }

    .footer-bottom {
        font-size: 12px;
        margin-top: 20px;
    }

    .powered-by {
        font-size: 11px;
        margin-top: 8px;
    }

    /* Page Header */
    .page-header {
        padding: 40px 15px;
    }

    .page-header h1 {
        font-size: 26px;
    }

    .page-header p {
        font-size: 14px;
    }

    /* Map */
    .map-container {
        height: 250px;
        border-radius: 6px;
    }

    /* Contact Form */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    /* Service Items */
    .service-detail-item {
        padding-left: 15px;
        margin-bottom: 35px;
    }

    .service-detail-item h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }

    /* CTA Section */
    .cta-section {
        padding: 35px 15px;
    }

    .cta-section h2 {
        font-size: 22px;
    }

    .cta-section p {
        font-size: 14px;
    }

    /* Social Links */
    .social-links {
        display: flex;
        gap: 12px;
    }

    .social-links a {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
    }

    /* Icon Elements */
    .icon {
        font-size: 32px;
    }

    /* Image Containers */
    img {
        max-width: 100%;
        height: auto;
        display: block;
    }
}

/* ===========================
   SMALL TABLET (481px - 768px)
   =========================== */

@media (min-width: 481px) and (max-width: 768px) {
    body {
        padding-top: 111px; /* sticky-bar (46px) + navbar (65px) */
    }

    .container {
        padding: 0 20px;
    }

    /* Sticky Bar */
    .sticky-bar {
        padding: 10px 20px;
        font-size: 12px;
        position: sticky;
        top: 0;
        z-index: 999;
    }

    .sticky-bar .container {
        gap: 15px;
    }

    /* Navigation */
    .navbar {
        padding: 12px 20px;
        position: fixed;
        top: 46px; /* Below sticky-bar */
        width: 100%;
        z-index: 998;
    }

    .nav-container {
        padding: 0;
    }

    .logo img {
        height: 45px;
    }

    .nav-menu {
        display: flex !important;
        position: fixed;
        top: 111px; /* Below sticky-bar + navbar */
        left: 0;
        width: 100%;
        height: calc(100vh - 111px);
        background-color: white;
        flex-direction: column;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        z-index: 997;
        overflow-y: auto;
        padding: 0;
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1), opacity 300ms ease;
    }

    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-menu li {
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-menu a {
        display: block;
        padding: 15px 20px;
        color: #0F172A;
        font-weight: 500;
        font-size: 15px;
        border-left: 4px solid transparent;
    }

    .nav-menu a:hover,
    .nav-menu a.active {
        background-color: #f0f8f7;
        color: #0EA5A3;
        border-left-color: #0EA5A3;
        padding-left: 24px;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        gap: 5px;
        background: none;
        border: none;
        padding: 5px;
        order: 2;
        margin-left: auto;
    }

    .hamburger span {
        width: 24px;
        height: 2.5px;
        background-color: #0F172A;
        transition: all 0.3s ease;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(9px, 9px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    /* Hero */
    .hero {
        padding: 50px 20px;
        min-height: auto;
    }

    .hero h1 {
        font-size: 32px;
        margin-bottom: 15px;
    }

    .hero p {
        font-size: 16px;
        margin-bottom: 25px;
    }

    .hero-ctas {
        flex-direction: column;
        gap: 12px;
    }

    .hero-ctas .btn {
        max-width: 300px;
        margin: 0 auto;
        padding: 13px 24px;
        font-size: 14px;
    }

    /* Trust Markers */
    .trust-markers {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        margin-top: 30px;
    }

    .trust-marker {
        padding: 20px;
    }

    /* Headings */
    h1 {
        font-size: 30px;
    }

    h2 {
        font-size: 24px;
    }

    h3 {
        font-size: 18px;
    }

    /* Buttons */
    .btn {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 46px;
    }

    /* Forms */
    input,
    textarea,
    select {
        padding: 11px;
        font-size: 16px;
        min-height: 46px;
    }

    /* Sections */
    section {
        padding: 45px 20px;
    }

    /* Grids */
    .info-grid,
    .services-grid,
    .features-grid,
    .testimonial-grid,
    .values-grid,
    .why-choose-us,
    .stats-grid,
    .team-grid,
    .commitment-grid,
    .faq-grid,
    .mission-vision,
    .process-steps {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* Footer */
    footer {
        padding: 45px 20px 25px;
    }

    footer .container {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .footer-bottom {
        grid-column: 1 / -1;
    }

    /* Maps */
    .map-container {
        height: 300px;
    }
}

/* ===========================
   LANDSCAPE MOBILE
   =========================== */

@media (max-height: 600px) and (orientation: landscape) {
    body {
        padding-top: 55px;
    }

    .navbar {
        padding: 8px 15px;
    }

    .logo img {
        height: 35px;
    }

    .hero {
        padding: 30px 15px;
    }

    .hero h1 {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .hero p {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .hero-ctas {
        gap: 8px;
    }

    .page-header {
        padding: 25px 15px;
    }

    .sticky-bar {
        padding: 5px 15px;
        font-size: 11px;
    }
}

/* ===========================
   TABLET (769px - 1024px)
   =========================== */

@media (min-width: 769px) {
    .hamburger {
        display: none !important;
    }

    .nav-menu {
        display: flex !important;
        position: static !important;
        flex-direction: row;
        height: auto;
        width: auto;
        box-shadow: none;
        gap: 30px;
        padding: 0;
        margin: 0 auto; /* center nav on larger screens */
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transition: none;
    }

    .nav-menu li {
        border-bottom: none;
    }

    .nav-menu a {
        padding: 0;
        border-left: none;
    }

    .nav-menu a:hover {
        background-color: transparent;
        padding-left: 0;
    }

    body {
        padding-top: 0;
    }

    .navbar {
        position: sticky;
        top: 0;
        padding: 15px 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sticky-bar {
        position: static;
    }

    /* Nav actions shown on desktop/tablet (>=769px) */
    .nav-actions {
        display: flex;
        margin-left: auto;
        gap: 12px;
        align-items: center;
    }

    .nav-actions .nav-phone {
        display: inline-block;
    }

    .nav-actions .nav-cta {
        display: inline-block;
    }

    /* Grids for 2 columns */
    .trust-markers {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Nav container layout: logo left, nav centered, actions right */
    .nav-container {
        display: flex;
        align-items: center;
        gap: 20px;
        width: 100%;
        max-width: 1200px;
        margin: 0 auto;
    }

    .nav-menu a {
        padding: 8px 6px;
        font-size: 15px;
    }

    .team-grid,
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    footer .container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===========================
   DESKTOP (1025px+)
   =========================== */

@media (min-width: 1025px) {
    .hamburger {
        display: none !important;
    }

    .nav-menu {
        display: flex !important;
    }

    .nav-container {
        display: flex;
        align-items: center;
        gap: 24px;
        max-width: 1200px;
        margin: 0 auto;
    }

    .nav-actions {
        margin-left: auto;
    }

    .nav-menu {
        gap: 36px;
    }

    /* Desktop specific optimizations */
    .container {
        max-width: 1200px;
    }

    .hero {
        min-height: 500px;
        padding: 100px 20px;
    }

    .hero h1 {
        font-size: 48px;
    }

    .hero p {
        font-size: 18px;
    }

    section {
        padding: 80px 20px;
    }

    .hero-ctas {
        gap: 20px;
    }

    .hero-ctas .btn {
        max-width: none;
        margin: 0 10px;
    }

    /* Grids expand to 3+ columns */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .team-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .commitment-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    footer .container {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Tooltips and hovers can be more responsive */
    .btn {
        transition: all 0.3s ease;
    }

    .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

/* ===========================
   PRINT STYLES
   =========================== */

@media print {
    .navbar,
    .sticky-bar,
    .hamburger,
    .nav-menu,
    .cta-section,
    footer {
        display: none;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: white;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    img {
        max-width: 100%;
        page-break-inside: avoid;
    }
}

/* ===========================
   ACCESSIBILITY
   =========================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: more) {
    body {
        color: #000;
    }

    a {
        text-decoration: underline;
    }

    button {
        border: 2px solid #000;
    }
}
