/* responsive.css - Strictly for responsiveness fixes */

/* =========================================
   1. Fix Auto-Zoom on Mobile
   ========================================= */
@media screen and (max-width: 768px) {

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

/* =========================================
   2. Fix Horizontal Scroll & Overflow
   ========================================= */
html {
    max-width: 100%;
    overflow-x: hidden !important;
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    max-width: 100%;
    overflow-x: hidden !important;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    position: relative;
}

* {
    box-sizing: border-box;
}

/* Prevent any element from causing horizontal scroll */
*,
*::before,
*::after {
    max-width: 100%;
}

/* Ensure images and containers don't overflow */
img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
    max-width: 100%;
    height: auto;
}

.hero-section,
.main-content,
.footer-container,
.header-container,
.site-footer {
    max-width: 100%;
    overflow-x: hidden;
}

/* Ensure all sections stay within viewport */
section,
div,
header,
footer,
main {
    max-width: 100%;
}

/* Remove Navbar Scroll if present */
.header-container {
    overflow: visible !important;
}

/* =========================================
   3. Layout Behavior & Grids
   ========================================= */
/* Large Tablets / Small Laptops */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        /* Increased columns for laptop */
        gap: 1rem;
    }

    .hero-heading {
        font-size: 3rem;
    }

    .hero-container {
        padding: 0 2rem;
    }
}

/* Tablets (iPad, etc.) */
@media (max-width: 768px) {

    /* Navbar Responsiveness */
    .header-container {
        padding: 0 1rem;
        flex-wrap: nowrap;
    }

    .logo-img {
        max-height: 35px;
        width: auto;
    }

    /* Hero Section */
    .hero-section {
        padding-top: 80px;
        /* Reduced from 100px */
        padding-bottom: 2rem;
        min-height: auto;
    }

    .hero-heading {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    .hero-description {
        font-size: 1rem;
        max-width: 100%;
    }

    /* Grids */
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        /* 3 columns for tablet */
        gap: 0.75rem;
        padding: 0;
        width: 100%;
    }

    .product-card {
        min-height: auto !important;
    }

    .product-image {
        height: 140px;
    }

    .product-info {
        padding: 1rem;
    }

    .product-card h3 {
        font-size: 1rem;
    }

    /* FAQ Section Tablet Fix */
    .faq-section {
        max-width: 100%;
        padding: 2rem 1rem;
        margin: 2rem 0;
    }

    .faq-container {
        padding: 0;
        width: 100%;
        max-width: 100%;
    }

    .faq-list {
        width: 100%;
    }

    .faq-item {
        width: 100%;
    }

    .faq-question {
        width: 100%;
        padding: 0.9rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Cart Page */
    .cart-table-header {
        display: none;
    }

    .cart-item-card {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .cart-item-details {
        flex-direction: row;
    }

    .cart-item-quantity,
    .cart-item-total {
        justify-content: flex-start;
        align-items: center;
        flex-direction: row;
    }

    .cart-item-total {
        justify-content: space-between;
        width: 100%;
    }

    /* Footer */
    .site-footer {
        padding: 3rem 0 2rem !important;
        margin: 0 !important;
        width: 100% !important;
        overflow-x: hidden;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 0 2rem !important;
        margin: 0 auto !important;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .footer-col {
        width: 100%;
        padding: 1rem 0;
        margin: 0;
        box-sizing: border-box;
    }

    .footer-bottom {
        padding: 0.75rem 2rem 0 !important;
        margin: 0 auto;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-section .social-links {
        justify-content: center;
    }

    .newsletter-form {
        flex-direction: column;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-section .social-links {
        justify-content: center;
    }

    .newsletter-form {
        flex-direction: column;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {

    /* Navbar */
    .header-container {
        padding: 0 0.5rem;
        gap: 0.5rem;
        overflow-x: visible !important;
        /* Ensure no scroll */
    }

    .logo-img {
        max-height: 30px;
    }

    /* Hero Section - Maximize width & Reduce Gap */
    .hero-section {
        padding-top: 70px;
        /* Further reduced gap */
        padding-bottom: 1.5rem;
        padding-left: 0;
        padding-right: 0;
    }

    .hero-container {
        padding: 0 0.5rem;
        /* Minimal padding for edge-to-edge feel */
        width: 100%;
    }

    /* Main Content - Reduce side padding */
    .main-content {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Mobile Sidebar - Reduce width */
    .sidebar {
        width: 75% !important;
        max-width: 280px;
        left: -100% !important;
    }

    .sidebar.active {
        left: 0 !important;
    }

    /* FAQ Section Mobile Fix */
    .faq-section {
        padding: 1.5rem 0.5rem;
        max-width: 100%;
        margin: 1.5rem 0;
    }

    .faq-container {
        padding: 0 !important;
        width: 100%;
        max-width: 100%;
    }

    .faq-list {
        width: 100%;
        gap: 0.5rem;
    }

    .faq-heading {
        font-size: 1.5rem;
        text-align: center;
    }

    .faq-subheading {
        font-size: 0.9rem;
        padding: 0 0.5rem;
        text-align: center;
    }

    .faq-item {
        width: 100%;
        margin: 0;
    }

    .faq-question {
        width: 100%;
        padding: 0.8rem 0.9rem;
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Override style.css padding for these elements */
    .hero-container,
    .products-grid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Ensure body has no overflow */
    body {
        overflow-x: hidden !important;
        width: 100%;
    }

    /* Footer - Full width, no cutoff */
    .site-footer {
        padding: 2rem 0 1.5rem !important;
        margin: 0 !important;
        width: 100% !important;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .footer-container {
        padding: 0 1rem !important;
        margin: 0 auto !important;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-col {
        padding: 0.75rem 0;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .footer-col h4 {
        text-align: center;
        margin-bottom: 0.75rem;
    }

    .footer-col p {
        text-align: center;
        padding: 0;
    }

    .footer-col ul {
        text-align: center;
        padding: 0;
    }

    .footer-bottom {
        padding: 0.75rem 1rem 0 !important;
        margin: 0 auto;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        flex-direction: column;
        align-items: center !important;
        gap: 0.75rem;
        text-align: center;
    }

    .copyright,
    .policies {
        text-align: center;
        width: 100%;
    }

    .newsletter-form {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        gap: 0.5rem;
    }

    .newsletter-form input {
        width: 100%;
        box-sizing: border-box;
        padding: 0.75rem;
        font-size: 14px;
    }

    .newsletter-form button {
        width: 100%;
        box-sizing: border-box;
        padding: 0.75rem;
    }

    .socials {
        text-align: center;
        margin-top: 0.5rem;
    }

    .hero-heading {
        font-size: 1.8rem;
        /* Slightly smaller to fit better */
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }

    .button,
    .hero-secondary-btn {
        width: 100%;
        text-align: center;
        display: block;
    }

    /* Grids - Stack to 2 columns for mobile e-commerce look */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    /* Compact Product Card for Mobile */
    .product-card {
        width: 100%;
        min-height: auto !important;
        border-radius: 12px;
    }

    .product-image {
        height: 120px;
        border-radius: 10px 10px 0 0;
    }

    .product-info {
        padding: 0.75rem;
    }

    .product-card h3 {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }


    .add-to-cart-btn {
        padding: 8px;
        font-size: 12px;
    }

    /* Modals */
    .auth-modal-content,
    .free-modal-content {
        width: 95%;
        margin: 0 auto;
        padding: 1.5rem;
    }

    /* Cart */
    .cart-item-image {
        width: 80px;
        height: 80px;
    }

    .cart-item-title {
        font-size: 1rem;
    }
}

/* =========================================
   4. Fix Specific Overflow Issues
   ========================================= */
.products-control-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 600px) {
    .products-control-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-container,
    .filter-controls {
        width: 100%;
    }

    .filter-controls {
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
    }
}