/* Responsive CSS for VidhiBharti */

/* Menu toggle - hidden on desktop */
.menu-toggle {
    display: none;
    background: #333;
    color: #fff;
    padding: 12px 15px;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
}

/* Tablet - up to 1024px */
@media screen and (max-width: 1024px) {
    .pivot, .grid {
        width: 100% !important;
        padding: 0 10px;
        box-sizing: border-box;
    }
    .grid1, .grid2, .grid3, .grid4, .grid5, .grid6, .grid7, .grid8, .grid9, .grid10, .grid11, .grid12 {
        margin: 0 1%;
        box-sizing: border-box;
    }
    .full1, .full2, .full3, .full4, .full5, .full6, .full7, .full8, .full9, .full10, .full11, .full12 {
        width: 100% !important;
        float: none;
    }
    .grid9 { width: 46% !important; }
    .grid3 { width: 46% !important; }
    .grid12 { width: 96% !important; }
    .flexslider { width: 100% !important; }
}

/* Mobile - up to 768px */
@media screen and (max-width: 768px) {
    /* Hamburger menu */
    .menu-toggle {
        display: block;
    }
    #mainNav {
        display: none;
        width: 100% !important;
        padding: 0 !important;
        position: relative;
        z-index: 100;
    }
    #mainNav .nav {
        display: block;
        width: 100%;
        white-space: normal;
        overflow: visible;
    }
    #mainNav .nav .nav-item {
        display: block;
        float: none;
        border-bottom: 1px solid #444;
    }
    #mainNav .nav .nav-item .nav-item-link {
        display: block;
        padding: 12px 15px;
    }
    #mainNav .nav .nav-item .dropdown-content {
        position: static !important;
        display: none !important;
        box-shadow: none;
        background: #f9f9f9;
        min-width: 100% !important;
        padding-left: 20px;
    }
    #mainNav .nav .nav-item .dropdown-content.open {
        display: block !important;
    }
    .pivot, .grid {
        width: 100% !important;
        padding: 0 5px;
        box-sizing: border-box;
    }
    .grid1, .grid2, .grid3, .grid4, .grid5, .grid6, .grid7, .grid8, .grid9, .grid10, .grid11, .grid12 {
        width: 96% !important;
        margin: 5px auto;
        float: none;
    }
    .full1, .full2, .full3, .full4, .full5, .full6, .full7, .full8, .full9, .full10, .full11, .full12 {
        width: 100% !important;
        float: none;
    }
    /* Header */
    .header .page {
        flex-direction: column;
    }
    .header-content, .header-content .grid12 {
        width: 100% !important;
        display: block !important;
        float: none !important;
        overflow: visible;
    }
    header.header {
        overflow: visible !important;
        clear: both !important;
        margin-bottom: 10px !important;
        padding-bottom: 10px !important;
    }
    .menu-toggle {
        clear: both;
        margin-bottom: 20px;
    }
    .logo img {
        max-width: 150px;
    }
    .search {
        float: none !important;
        position: static !important;
        top: auto !important;
        margin: 10px auto !important;
        width: 90% !important;
        height: auto !important;
    }
    .search-open .search-wrap {
        width: 200px !important;
    }
    .cart {
        float: none !important;
        position: static !important;
        text-align: center;
        margin: 5px 0;
    }
    .header-links, .header .f-right {
        text-align: center;
        width: 100%;
    }
    /* Navigation */
    .ns-header .menu {
        height: auto !important;
        padding: 5px 0;
        overflow: visible !important;
    }
    .ns-header .menu .grid12 {
        width: 100% !important;
    }
    .ns-header .menu .float-left,
    .ns-header .menu .float-right {
        float: none !important;
        text-align: center;
        width: 100%;
    }
    .ns-header .menu .link {
        display: inline-block !important;
        float: none !important;
        padding: 4px 8px;
        font-size: 11px;
        height: auto !important;
        line-height: normal !important;
    }
    .ns-header .menu .separator {
        display: none;
    }
    .ns-header .menu .item {
        display: inline-block !important;
        float: none !important;
        height: auto !important;
    }
    .nav {
        overflow-x: auto;
        white-space: nowrap;
    }
    .nav ul li {
        display: inline-block;
        float: none;
    }
    /* Product grids - 2 per row on mobile */
    .block-product-grid-parent {
        width: 47% !important;
        margin: 1% !important;
        float: left;
        box-sizing: border-box;
    }
    .block-product-grid-parent .product-image img {
        width: 100%;
        height: auto;
    }
    /* Slider */
    .flexslider {
        width: 100% !important;
        margin-bottom: 10px !important;
    }
    .flexslider img {
        width: 100%;
        height: auto;
    }
    /* Forms */
    .block-standart {
        width: 100% !important;
        float: none;
    }
    .fluid50 {
        width: 100% !important;
        float: none;
    }
    input.text, textarea.textarea, select {
        width: 100% !important;
        box-sizing: border-box;
    }
    /* Cart table */
    table {
        width: 100%;
        overflow-x: auto;
        display: block;
    }
    /* Category menu */
    .block-nav {
        max-height: 300px;
        overflow-y: auto;
    }
    /* Marquee / bookstore list */
    marquee {
        height: 200px !important;
    }
    /* Hide compare link on mobile */
    .compare-link {
        display: none;
    }
}

/* Small mobile - up to 480px */
@media screen and (max-width: 480px) {
    .block-product-grid-parent {
        width: 100% !important;
        margin: 5px 0 !important;
        float: none;
    }
    .product-buttons-wrap .button {
        font-size: 11px;
        padding: 5px 8px;
    }
    .block-header {
        font-size: 14px;
    }
    .product-name a {
        font-size: 12px;
    }
    .product-price {
        font-size: 13px;
    }
    /* Stack login form sections */
    .form .group {
        width: 100%;
    }
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Fix body background on mobile */
@media screen and (max-width: 768px) {
    body {
        background-size: cover;
        background-attachment: scroll;
    }
}
