/* Mobile-First Responsive Design Fixes */

/* Base Mobile Styles - Mobile First Approach */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem; /* Reduced for mobile */
}

/* Typography Mobile Optimization */
h1 {
    font-size: clamp(2rem, 6vw, 3.5rem); /* Better mobile scaling */
    line-height: 1.1;
}

h2 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    line-height: 1.2;
}

/* Button Mobile Improvements */
.btn {
    min-height: 44px; /* Touch-friendly minimum */
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    white-space: nowrap;
}

.btn-large {
    padding: 1rem 2rem;
    min-height: 48px;
}

/* Hero Section Mobile Fixes */
.hero {
    padding: 6rem 0 3rem; /* Account for fixed header */
    min-height: auto;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: center;
}

.hero-cta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Navigation Mobile Fixes */
.nav-menu {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    padding: 2rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.nav-menu.active {
    transform: translateX(0);
}

.nav-list {
    flex-direction: column;
    gap: 1rem;
}

.nav-toggle {
    display: block;
    width: 30px;
    height: 30px;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1000;
}

.nav-toggle span {
    content: '' !important;
    display: block !important;
    width: 26px !important;
    height: 3px !important;
    background: #000000 !important;
    background-color: #000000 !important;
    margin: 4px auto !important;
    transition: all 0.3s ease !important;
    border-radius: 2px !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: none !important;
    position: static !important;
    pointer-events: none !important;
}

/* Force first load visibility */
.nav-toggle span:nth-child(1),
.nav-toggle span:nth-child(2),
.nav-toggle span:nth-child(3) {
    background: #000000 !important;
    display: block !important;
    opacity: 1 !important;
}

/* Hamburger container - ALWAYS VISIBLE */
.nav-toggle {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-around !important;
    align-items: center !important;
    width: 40px !important;
    height: 40px !important;
    padding: 6px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 1000 !important;
    outline: none !important;
}

.nav-toggle:hover span {
    background: #2563eb !important;
    background-color: #2563eb !important;
}

/* Ensure hamburger shows on mobile */
@media (max-width: 767px) {
    .nav-toggle {
        display: flex !important;
    }
}

/* Sample Requirements Icons Fix - All Blue Theme */
.requirement-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    position: relative;
}

/* Force override inline styles and ensure emoji icons show - All Blue Gradients */
.peptide-req {
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
}

.peptide-req::before {
    content: "🧬" !important;
    font-size: 2rem;
    line-height: 1;
}

.supplement-req {
    background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
}

.supplement-req::before {
    content: "💊" !important;
    font-size: 2rem;
    line-height: 1;
}

.hemp-req {
    background: linear-gradient(135deg, #1e40af, #3b82f6) !important;
}

.hemp-req::before {
    content: "🌿" !important;
    font-size: 2rem;
    line-height: 1;
}

/* Requirements Grid Mobile */
.requirements-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.requirement-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    text-align: center;
}

/* Search Page Button Fix */
.coa-cta {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--gray-50), var(--white));
}

.cta-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.cta-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.cta-actions .btn {
    min-width: 200px;
    background: #2563eb !important;
    color: #ffffff !important;
    border: 2px solid #2563eb !important;
    font-weight: 600;
}

.cta-actions .btn:hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    transform: translateY(-2px);
}

/* Force primary button styling */
.btn-primary {
    background: #2563eb !important;
    color: #ffffff !important;
    border: 2px solid #2563eb !important;
}

.btn-primary:hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
}

/* Blog Featured Article Fix */
.featured-post,
.featured-article {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 3rem;
}

.featured-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-content {
    padding: 2rem;
}

/* Forms Mobile Optimization */
.form-group {
    margin-bottom: 1.5rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    min-height: 44px; /* Touch-friendly */
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Tablet Styles */
@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
    
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
    
    .hero-cta {
        flex-direction: row;
    }
    
    .requirements-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .featured-post,
    .featured-article {
        grid-template-columns: 1fr 2fr;
    }
    
    .featured-image {
        height: auto;
        min-height: 300px;
    }
    
    .cta-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .nav-menu {
        position: static;
        transform: none;
        background: none;
        padding: 0;
        width: auto;
    }
    
    .nav-list {
        flex-direction: row;
    }
    
    .nav-toggle {
        display: none;
    }
    
    /* Image containers at tablet - Reduced Size */
    .image-container {
        min-height: 225px !important;
    }
    
    .hero-main-image,
    .image-container img {
        min-height: 225px !important;
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .requirements-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .hero {
        padding: 8rem 0 4rem;
    }
    
    .hero-stats {
        display: flex;
        justify-content: flex-start;
        gap: 3rem;
    }
    
        .featured-image {
            min-height: 350px;
        }
        
        /* Image containers at desktop - Reduced Size */
        .image-container {
            min-height: 250px !important;
        }
        
        .hero-main-image,
        .image-container img {
            min-height: 250px !important;
        }
    }

/* Large Desktop */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    .hero-content {
        gap: 6rem;
    }
}

/* Fix Image Container Filling - Mobile Responsive - Reduced Size */
.hero-main-image,
.image-container img {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 200px !important;
    border-radius: var(--radius-xl);
}

.image-container {
    overflow: hidden !important;
    min-height: 200px !important;
    height: 100% !important;
    width: 100% !important;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

/* Ensure full image container filling */
.hero-image {
    height: 100% !important;
    min-height: 200px !important;
}

/* Blog Image Centering - Direct HTML Structure Fix */
.featured-article .container {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 4rem !important;
    align-items: center !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 2rem !important;
}

.featured-image {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    overflow: hidden !important;
    border-radius: var(--radius-xl) !important;
}

.featured-image img {
    width: 100% !important;
    height: 400px !important;
    object-fit: cover !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--shadow-xl) !important;
}

.featured-content {
    display: block !important;
    grid-column: auto !important;
}

.post-image {
    width: 100% !important;
    overflow: hidden !important;
    border-radius: var(--radius-xl) !important;
}

.post-image img {
    width: 100% !important;
    height: 300px !important;
    object-fit: cover !important;
    border-radius: var(--radius-xl) !important;
}

.blog-image img {
    width: 100% !important;
    height: auto !important;
    min-height: 250px !important;
    object-fit: cover !important;
    border-radius: var(--radius-xl) !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Mobile responsive blog images - Fixed Structure */
@media (max-width: 768px) {
    .featured-article .container {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center !important;
    }
    
    .featured-image {
        order: -1 !important;
        margin-bottom: 1.5rem !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .featured-image img {
        height: 250px !important;
        width: 100% !important;
        object-fit: cover !important;
    }
    
    .featured-content {
        order: 2 !important;
    }
    
    .featured-content h2 {
        font-size: 1.8rem !important;
    }
    
    .post-image img {
        height: 250px !important;
        object-fit: cover !important;
    }
    
    .blog-image img {
        min-height: 200px !important;
        max-height: 250px !important;
        object-fit: cover !important;
    }
}

/* Tablet responsive behavior for blog images */
@media (min-width: 769px) and (max-width: 1024px) {
    .featured-article .container {
        gap: 3rem !important;
        grid-template-columns: 1fr 1fr !important;
    }
    
    .featured-image img {
        height: 350px !important;
        object-fit: cover !important;
    }
    
    .featured-content h2 {
        font-size: 2rem !important;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-main-image,
    .featured-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus States for Accessibility */
.btn:focus,
.nav-link:focus,
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* PDF Viewer Mobile Responsive Styles - ISSUE #1 FIX */
/* Modern responsive container approach - aspect ratio based */
.coa-preview .pdf-viewer-container,
.trust-signals .pdf-viewer-container,
#pdf-preview-section .pdf-viewer-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.5; /* Mobile: taller aspect ratio */
    overflow: hidden;
}

/* Homepage PDF preview - mobile responsive best practices */
.coa-preview .pdf-preview-container,
#pdf-preview-section .pdf-preview-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    padding: 0.5rem !important;
}

.coa-preview #pdf-viewer,
.trust-signals #pdf-viewer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: 2px solid var(--gray-200) !important;
    border-radius: var(--radius-lg) !important;
}

.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.pdf-header h3 {
    margin: 0;
    flex: 1;
}

.mobile-download-btn {
    display: inline-block !important;
    font-size: 0.875rem;
    padding: 0.75rem 1.25rem;
    white-space: nowrap;
}

.pdf-preview-container {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

/* Tablet PDF viewer styles */
@media (min-width: 768px) {
    .coa-preview .pdf-viewer-container,
    .trust-signals .pdf-viewer-container,
    #pdf-preview-section .pdf-viewer-container {
        aspect-ratio: 1 / 1.414; /* A4 aspect ratio for tablet */
    }

    .mobile-download-btn {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
}

/* Desktop PDF viewer styles */
@media (min-width: 1024px) {
    .coa-preview .pdf-viewer-container,
    .trust-signals .pdf-viewer-container,
    #pdf-preview-section .pdf-viewer-container {
        aspect-ratio: 1 / 1.414; /* Standard A4 aspect ratio */
    }

    .mobile-download-btn {
        display: inline-block !important; /* Keep visible on desktop too */
    }

    .pdf-preview-container {
        padding: 1.5rem;
    }
}

/* Large desktop optimization */
@media (min-width: 1200px) {
    .coa-preview .pdf-viewer-container,
    .trust-signals .pdf-viewer-container,
    #pdf-preview-section .pdf-viewer-container {
        aspect-ratio: 1 / 1.414; /* Standard A4 aspect ratio */
    }
}

/* Landscape mobile optimization */
@media (max-width: 767px) and (orientation: landscape) {
    .coa-preview .pdf-viewer-container,
    .trust-signals .pdf-viewer-container,
    #pdf-preview-section .pdf-viewer-container {
        aspect-ratio: 1.414 / 1; /* Landscape orientation */
    }
}

/* Services Page - Icon Visibility Fix - ISSUES #3, #4, #5, #10 FIX */
/* COMPREHENSIVE ICON FIX - All SVG icons */
.service-icon-large .icon,
.tech-icon .icon,
.service-icon .icon,
.badge-icon svg,
.contact-icon .icon,
.trust-icon,
.icon,
svg.icon {
    stroke: #ffffff !important;
    fill: none !important;
    stroke-width: 3 !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3)) !important;
}

/* Service icon containers - FORCE BACKGROUNDS */
.service-icon-large {
    width: 80px !important;
    height: 80px !important;
    border-radius: 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
}

/* Specific service page icon backgrounds */
#peptide .service-icon-large {
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
}

#supplement .service-icon-large {
    background: linear-gradient(135deg, #10b981, #34d399) !important;
}

#hemp .service-icon-large {
    background: linear-gradient(135deg, #06b6d4, #10b981) !important;
}

/* Homepage service cards icons - ISSUE #3 FIX */
.service-card .service-icon {
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
    width: 80px !important;
    height: 80px !important;
    margin: 0 auto 1.5rem !important;
    border-radius: 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.service-card .service-icon .icon {
    stroke: #ffffff !important;
    fill: none !important;
    stroke-width: 2.5 !important;
    display: block !important;
    width: 40px !important;
    height: 40px !important;
    opacity: 1 !important;
}

/* Badge icons - ISSUE #4 FIX */
.badge-icon {
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.badge-icon svg {
    width: 100% !important;
    height: 100% !important;
}

/* Trust signals icons - ISSUE #10 FIX */
.trust-badge .badge-icon svg,
.shipping-badge svg,
.tech-badge svg {
    stroke: #ffffff !important;
    stroke-width: 2.5 !important;
    fill: none !important;
}

/* Tech section icons with backgrounds */
.tech-icon {
    width: 80px !important;
    height: 80px !important;
    background: linear-gradient(135deg, #2563eb, #10b981) !important;
    border-radius: 0.75rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto 1.5rem !important;
}

.tech-icon .icon {
    width: 40px !important;
    height: 40px !important;
    stroke: #ffffff !important;
    fill: none !important;
    stroke-width: 2.5 !important;
}

/* Ensure service icons are visible on mobile */
@media (max-width: 768px) {
    .service-icon-large {
        width: 70px !important;
        height: 70px !important;
        margin: 0 auto 1rem !important;
    }

    .service-icon-large .icon {
        width: 35px !important;
        height: 35px !important;
    }

    .tech-icon {
        width: 70px !important;
        height: 70px !important;
    }

    .tech-icon .icon {
        width: 35px !important;
        height: 35px !important;
    }
}

/* Sample Submission Page - Mobile Centering Fixes */
@media (max-width: 768px) {
    .submission-header-content {
        text-align: center !important;
        padding: 0 1rem !important;
    }

    .submission-header-content h1 {
        font-size: 2rem !important;
    }

    .submission-header-content p {
        font-size: 1rem !important;
        padding: 0 !important;
        margin: 0 auto !important;
    }

    .step-actions {
        flex-direction: column !important;
        align-items: center !important;
        gap: 1rem !important;
    }

    .step-actions .btn {
        width: 100% !important;
        max-width: 300px !important;
        text-align: center !important;
    }

    .form-actions {
        flex-direction: column !important;
        align-items: center !important;
    }

    .form-actions .btn {
        width: 100% !important;
        max-width: 300px !important;
    }

    .process-step {
        text-align: center !important;
    }

    .step-content {
        text-align: center !important;
    }

    .step-content h3,
    .step-content p {
        text-align: center !important;
    }
}

/* COA Search Page - Mobile Formatting Fixes */
@media (max-width: 768px) {
    .coa-header {
        padding: 6rem 0 3rem !important;
    }

    .coa-header-content {
        padding: 0 1rem !important;
    }

    .coa-search-form {
        padding: 0 1rem !important;
    }

    .search-input-group {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .coa-search-input {
        width: 100% !important;
    }

    .search-input-group .btn {
        width: 100% !important;
    }

    .pdf-header {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .pdf-header h3 {
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 0.5rem !important;
    }

    .mobile-download-btn {
        width: 100% !important;
        text-align: center !important;
    }
}

/* ISSUE #6 FIX - Remove spacing between search section and CTA */
.sample-coas-section {
    padding: 3rem 0 2rem 0 !important; /* Reduced bottom padding */
}

.coa-cta {
    padding: 2rem 0 4rem 0 !important; /* Reduced top padding */
    margin-top: 0 !important;
}

/* ISSUE #7 FIX - Blog Page Description & Subscribe Button */
.blog-header-content p {
    color: #334155 !important; /* Darker gray for better readability */
    font-size: 1.125rem !important;
    line-height: 1.7 !important;
    font-weight: 500 !important;
}

.blog-subscribe,
.newsletter-section {
    text-align: center !important;
    padding: 2rem 0 !important;
}

.blog-subscribe .btn,
.newsletter-section .btn,
.newsletter-form .btn {
    display: inline-block !important;
    margin: 0 auto !important;
    text-align: center !important;
}

.newsletter-form {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
    max-width: 500px !important;
    margin: 0 auto !important;
}

.newsletter-form .btn {
    width: 100% !important;
    max-width: 300px !important;
}

/* ISSUE #8 FIX - Contact Page White Space Reduction */
.contact-header {
    padding: 6rem 0 2.5rem !important; /* Reduced from 4rem to 2.5rem */
}

.contact-content {
    padding: 2.5rem 0 !important; /* Reduced from 4rem */
}

.faq-section {
    padding: 2.5rem 0 !important; /* Reduced padding */
}

.contact-grid {
    gap: 2rem !important; /* Reduced gap */
}

/* ISSUE #9 FIX - Center Submit Button on Contact Form */
.contact-form {
    display: flex !important;
    flex-direction: column !important;
}

.contact-form .btn[type="submit"],
.inquiry-form .btn-primary {
    display: block !important;
    margin: 1.5rem auto 0 auto !important;
    width: 100% !important;
    max-width: 400px !important;
    text-align: center !important;
}

@media (max-width: 768px) {
    /* Mobile specific fixes for contact form */
    .contact-form .btn[type="submit"],
    .inquiry-form .btn-primary {
        max-width: 100% !important;
    }
    
    .contact-header {
        padding: 6rem 0 2rem !important;
    }
    
    .contact-content {
        padding: 2rem 0 !important;
    }
    
    .faq-section {
        padding: 2rem 0 !important;
    }
}

/* Print Styles */
@media print {
    .header,
    .nav,
    .hero-cta,
    .cta-section,
    .footer {
        display: none !important;
    }

    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
}
