body {
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: #f5f5f5;
    color: #333;
}

header {
    background: #2c3e50; /* Sleek dark gray-blue */
    color: white;
    padding: 1rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1400px; /* Wider desktop view */
    margin: 0 auto;
    display: flex;
    flex-direction: column; /* Stack logo and menu vertically on desktop */
    align-items: center;
    gap: 0.5rem; /* Space between logo and menu on desktop */
    padding: 0 0.5rem; /* Reduced horizontal padding to minimize margins on mobile */
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem; /* Default size for desktop and larger screens */
    margin: 0;
    color: #f1c40f; /* Vibrant yellow for brand */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0; /* Prevent logo from shrinking */
    white-space: nowrap; /* Prevent logo text from wrapping or overflowing */
    overflow: hidden; /* Hide any overflow to prevent off-screen text */
    text-overflow: ellipsis; /* Add ellipsis if text overflows (removed for mobile to show full text) */
    max-width: 100%; /* Allow full width on desktop, limited on mobile */
}

/* Adjust logo on mobile to show full text without truncation */
@media (max-width: 768px) {
    .logo {
        font-size: 1.2rem; /* Further reduced size for mobile to fit full text on one line */
        max-width: 100%; /* Ensure full width on mobile to show all text */
        text-overflow: clip; /* Remove ellipsis to show full text, even if it overflows (handled by reduced size) */
        padding: 0; /* Remove any padding to maximize space */
    }
}

.desktop-nav, .mobile-nav {
    width: 100%;
}

.desktop-nav {
    display: block; /* Show on desktop */
}

.mobile-nav {
    display: none; /* Hide on desktop, show on mobile */
}

.hamburger {
    display: none;
    font-size: 2.2rem; /* Larger hamburger icon for better visibility and touch targets */
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s;
    margin-left: 0.5rem; /* Reduced left margin for tighter fit on mobile */
    display: flex; /* Use flex to align icon and text */
    align-items: center; /* Vertically center icon and text */
}

.hamburger::after {
    content: " Menu"; /* Add "Menu" text after the hamburger icon */
    font-family: 'Roboto', Arial, sans-serif; /* Match body font */
    font-size: 1rem; /* Smaller text for readability */
    margin-left: 0.5rem; /* Space between icon and "Menu" */
    font-weight: 600; /* Bold for emphasis */
    display: none; /* Hide "Menu" text by default, show only on mobile */
}

/* Show hamburger and "Menu" on mobile */
@media (max-width: 768px) {
    .hamburger {
        display: flex; /* Show hamburger with "Menu" on mobile */
        margin-left: 0.5rem; /* Maintain reduced left margin for tighter fit */
    }

    .hamburger::after {
        display: inline; /* Show "Menu" text on mobile */
    }

    .desktop-nav {
        display: none;
    }

    .nav-menu {
        display: none; /* Hidden by default, shown with .active */
        flex-direction: column;
        width: 100%;
        position: fixed; /* Ensure menu drops down below header */
        top: 60px; /* Position below header (adjusted for header height) */
        left: 0; /* Left-aligned for full width */
        background: #2c3e50;
        padding: 1rem 0;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        z-index: 1001; /* Keep above other content */
    }

    .nav-menu.active {
        display: flex; /* Show menu when toggled */
    }
}

/* Adjust hamburger positioning for landscape mode to ensure visibility */
@media (max-width: 768px) and (orientation: landscape) {
    .hamburger {
        margin-left: 0.3rem; /* Further reduce left margin in landscape for tighter fit */
    }

    .hamburger::after {
        font-size: 0.9rem; /* Slightly smaller text in landscape for space */
        margin-left: 0.3rem; /* Reduce space between icon and "Menu" in landscape */
    }

    .nav-container {
        padding: 0 0.3rem; /* Further reduce horizontal padding in landscape to minimize margins */
    }

    .logo {
        max-width: 50%; /* Further limit logo width in landscape to prevent overflow */
        font-size: 1rem; /* Further reduce logo size in landscape to fit full text */
    }

    .nav-menu {
        top: 60px; /* Maintain position below header in landscape */
    }
}

/* iOS-specific fix for touch events and positioning */
@media (max-width: 768px) and (hover: none) {
    .nav-menu {
        position: fixed; /* Ensure it stays on top */
        z-index: 1001; /* Higher than header */
    }

    .hamburger:focus {
        outline: 2px solid #f1c40f; /* Visible focus for accessibility */
    }
}

.hamburger:hover {
    color: #f1c40f;
}

.hamburger:hover::after {
    color: #f1c40f; /* Match hover color for consistency */
}

.nav-menu {
    list-style: none; /* Remove li dots */
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center; /* Center menu on desktop */
}

.nav-menu.desktop {
    margin-top: 0.5rem; /* Space below logo on desktop */
}

.nav-menu li {
    margin: 0 1.5rem; /* Increased spacing for clarity */
}

.nav-menu li a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    transition: color 0.3s, background 0.3s;
    border-radius: 4px;
}

.nav-menu li a:hover {
    color: #f1c40f;
    background: rgba(255, 255, 255, 0.1);
}

main {
    padding: 6rem 1rem 2rem; /* Increased top padding to 6rem to ensure content clears the fixed header */
    max-width: 1400px; /* Wider desktop view */
    margin: 0 auto;
}

#hero, #buy-sell, #about, #faq, #contact, #thank-you, #bot-trap {
    padding: 2.5rem 1rem; /* Increased padding for elegance */
    background-color: #ffffff;
    border-radius: 10px; /* Rounded corners for modern look */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); /* Softer shadow */
    margin-bottom: 2rem;
}

#hero {
    margin-top: 1rem; /* Additional margin to ensure content clears the fixed header */
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    color: #2c3e50;
}

h2 {
    font-size: 2.2rem; /* Larger, more impactful headers */
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

p, a {
    font-size: 1.1rem; /* Slightly larger for readability */
    color: #555;
    line-height: 1.8;
}

a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #f1c40f;
    text-decoration: underline;
}

.cta-button, .submit-button {
    display: inline-block;
    padding: 0.9rem 2rem; /* Larger padding for emphasis */
    background: #2c3e50;
    color: white;
    text-decoration: none;
    border-radius: 8px; /* More rounded */
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 2px 10px rgba(44, 62, 80, 0.3);
}

.cta-button:hover, .submit-button:hover {
    background: #34495e;
    transform: translateY(-2px); /* Slight lift on hover */
}

.service-grid, .gallery, .chart-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Slightly wider cards */
    gap: 2.5rem;
    padding: 0 1rem;
    margin-bottom: 2.5rem;
}

.service-item, .chart-box {
    background: #f9f9f9;
    padding: 1.8rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-item:hover, .chart-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.gallery img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.gallery img:hover {
    transform: scale(1.05);
}

.price-charts {
    padding: 2.5rem 1rem;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-top: 2.5rem;
}

.price-charts h3 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.chart-box h4 {
    text-align: center;
}

#gold-chart-container, #silver-chart-container {
    width: 100%;
    height: 400px;
    border-radius: 10px;
}

.tradingview-widget-container {
    width: 100% !important;
    height: 100% !important;
}

.faq-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.faq-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

#bot-trap img {
    max-width: 100%;
    height: auto;
    margin-top: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#contact form {
    max-width: 100%; /* Match outer box width on desktop, full-width on mobile */
    width: 100%; /* Ensure full width within section, not exceeding viewport */
    margin: 0 auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    box-sizing: border-box; /* Ensure padding doesn’t increase width beyond viewport */
}

label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

input, textarea {
    padding: 0.8rem;
    border: 2px solid #e0e0e0; /* Lighter border for elegance */
    border-radius: 8px;
    width: 100%; /* Full width within form, not exceeding viewport */
    font-size: 1.1rem;
    font-family: 'Roboto', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box; /* Ensure padding doesn’t increase width beyond viewport */
}

input:focus, textarea:focus {
    border-color: #2c3e50;
    box-shadow: 0 0 8px rgba(44, 62, 80, 0.3);
    outline: none;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Slightly more space for readability, but still tight */
    margin-bottom: 1rem;
    width: 100%; /* Ensure full width within form */
    align-items: flex-start; /* Left-align everything */
}

.checkbox-group label {
    display: flex; /* Use flex for consistent alignment */
    align-items: center;
    gap: 0.3rem; /* Tight alignment (one or two spaces) */
    font-size: 1.1rem;
    color: #555;
    width: 100%; /* Full width for alignment, not exceeding viewport */
    margin: 0; /* Remove any margins */
    padding: 0; /* Remove any padding */
    box-sizing: border-box; /* Ensure padding doesn’t increase width */
}

.checkbox-group input[type="checkbox"] {
    margin-right: 0.3rem; /* Minimal spacing (one or two spaces) */
    transform: scale(1.2); /* Slightly larger for better touch targets */
    margin-top: 0; /* Remove vertical offset for perfect alignment */
    width: auto; /* Natural width for checkbox */
    flex-shrink: 0; /* Prevent checkbox from shrinking */
    box-sizing: border-box; /* Ensure padding doesn’t increase width */
}

textarea {
    height: 150px; /* Taller for better usability */
    resize: vertical;
    box-sizing: border-box; /* Ensure padding doesn’t increase width beyond viewport */
}

button {
    padding: 0.9rem 2rem;
    background: #2c3e50;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    font-size: 1.2rem;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.3);
    width: 100%; /* Full width on mobile, match form width */
    max-width: 300px; /* Limit width on desktop for balance */
    margin: 0 auto; /* Center on desktop */
    display: block; /* Ensure block-level for centering */
    box-sizing: border-box; /* Ensure padding doesn’t increase width beyond viewport */
}

button:hover {
    background: #34495e;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.4);
}

.g-recaptcha {
    margin: 1.5rem 0;
    width: 100%; /* Ensure full width within form, not exceeding viewport */
    box-sizing: border-box; /* Ensure padding doesn’t increase width */
}

.contact-info {
    text-align: center;
    margin-bottom: 2rem;
    color: #666;
}

.contact-info a {
    color: #2c3e50;
    font-weight: 600;
}

.contact-info a:hover {
    color: #f1c40f;
}

footer {
    background: #2c3e50;
    color: #ffffff; /* Explicitly set to white */
    text-align: center;
    padding: 1.2rem;
    margin-top: 2rem;
    font-size: 1rem;
    border-top: 2px solid #f1c40f; /* Subtle brand accent */
}

/* Desktop Styles */
@media (min-width: 769px) {
    .desktop-nav {
        display: block;
    }

    .mobile-nav {
        display: none;
    }

    .hamburger {
        display: none;
    }

    #contact form {
        max-width: 600px; /* Match outer box width on desktop */
        width: 100%; /* Ensure full width within section */
    }

    .checkbox-group label {
        gap: 0.3rem; /* Maintain tight alignment on desktop */
    }

    .checkbox-group input[type="checkbox"] {
        margin-right: 0.3rem; /* Maintain minimal spacing on desktop */
    }

    button {
        max-width: 300px; /* Limit button width on desktop */
    }

    main {
        padding: 6rem 1rem 2rem; /* Maintain increased top padding on desktop */
    }

    #hero {
        margin-top: 1rem; /* Maintain margin to clear fixed header on desktop */
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }

    .mobile-nav {
        display: none;
    }

    .hamburger {
        display: flex; /* Show hamburger with "Menu" on mobile */
        margin-left: 0.5rem; /* Reduced left margin for tighter fit */
    }

    nav {
        display: block;
    }

    .nav-menu {
        display: none; /* Hidden by default, shown with .active */
        flex-direction: column;
        width: 100%;
        position: fixed; /* Ensure menu drops down below header */
        top: 60px; /* Position below header (adjusted for header height) */
        left: 0; /* Left-aligned for full width */
        background: #2c3e50;
        padding: 1rem 0;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        z-index: 1001; /* Keep above other content */
    }

    .nav-menu.active {
        display: flex; /* Show menu when toggled */
    }

    .nav-menu li {
        margin: 0.5rem 0;
        text-align: center; /* Centered menu items on mobile */
    }

    .nav-menu li a {
        padding: 0.5rem;
        display: block;
        font-size: 1rem;
        color: white; /* Ensure text is readable against dark background */
        text-decoration: none;
        transition: color 0.3s; /* Smooth hover effect */
    }

    .nav-menu li a:hover {
        color: #f1c40f; /* Yellow hover color for brand consistency */
    }

    main {
        padding: 6rem 0.5rem 2rem; /* Increased top padding to 6rem on mobile to ensure content clears the fixed header */
    }

    #hero {
        margin-top: 1rem; /* Additional margin to ensure content clears the fixed header on mobile */
    }

    h2 {
        font-size: 1.8rem;
    }

    h3, h4 {
        font-size: 1.2rem;
    }

    .service-grid, .gallery, .chart-container {
        grid-template-columns: 1fr;
    }

    #gold-chart-container, #silver-chart-container {
        height: 300px;
    }

    .faq-item {
        margin-bottom: 1.5rem;
        padding: 1.2rem;
    }

    form {
        max-width: 100%;
        padding: 1.2rem;
        width: 100%; /* Ensure full width matches outer frame, not exceeding viewport */
        box-sizing: border-box; /* Ensure padding doesn’t increase width */
    }

    .cta-button, .submit-button {
        padding: 0.7rem 1.8rem;
        font-size: 1rem;
        width: 100%; /* Full width on mobile, match form width */
        box-sizing: border-box; /* Ensure padding doesn’t increase width */
    }

    .checkbox-group {
        gap: 0.3rem; /* Slightly more space on mobile for readability */
    }

    .checkbox-group input[type="checkbox"] {
        margin-right: 0.3rem; /* Maintain minimal spacing on mobile */
        margin-top: 0; /* Remove vertical offset for perfect alignment */
    }
}

/* iOS-specific fix for touch events and positioning */
@media (max-width: 768px) and (hover: none) {
    .nav-menu {
        position: fixed; /* Ensure it stays on top */
        z-index: 1001; /* Higher than header */
    }

    .hamburger:focus {
        outline: 2px solid #f1c40f; /* Visible focus for accessibility */
    }
}