/* Mobile Optimization CSS for BSCM Scrapyard Site */
/* This file addresses mobile responsiveness issues, particularly the white background on pricing page */

/* CRITICAL: Override any white backgrounds that appear on mobile */
* {
    box-sizing: border-box !important;
}

/* Force dark background on all elements that might show white */
body, html {
    background: linear-gradient(135deg, #000000 0%, #111111 25%, #000000 50%, #0a0a0a 75%, #000000 100%) !important;
    background-attachment: fixed !important;
    color: #B87333 !important;
    min-height: 100vh !important;
}

/* Mobile-first breakpoints */
@media screen and (max-width: 1024px) {
    /* Remove background-attachment fixed for mobile performance */
    body {
        background-attachment: scroll !important;
    }

    body::before {
        background-attachment: scroll !important;
    }
}

/* Tablet optimizations */
@media screen and (max-width: 768px) {
    /* Navigation improvements - Hamburger Menu */
    .nav-container {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0 !important;
        padding: 15px 20px !important;
        background: rgba(0,0,0,0.95) !important;
        border-radius: 0 !important;
        position: relative !important;
    }

    /* Show hamburger menu toggle */
    .menu-toggle {
        display: flex !important;
        flex-direction: column !important;
        cursor: pointer !important;
        z-index: 1001 !important;
        order: 3 !important;
    }

    .menu-toggle div {
        width: 25px !important;
        height: 3px !important;
        background-color: #B87333 !important;
        margin: 3px 0 !important;
        transition: 0.3s !important;
        border-radius: 2px !important;
    }

    /* Hamburger animation */
    .menu-toggle.active div:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px) !important;
    }

    .menu-toggle.active div:nth-child(2) {
        opacity: 0 !important;
    }

    .menu-toggle.active div:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px) !important;
    }

    /* Hide navigation menu by default */
    .nav-menu {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 280px !important;
        height: 100vh !important;
        background: linear-gradient(135deg, #000000 0%, #111111 100%) !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        padding: 80px 0 20px 0 !important;
        transition: left 0.3s ease !important;
        z-index: 1000 !important;
        border-right: 3px solid #B87333 !important;
        box-shadow: 2px 0 10px rgba(0,0,0,0.5) !important;
        overflow-y: auto !important;
    }

    /* Show menu when active */
    .nav-menu.active {
        left: 0 !important;
    }

    .nav-menu li {
        margin: 0 !important;
        width: 100% !important;
        position: relative !important;
    }

    .nav-menu > li > a {
        padding: 15px 25px !important;
        font-size: 16px !important;
        display: block !important;
        width: 100% !important;
        text-align: left !important;
        border-bottom: 1px solid rgba(184,115,51,0.2) !important;
        background: transparent !important;
        margin-bottom: 0 !important;
        border-radius: 0 !important;
        transition: all 0.3s ease !important;
    }

    .nav-menu > li > a:hover {
        background: rgba(184,115,51,0.2) !important;
        padding-left: 35px !important;
    }

    .nav-menu > li:last-child > a {
        border-bottom: 1px solid rgba(184,115,51,0.2) !important;
    }

    /* Mobile overlay for hamburger menu */
    .mobile-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(0,0,0,0.5) !important;
        z-index: 999 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: all 0.3s ease !important;
    }

    .mobile-overlay.active {
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Dropdown menu improvements */
    .dropdown {
        width: 100% !important;
    }

    .dropdown-menu {
        position: static !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        background: rgba(17,17,17,0.95) !important;
        margin-top: 0 !important;
        border-radius: 0 !important;
        width: 100% !important;
        max-height: 0 !important;
        overflow: hidden !important;
        transition: all 0.3s ease !important;
        border: none !important;
        border-top: 1px solid rgba(184,115,51,0.3) !important;
        box-shadow: inset 0 2px 5px rgba(0,0,0,0.3) !important;
    }

    .dropdown:hover .dropdown-menu,
    .dropdown.active .dropdown-menu {
        opacity: 1 !important;
        visibility: visible !important;
        max-height: 200px !important;
    }

    .dropdown-menu li {
        width: 100% !important;
        margin: 0 !important;
    }

    .dropdown-menu li a {
        padding: 12px 35px !important;
        font-size: 14px !important;
        border-bottom: 1px solid rgba(184,115,51,0.1) !important;
        background: transparent !important;
        transition: all 0.3s ease !important;
        color: #cccccc !important;
    }

    .dropdown-menu li:last-child a {
        border-bottom: none !important;
    }

    .dropdown-menu li a:hover {
        background: rgba(184,115,51,0.2) !important;
        padding-left: 45px !important;
        color: #ffffff !important;
    }

    /* Mobile dropdown arrow indicator */
    .dropdown > a {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    .dropdown > a::after {
        content: '▼' !important;
        font-size: 12px !important;
        color: #B87333 !important;
        transition: transform 0.3s ease !important;
    }

    .dropdown.active > a::after {
        transform: rotate(180deg) !important;
    }

    /* Company info mobile layout */
    .logo-section {
        text-align: center !important;
        margin-bottom: 5px !important;
    }

    .company-name {
        font-size: 18px !important;
    }

    .company-tagline {
        font-size: 9px !important;
    }

    .recycling-logo {
        font-size: 28px !important;
    }

    /* Hero section mobile fixes */
    .hero {
        margin-top: 80px !important;
        min-height: 60vh !important;
        padding: 20px 10px !important;
        background-size: cover !important;
        background-position: center center !important;
    }

    .hero-content h1 {
        font-size: 24px !important;
        line-height: 1.3 !important;
    }

    .hero-content h2 {
        font-size: 18px !important;
    }

    .hero-content p {
        font-size: 14px !important;
    }

    /* Main content mobile spacing */
    main {
        padding: 100px 15px 40px 15px !important;
        background: transparent !important;
    }

    /* Override inline styles that cause white backgrounds */
    main[style*="padding-top"] {
        padding: 100px 15px 40px 15px !important;
        background: transparent !important;
    }

    /* Value cards mobile optimization */
    .value-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        margin-top: 20px !important;
    }

    .value-card {
        padding: 20px 15px !important;
        margin: 0 !important;
        background: linear-gradient(135deg, #000000 0%, #111111 100%) !important;
        border: 2px solid #B87333 !important;
    }

    .value-icon {
        font-size: 32px !important;
        margin-bottom: 15px !important;
    }

    .value-card h3 {
        font-size: 18px !important;
        margin-bottom: 8px !important;
    }

    .value-card h4 {
        font-size: 12px !important;
        margin-bottom: 15px !important;
    }

    .value-card p {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }

    /* Materials section mobile */
    #materials-section {
        margin: 40px 0 !important;
        padding: 40px 15px !important;
        background: linear-gradient(rgba(0,0,0,0.95), rgba(17,17,17,0.95)) !important;
    }

    .materials-content h2 {
        font-size: 24px !important;
        margin-bottom: 20px !important;
    }

    .materials-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .materials-category {
        padding: 20px !important;
        background: rgba(0,0,0,0.9) !important;
    }

    .materials-category h3 {
        font-size: 18px !important;
    }

    .materials-category li {
        font-size: 14px !important;
        padding: 6px 0 !important;
    }

    /* CTA section mobile */
    #cta-section {
        padding: 40px 15px !important;
        margin: 40px 0 !important;
        background: linear-gradient(rgba(0,0,0,0.95), rgba(17,17,17,0.95)) !important;
    }

    .cta-content h2 {
        font-size: 20px !important;
        margin-bottom: 10px !important;
    }

    .cta-content p {
        font-size: 14px !important;
        margin-bottom: 20px !important;
    }

    .cta-buttons {
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .cta-button, .btn {
        padding: 12px 20px !important;
        font-size: 14px !important;
        width: 100% !important;
        max-width: 280px !important;
        text-align: center !important;
        display: block !important;
    }

    /* Footer mobile optimization */
    footer {
        padding: 30px 0 15px !important;
        background: linear-gradient(135deg, #000000 0%, #111111 50%, #000000 100%) !important;
    }

    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 0 15px !important;
        text-align: center !important;
    }

    .footer-section h3 {
        font-size: 16px !important;
        margin-bottom: 10px !important;
    }

    .footer-section p {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }

    .footer-bottom {
        padding: 15px !important;
        font-size: 12px !important;
    }
}

/* Mobile phone specific optimizations */
@media screen and (max-width: 480px) {
    /* Extra mobile-specific fixes */
    .nav-container {
        padding: 12px !important;
        gap: 10px !important;
    }

    .company-name {
        font-size: 16px !important;
    }

    .company-tagline {
        font-size: 8px !important;
    }

    .recycling-logo {
        font-size: 24px !important;
    }

    .nav-menu > li > a {
        padding: 10px 15px !important;
        font-size: 14px !important;
    }

    .dropdown-menu li a {
        padding: 10px 15px !important;
        font-size: 13px !important;
    }

    .hero {
        margin-top: 70px !important;
        min-height: 50vh !important;
        padding: 15px 8px !important;
    }

    .hero-content h1 {
        font-size: 20px !important;
    }

    .hero-content h2 {
        font-size: 16px !important;
    }

    main {
        padding: 90px 10px 30px 10px !important;
    }

    main[style*="padding-top"] {
        padding: 90px 10px 30px 10px !important;
    }

    .value-card {
        padding: 15px 10px !important;
    }

    .value-card h3 {
        font-size: 16px !important;
    }

    .value-card p {
        font-size: 13px !important;
    }

    #materials-section, #cta-section {
        padding: 30px 10px !important;
        margin: 30px 0 !important;
    }

    .materials-content h2, .cta-content h2 {
        font-size: 18px !important;
    }

    .materials-category {
        padding: 15px !important;
    }

    .footer-content {
        padding: 0 10px !important;
    }
}

/* PRICING PAGE SPECIFIC MOBILE FIXES */
/* These rules specifically target the white background issue */

/* Force dark background on all table elements */
table, tbody, thead, tr, td, th {
    background: transparent !important;
    background-color: transparent !important;
    color: #ffffff !important;
}

/* Table mobile optimization */
@media screen and (max-width: 768px) {
    /* Force all sections to have dark backgrounds */
    section, main section {
        background: transparent !important;
        background-color: transparent !important;
    }

    /* Table responsive design */
    table {
        width: 100% !important;
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        border-collapse: collapse !important;
        background: transparent !important;
        margin: 20px 0 !important;
    }

    thead {
        display: block !important;
        background: transparent !important;
    }

    tbody {
        display: block !important;
        background: transparent !important;
    }

    tr {
        display: block !important;
        border: 1px solid #B87333 !important;
        margin-bottom: 10px !important;
        background: rgba(0,0,0,0.8) !important;
        border-radius: 8px !important;
        padding: 10px !important;
    }

    td, th {
        display: block !important;
        text-align: left !important;
        padding: 8px 10px !important;
        border: none !important;
        background: transparent !important;
        color: #ffffff !important;
        font-size: 14px !important;
    }

    th {
        color: #B87333 !important;
        font-weight: bold !important;
        font-size: 16px !important;
        margin-bottom: 5px !important;
        background-color: transparent !important;
    }

    /* Add labels for mobile table view */
    td:before {
        content: attr(data-label) ": " !important;
        color: #B87333 !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
        font-size: 12px !important;
    }

    /* Remove table hover effects on mobile */
    tr:hover {
        background: rgba(0,0,0,0.8) !important;
    }

    /* Pricing page headings */
    h1, h2 {
        color: #B87333 !important;
        text-align: center !important;
        margin: 20px 0 15px 0 !important;
        font-size: 24px !important;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.8) !important;
    }

    h2 {
        font-size: 20px !important;
        margin: 30px 0 15px 0 !important;
    }

    /* Pricing page paragraphs */
    p {
        color: #ffffff !important;
        font-size: 14px !important;
        line-height: 1.5 !important;
        margin-bottom: 15px !important;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.8) !important;
    }

    /* Card elements on pricing page */
    .card {
        background: linear-gradient(135deg, #000000 0%, #111111 100%) !important;
        border: 2px solid #B87333 !important;
        border-radius: 10px !important;
        padding: 20px !important;
        margin: 20px 0 !important;
        color: #ffffff !important;
    }

    .card h2 {
        color: #B87333 !important;
        font-size: 18px !important;
        margin-bottom: 15px !important;
    }

    .card ul {
        list-style: none !important;
        padding: 0 !important;
    }

    .card li {
        color: #ffffff !important;
        padding: 5px 0 !important;
        position: relative !important;
        padding-left: 20px !important;
        font-size: 14px !important;
        line-height: 1.4 !important;
    }

    .card li::before {
        content: '•' !important;
        color: #B87333 !important;
        position: absolute !important;
        left: 0 !important;
        font-size: 16px !important;
    }
}

@media screen and (max-width: 480px) {
    /* Extra small mobile pricing fixes */
    table {
        font-size: 12px !important;
    }

    td, th {
        font-size: 12px !important;
        padding: 6px 8px !important;
    }

    th {
        font-size: 14px !important;
    }

    h1 {
        font-size: 20px !important;
    }

    h2 {
        font-size: 18px !important;
    }

    .card {
        padding: 15px !important;
        margin: 15px 0 !important;
    }

    .card h2 {
        font-size: 16px !important;
    }

    .card li {
        font-size: 13px !important;
    }
}

/* INVENTORY PAGE MOBILE FIXES */
@media screen and (max-width: 768px) {
    .inventory-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .inventory-item {
        flex-direction: column !important;
        text-align: center !important;
        padding: 20px !important;
        background: linear-gradient(135deg, #000000 0%, #111111 100%) !important;
    }

    .metal-info h3 {
        font-size: 18px !important;
        margin-bottom: 8px !important;
    }

    .specifications {
        gap: 8px !important;
        margin-bottom: 15px !important;
    }

    .pricing-section {
        min-width: auto !important;
    }

    .inventory-notice {
        padding: 20px !important;
        margin-top: 30px !important;
    }

    .inventory-notice h2 {
        font-size: 20px !important;
    }

    .inventory-notice p {
        font-size: 14px !important;
    }
}

/* SERVICES PAGE MOBILE FIXES */
@media screen and (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .card {
        padding: 20px !important;
        background: linear-gradient(135deg, #000000 0%, #111111 100%) !important;
        border: 2px solid #B87333 !important;
    }

    .card img {
        height: 150px !important;
        margin-bottom: 15px !important;
    }

    .card h2 {
        font-size: 18px !important;
        margin-bottom: 10px !important;
    }

    .card p {
        font-size: 14px !important;
    }
}

/* PARTNERS PAGE MOBILE FIXES */
@media screen and (max-width: 768px) {
    .partners-diamond {
        gap: 20px !important;
    }

    .diamond-row {
        flex-direction: column !important;
        align-items: center !important;
        gap: 20px !important;
    }

    .partner-card {
        width: 100% !important;
        max-width: 300px !important;
    }
}

/* CONTACT PAGE MOBILE FIXES */
@media screen and (max-width: 768px) {
    /* Contact form container */
    form {
        background: linear-gradient(135deg, #000000 0%, #111111 100%) !important;
        border: 2px solid #B87333 !important;
        border-radius: 15px !important;
        padding: 25px !important;
        margin: 20px 0 !important;
        box-shadow: 0 8px 25px rgba(184,115,51,0.2) !important;
    }

    /* Form labels mobile */
    form label {
        display: block !important;
        color: #B87333 !important;
        font-weight: bold !important;
        font-size: 15px !important;
        margin-bottom: 8px !important;
        margin-top: 15px !important;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.8) !important;
    }

    form label:first-of-type {
        margin-top: 0 !important;
    }

    /* Form inputs mobile */
    form input[type="text"],
    form input[type="email"],
    form input[type="tel"],
    form textarea {
        width: 100% !important;
        padding: 15px !important;
        margin-bottom: 0 !important;
        background: rgba(0,0,0,0.8) !important;
        border: 2px solid #333333 !important;
        border-radius: 8px !important;
        color: #ffffff !important;
        font-size: 16px !important;
        font-family: inherit !important;
        transition: all 0.3s ease !important;
        box-shadow: inset 0 2px 4px rgba(0,0,0,0.3) !important;
        box-sizing: border-box !important;
    }

    /* Focus states mobile */
    form input[type="text"]:focus,
    form input[type="email"]:focus,
    form input[type="tel"]:focus,
    form textarea:focus {
        outline: none !important;
        border-color: #B87333 !important;
        box-shadow: 
            inset 0 2px 4px rgba(0,0,0,0.3),
            0 0 10px rgba(184,115,51,0.3) !important;
        background: rgba(0,0,0,0.9) !important;
    }

    /* Placeholder mobile */
    form input::placeholder,
    form textarea::placeholder {
        color: #888888 !important;
        font-style: italic !important;
    }

    /* Textarea mobile */
    form textarea {
        resize: vertical !important;
        min-height: 120px !important;
        line-height: 1.5 !important;
    }

    /* Submit button mobile */
    form button[type="submit"],
    form input[type="submit"] {
        background: linear-gradient(135deg, #B87333 0%, #A0522D 100%) !important;
        color: #000000 !important;
        border: none !important;
        padding: 15px 30px !important;
        border-radius: 25px !important;
        font-weight: bold !important;
        font-size: 16px !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        margin-top: 20px !important;
        box-shadow: 0 4px 15px rgba(184,115,51,0.3) !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    form button[type="submit"]:hover,
    form input[type="submit"]:hover {
        background: linear-gradient(135deg, #A0522D 0%, #B87333 100%) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(184,115,51,0.4) !important;
    }

    /* Contact info mobile */
    .contact-info {
        background: linear-gradient(135deg, #000000 0%, #111111 100%) !important;
        border: 2px solid #B87333 !important;
        border-radius: 15px !important;
        padding: 25px !important;
        box-shadow: 0 8px 25px rgba(184,115,51,0.2) !important;
    }

    .contact-info p {
        margin-bottom: 15px !important;
        line-height: 1.6 !important;
        color: #ffffff !important;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.8) !important;
        font-size: 14px !important;
    }

    .contact-info strong {
        color: #B87333 !important;
        display: block !important;
        margin-bottom: 5px !important;
        font-size: 16px !important;
    }

    .contact-info a {
        color: #B87333 !important;
        text-decoration: none !important;
        transition: color 0.3s ease !important;
    }

    .contact-info a:hover {
        color: #A0522D !important;
        text-decoration: underline !important;
    }
}

/* ABOUT PAGE MOBILE FIXES */
@media screen and (max-width: 768px) {
    .timeline {
        margin: 20px 0 !important;
    }

    .timeline-item {
        background: linear-gradient(135deg, #000000 0%, #111111 100%) !important;
        border: 2px solid #B87333 !important;
        border-radius: 10px !important;
        padding: 20px !important;
        margin-bottom: 20px !important;
    }

    .timeline-item h3 {
        color: #B87333 !important;
        font-size: 16px !important;
        margin-bottom: 10px !important;
    }

    .timeline-item p {
        color: #ffffff !important;
        font-size: 14px !important;
        line-height: 1.4 !important;
    }
}

/* RETURN TO TOP BUTTON MOBILE */
@media screen and (max-width: 768px) {
    #return-to-top {
        bottom: 20px !important;
        right: 20px !important;
        width: 45px !important;
        height: 45px !important;
        font-size: 16px !important;
    }

    #return-to-top .btn-icon {
        font-size: 14px !important;
    }

    #return-to-top .btn-text {
        font-size: 8px !important;
    }
}

/* LIGHTBOX MOBILE OPTIMIZATION */
@media screen and (max-width: 768px) {
    .lightbox img {
        max-width: 95% !important;
        max-height: 95% !important;
    }

    .lightbox-close {
        top: 15px !important;
        right: 20px !important;
        font-size: 24px !important;
    }
}

/* TOUCH OPTIMIZATION */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets for mobile */
    a, button, .btn, .cta-button {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 12px 16px !important;
    }

    /* Better spacing for touch */
    .nav-menu > li > a {
        padding: 12px 16px !important;
        margin: 2px 0 !important;
    }

    /* Prevent accidental zooms */
    input, textarea, select {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}

/* HIGH CONTRAST MODE SUPPORT */
@media (prefers-contrast: high) {
    .value-card, .card, .inventory-item {
        border-width: 3px !important;
    }

    .btn, .cta-button {
        border-width: 3px !important;
    }
}

/* REDUCED MOTION SUPPORT */
@media (prefers-reduced-motion: reduce) {
    .recycling-logo {
        animation: none !important;
    }

    .value-card, .card, .inventory-item {
        transition: none !important;
    }

    .btn, .cta-button {
        transition: none !important;
    }

    #return-to-top {
        transition: none !important;
    }
}

/* PRINT STYLES */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    nav, #return-to-top {
        display: none !important;
    }

    .hero {
        display: none !important;
    }

    .value-card, .card {
        background: white !important;
        border: 1px solid black !important;
        color: black !important;
    }

    table {
        background: white !important;
        border: 1px solid black !important;
    }

    th, td {
        background: white !important;
        color: black !important;
        border: 1px solid black !important;
    }
}
