@media (max-width: 500px) {
    .site-header {
        padding: 0.5rem;
        flex-direction: row;
    }
    .home-button{
        width: 65%;
    }
    .site-logo {
        width: 45%;
        height: 40px;
    }
    .hero-title {
        font-size: 2.8rem;
    }
    .hero-right {
        display: none; 
    }
    .hero-left{
        max-width: 100%;
    }
    .hero-buttons{
        flex-direction: column;
        gap: 0px;
        align-items: center;
    }
    .nav-button{
        font-size: 16px;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .download-extension-button{
        width: 95%;
        font-size: 14px;
    }
    .hero-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        width: 95%;
        text-align: center;
    }
    .hero-left {
        max-width: 100%;
        padding-right: 0;
    }
    .hero-right {
        display: block;
        max-width: 100%;
        width: 100%;
        margin-top: 2rem;
    }
    .product-gallery {
        height: 380px; 
        --main-image-scale: 1.25;
        --main-image-position-x: 0%;
        --main-image-position-y: 0%;
        --side-image-scale: 1.30;
        --side-image-position-x: 20%;
        --side-image-position-y: 15%;
        --side-image-opacity: 0.4;
    }
    .gallery-image.prev {
        transform: translateX(-30%) scale(0.8);
    }
    .gallery-image.next {
        transform: translateX(30%) scale(0.8);
    }
    .how-to-use-boxes{
        flex-direction: column;
        gap: 20px;
    }
    .how-to-use-section{
        padding: 20px;
    }
    .how-to-use-title,
    .suggest-features-title {
        font-size: 1.8rem;
        text-align: center;
    }
    .how-to-use-box {
        padding: 15px;
        max-width: none;
    }
    .how-to-use-box-title {
        font-size: 1.2rem;
    }
    .how-to-use-box-text {
        font-size: 14px;
    }
    .suggest-features-section .suggestion-board {
        width: 90%;
    }
    .suggest-features-section .suggestion-input {
        width: 90%;
    }
    .suggest-features-section .submit-suggestion-btn {
        width: 95%;
    }
    .login.section {
        width: 90%;
        padding: 1rem;
    }
    .footer {
        font-size: 14px;
        padding: 25px 10px;
    }
    .nav-buttons{
        display: none;
    }
    .register-link-button {
        width: 90%;
        margin-bottom: 20px;
    }
    .section {
        height: auto;
        padding: 3rem 1rem;
    }
    .how-to-use.section{
        height: auto;
    }
    .suggestion-toggle-btn{
        top: 110px !important;
        left: 20px !important;
    }
    .leads-dashboard {
        padding-top: 70px;
        width: 100%;
    }
    .leads-container{
        width: 100%;
    }
    .leads-status{
        font-size: 16px;
    }
    .leads-title{
        width: 100%;
        margin: 0 auto;
    }
    .leads-header, .lead-row {
        min-width: 100%;
        font-size: 14px; 
    }
    #register {
        width: 90%;
    }
    .modal-content{
        max-width: 95%;
        height: auto;
    }
    .login-form{
        width: 100%;
    }
    .oauth-buttons.login{
        width: 100%;
        margin-bottom: 10px;
    }
    .oauth-divider{
        margin: 15px 0;
    }
    .flash.flash-error{
        margin-top: 10px;
    }
    .vote-count{
        font-size: 18px;
    }
    .login-link{
        font-size: 16px;
    }
    .lead-cell.lead-header.lead-header-contactinfo{
        display: none;
    }
    .lead-cell.lead-header.lead-header-date{
        display: none;
    }
    .lead-cell.lead-contact{
        display: none;
    }
    .lead-cell.lead-date{
        display: none;
    }
    .key-features-title {
        font-size: 1.8rem;
    }
    .key-features-subtitle {
        font-size: 1rem;
    }
    .key-features-and-why {
        flex-direction: column;
        gap: 3rem;
    }
    .feature-text-block {
        position: relative; 
        transform: none;
        margin-bottom: 1rem;
    }
    .feature-text-block:not(.active) {
        display: none;
    }
    #flow-slideshow-container {
        height: 30vh; 
        width: 90vw;
    }
    .flow-step-wrapper {
        flex-wrap: wrap; 
        gap: 10px;
        justify-content: center;
    }
    .flow-step {
        padding: 10px 15px;
        font-size: 0.9rem;
        width: 120px;
    }
    .flow-arrow {
        font-size: 2rem;
    }

    /* Template Builders Section - Mobile Styles */
    #template-builders {
        padding: 0 1vw;
    }

    .template-builders-container {
        width: 98%;
        padding: 1rem;
        margin-top: 1rem;
        margin-bottom: 1rem;
        border-radius: 8px;
    }

    .template-builders-title {
        font-size: 1.6rem;
        margin-bottom: 0.6rem;
        margin-top: 0.6rem;
        line-height: 1.3;
    }

    .template-builders-subtitle {
        font-size: 1rem;
        margin-bottom: 1.2rem;
        max-width: 100%;
        line-height: 1.4;
    }

    .template-builder-tabs {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 0.6rem;
        padding-bottom: 0.6rem;
        border-bottom: 1px solid #e2e2e2;
    }

    .template-tab {
        padding: 0.7rem 1rem;
        font-size: 0.95rem;
        justify-content: center;
        width: 100%;
    }

    .tab-icon {
        width: 20px;
        height: 20px;
    }

    .template-builder-content {
        min-height: 400px;
    }

    /* Template builder containers - mobile adjustments */
    #template-builders .invoice-builder-container,
    #template-builders .quote-builder-container {
        height: auto;
        min-height: 400px;
        flex-direction: column;
    }

    /* Sidebar adjustments for mobile - stack vertically */
    #template-builders .invoice-builder__sidebar,
    #template-builders .quote-builder__sidebar {
        width: 100%;
        min-width: unset;
        max-width: unset;
        border-right: none;
        border-bottom: 1px solid #e2e2e2;
        order: 2;
    }

    /* Canvas container adjustments for mobile */
    #template-builders .invoice-builder__canvas-container,
    #template-builders .quote-builder__canvas-container {
        width: 100%;
        padding: 0.2rem;
        order: 1;
    }

    /* Canvas size adjustments for mobile */
    #template-builders .invoice-builder__canvas,
    #template-builders .quote-builder__canvas {
        max-width: 100%;
        overflow-x: auto;
    }

    /* Toast notification adjustments for mobile */
    .template-toast-notification {
        top: 70px;
        right: 10px;
        left: 10px;
    }

    .toast-content {
        min-width: unset;
        max-width: unset;
        width: 100%;
        padding: 0.7rem 1rem;
    }

    .toast-message {
        font-size: 0.8rem;
    }

    /* Download button adjustments for mobile */
    #template-builders .invoice-builder__download-btn,
    #template-builders .quote-builder__download-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    /* Form controls adjustments for mobile */
    #template-builders .invoice-builder__input,
    #template-builders .quote-builder__input,
    #template-builders .invoice-builder__textarea,
    #template-builders .quote-builder__textarea {
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    #template-builders .invoice-builder__label,
    #template-builders .quote-builder__label {
        font-size: 0.9rem;
    }

    /* Button adjustments for mobile */
    #template-builders .invoice-builder__btn,
    #template-builders .quote-builder__btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }

    /* Section selector adjustments for mobile */
    #template-builders .invoice-builder__section-selector,
    #template-builders .quote-builder__section-selector {
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    #template-builders .invoice-builder__section-select,
    #template-builders .quote-builder__section-select {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }
}