/* ===========================================
   D & D Redoubt - Responsive Stylesheet
   Mobile-First Responsive Design
   =========================================== */

/* === TABLET AND BELOW (< 992px) === */
@media screen and (max-width: 991px) {
    
    /* Typography adjustments */
    html {
        font-size: 15px;
    }
    
    /* Top Bar */
    .top-bar-content {
        justify-content: center;
        text-align: center;
    }
    
    .top-bar-right {
        width: 100%;
        justify-content: center;
    }
    
    /* Navigation */
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 100px;
        left: -100%;
        width: 100%;
        max-width: 400px;
        height: calc(100vh - 100px);
        background: var(--color-white);
        flex-direction: column;
        padding: var(--spacing-md);
        box-shadow: var(--shadow-xl);
        transition: left var(--transition-smooth);
        overflow-y: auto;
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-item {
        width: 100%;
        margin-bottom: var(--spacing-sm);
    }
    
    .nav-link {
        display: block;
        padding: var(--spacing-sm);
        border-bottom: 1px solid var(--color-light-gray);
    }
    
    .nav-link::after {
        display: none;
    }
    
    .nav-cta {
        margin-top: var(--spacing-md);
    }
    
    .btn-nav {
        width: 100%;
    }
    
    /* Hero Section */
    .hero-section {
        height: 70vh;
        min-height: 500px;
    }
    
    .hero-slide {
        background-attachment: scroll;
    }
    
    .hero-content {
        padding: var(--spacing-md);
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    /* Values Section */
    .values-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .values-text {
        order: 1;
    }
    
    .values-image {
        order: 2;
    }
    
    .values-grid {
        grid-template-columns: 1fr;
    }
    
    /* Testimonials */
    .testimonials-slider {
        grid-template-columns: 1fr;
    }
    
    /* CTA Buttons */
    .cta-buttons {
        flex-direction: column;
    }
    
    .cta-buttons a {
        width: 100%;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .partner-logos {
        flex-direction: column;
    }
    
    /* AMSOIL Page */
    .history-content {
        grid-template-columns: 1fr !important;
    }
    
    .history-stats {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr !important;
    }
    
    .conditions-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* === MOBILE (< 768px) === */
@media screen and (max-width: 767px) {
    
    /* Typography */
    html {
        font-size: 14px;
    }
    
    /* Container padding */
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    /* Top Bar */
    .top-bar {
        font-size: 0.75rem;
    }
    
    .top-bar-content {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .top-bar-left,
    .top-bar-right {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .top-bar-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    /* Header */
    .main-nav {
        padding: var(--spacing-xs) 0;
    }
    
    .nav-logo img {
        height: 45px;
    }
    
    .nav-menu {
        top: 80px;
        height: calc(100vh - 80px);
        max-width: 100%;
    }
    
    /* Hero Section */
    .hero-section {
        height: 60vh;
        min-height: 400px;
    }
    
    .hero-title {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.5rem);
    }
    
    .hero-tagline {
        font-size: clamp(0.875rem, 2vw, 1.25rem);
    }
    
    .scroll-indicator {
        display: none;
    }
    
    /* Sections */
    .services-section,
    .values-section,
    .testimonials-section,
    .cta-section {
        padding: var(--spacing-lg) 0;
    }
    
    /* Section Headers */
    .section-title {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    /* Service Cards */
    .service-card {
        margin-bottom: var(--spacing-md);
    }
    
    .service-image {
        height: 200px;
    }
    
    .service-content {
        padding: var(--spacing-sm);
    }
    
    /* Values Grid */
    .value-item {
        padding: var(--spacing-sm);
    }
    
    .value-icon {
        width: 36px;
        height: 36px;
    }
    
    /* Testimonials */
    .testimonial {
        padding: var(--spacing-md);
    }
    
    .testimonial-text {
        font-size: 1rem;
    }
    
    /* Buttons */
    .btn-primary,
    .btn-secondary,
    .btn-outline,
    .btn-hero,
    .btn-service {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .btn-hero {
        font-size: 1.125rem;
        padding: 1rem 2rem;
    }
    
    /* Footer */
    .main-footer {
        padding: var(--spacing-lg) 0 var(--spacing-sm) 0;
    }
    
    .footer-badges {
        justify-content: center;
    }
    
    .footer-badges .badge {
        height: 30px;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .social-icon {
        width: 28px;
        height: 28px;
    }
    
    .partner-logo {
        height: 40px;
    }
    
    /* Back to Top */
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    /* AMSOIL Page Specific */
    .page-hero {
        height: 40vh;
        min-height: 300px;
    }
    
    .page-hero-title {
        font-size: clamp(1.75rem, 6vw, 3rem);
		
    }
    
    .page-hero-subtitle {
        font-size: clamp(0.875rem, 3vw, 1.25rem);
		color: var(--color-cream);
		
    }
    
    .history-stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .benefits-grid,
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .benefit-card {
        padding: var(--spacing-md);
    }
    
    .benefit-icon {
        width: 48px;
        height: 48px;
    }
    
    .conditions-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .condition-item {
        flex-direction: column;
        text-align: center;
    }
    
    .condition-icon {
        width: 36px;
        height: 36px;
    }
    
    .dealer-benefits {
        gap: var(--spacing-sm);
    }
    
    .dealer-benefit {
        flex-direction: column;
        text-align: center;
    }
    
    .benefit-check {
        width: 28px;
        height: 28px;
    }
}

/* === SMALL MOBILE (< 480px) === */
@media screen and (max-width: 479px) {
    
    /* Ultra-compact spacing */
    html {
        font-size: 14px;
    }
    
    :root {
        --spacing-xs: 0.375rem;
        --spacing-sm: 0.75rem;
        --spacing-md: 1.5rem;
        --spacing-lg: 3rem;
        --spacing-xl: 4rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    /* Top bar - simplify */
    .top-bar-item {
        font-size: 0.7rem;
    }
    
    .icon {
        width: 14px;
        height: 14px;
    }
    
    /* Navigation */
    .nav-logo img {
        height: 40px;
    }
    
    /* Hero */
    .hero-section {
        min-height: 350px;
    }
    
    .btn-hero {
        padding: 0.875rem 1.5rem;
    }
    
    /* Services */
    .service-image {
        height: 180px;
    }
    
    /* CTA */
    .cta-content h2 {
        font-size: 1.5rem;
    }
    
    .cta-content p {
        font-size: 1rem;
    }
    
    /* Forms */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px; /* Prevent iOS zoom on focus */
    }
    
    /* Testimonials */
    .testimonial {
        padding: var(--spacing-sm);
    }
    
    .testimonial-stars {
        font-size: 1.25rem;
    }
    
    /* Footer */
    .footer-content {
        gap: var(--spacing-md);
    }
    
    .footer-column {
        text-align: center;
    }
    
    .footer-title {
        font-size: 1.125rem;
    }
    
    .footer-copyright p {
        font-size: 0.75rem;
    }
}

/* === LANDSCAPE ORIENTATION === */
@media screen and (max-height: 500px) and (orientation: landscape) {
    
    .hero-section {
        height: auto;
        min-height: 400px;
        padding: var(--spacing-lg) 0;
    }
    
    .hero-content {
        padding: var(--spacing-md) 0;
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* === PRINT STYLES === */
@media print {
    
    .top-bar,
    .main-header,
    .nav-toggle,
    .back-to-top,
    .scroll-indicator,
    .main-footer,
    .cta-section {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .service-card,
    .benefit-card,
    .testimonial {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* === ACCESSIBILITY ENHANCEMENTS === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero-slide {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --color-montana-blue: #0a1f2d;
        --color-flag-red: #ff0000;
        --color-white: #ffffff;
        --color-black: #000000;
    }
    
    .btn-primary,
    .btn-secondary {
        border: 2px solid currentColor;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Uncomment if you want automatic dark mode */
    /* 
    body {
        background-color: #1a1a1a;
        color: #e8e8e8;
    }
    
    .main-header {
        background: #2a2a2a;
    }
    
    .service-card,
    .testimonial,
    .benefit-card {
        background: #2a2a2a;
        color: #e8e8e8;
    }
    */
}
