/* ============================================
   RESPONSIVE CSS - BharatSearch
   Optimized for all screen sizes
   ============================================ */

/* Large Desktop Screens (1200px and above) */
@media screen and (min-width: 1200px) {
    .hero-content h1 {
        font-size: 3.5rem;
    }
    
    .container {
        max-width: 1140px;
        margin: 0 auto;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Desktop Screens (992px to 1199px) */
@media screen and (max-width: 1199px) {
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .featured-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .featured-main {
        grid-row: span 1;
    }
    
    .featured-main-content h3 {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 0 20px;
    }
    
    section {
        padding: 4rem 5%;
    }
}

/* Tablet Landscape (768px to 991px) */
@media screen and (max-width: 991px) {
    /* Navigation */
    nav {
        padding: 0 3%;
    }
    
    .nav-links {
        display: none;
    }
    
    .nav-actions .btn-login,
    .nav-actions .btn-register,
    .nav-actions .btn-account,
    .nav-actions .btn-logout {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    /* Hero Section */
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 3rem 5% 4rem;
        min-height: auto;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        max-width: 100%;
        margin: 0 auto 1.5rem;
    }
    
    .hero-btns {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-image-grid {
        display: none;
    }
    
    /* Categories */
    .cats-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1rem;
    }
    
    .cat-card {
        padding: 1rem 0.5rem;
    }
    
    .cat-icon {
        width: 60px;
        height: 60px;
    }
    
    /* Products Grid */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.2rem;
    }
    
    /* Featured Section */
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .featured-main {
        min-height: 400px;
    }
    
    .featured-main-content {
        padding: 1.5rem;
    }
    
    .featured-main-content h3 {
        font-size: 1.3rem;
    }
    
    .featured-main-content p {
        font-size: 0.85rem;
    }
    
    .featured-small {
        display: flex;
        gap: 1rem;
        align-items: center;
    }
    
    .featured-small img {
        width: 120px;
        height: 120px;
        object-fit: cover;
    }
    
    .featured-small-body {
        flex: 1;
        padding: 0.5rem;
    }
    
    /* Best Sellers Header */
    .bs-header-row {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .bs-header-row .section-header {
        text-align: center;
    }
    
    /* Latest Grid */
    .latest-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1rem;
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
    }
    
    /* Newsletter */
    .newsletter-inner {
        grid-template-columns: 1fr;
        padding: 2rem;
        text-align: center;
    }
    
    .newsletter-content h2 {
        font-size: 1.5rem;
    }
    
    .newsletter-perks {
        text-align: left;
        display: inline-block;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    /* Contact Info QR */
    .contact-with-qr {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    /* Cart Page */
    .cart-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .cart-items {
        overflow-x: auto;
    }
    
    /* Checkout */
    .checkout-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Product Detail */
    .product-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .gallery {
        position: static;
    }
    
    .delivery-info {
        flex-direction: column;
    }
    
    .actions {
        flex-direction: column;
    }
    
    /* Filters Sidebar */
    .featured-layout,
    .bestsellers-layout {
        grid-template-columns: 1fr;
        padding: 1rem 5%;
    }
    
    .filters-sidebar {
        position: static;
        margin-bottom: 1.5rem;
    }
    
    /* Account Page */
    .account-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Modal */
    #contactModal > div {
        width: 95%;
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* Tablet Portrait (576px to 767px) */
@media screen and (max-width: 767px) {
    /* General */
    body {
        font-size: 14px;
    }
    
    section {
        padding: 3rem 4%;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    /* Navigation */
    nav {
        height: 60px;
    }
    
    .logo a {
        font-size: 1.3rem;
    }
    
    .nav-actions .btn-cart {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .nav-actions .btn-cart i {
        font-size: 0.8rem;
    }
    
    /* Hero */
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-pill {
        font-size: 0.7rem;
    }
    
    .hero-btns .btn-primary,
    .hero-btns .btn-outline {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .stat-num {
        font-size: 1.3rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    /* Categories */
    .cats-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .cat-name {
        font-size: 0.75rem;
    }
    
    /* Products */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .product-name {
        font-size: 0.85rem;
    }
    
    .product-price {
        font-size: 1rem;
    }
    
    .product-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Quantity Selector */
    .quantity-selector {
        justify-content: center;
    }
    
    .quantity-selector input {
        width: 40px;
        font-size: 0.7rem;
    }
    
    .quantity-selector button {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    .btn-add-with-qty {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
    
    /* Latest Card */
    .latest-card-img {
        height: 160px;
    }
    
    /* Timer Badge */
    .timer-badge {
        font-size: 0.55rem;
        padding: 0.2rem 0.5rem;
    }
    
    .timer-badge .countdown {
        font-size: 0.6rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-brand .logo a {
        font-size: 1.3rem;
    }
    
    .footer-brand p {
        max-width: 100%;
        margin: 0.5rem auto;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-col .contact-info-list li {
        justify-content: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    /* Newsletter */
    .newsletter-form .form-group input {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Product Detail */
    .product-title {
        font-size: 1.5rem;
    }
    
    .price {
        font-size: 1.5rem;
    }
    
    .bulk-pricing table {
        font-size: 0.7rem;
    }
    
    .bulk-pricing td {
        padding: 0.3rem 0;
    }
    
    /* Reviews */
    .review-header {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .review-card {
        padding: 0.8rem;
    }
    
    /* Filters */
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
        border-radius: 16px;
    }
    
    .filter-group {
        justify-content: space-between;
    }
    
    .sort-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    
    .active-filters {
        justify-content: center;
    }
    
    /* Pagination */
    .pagination {
        gap: 0.3rem;
    }
    
    .pagination a,
    .pagination span {
        padding: 0.3rem 0.7rem;
        font-size: 0.8rem;
        min-width: 32px;
    }
    
    /* Form Elements */
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .profile-form {
        grid-template-columns: 1fr;
    }
    
    /* Toast */
    .toast {
        bottom: 15px;
        right: 15px;
        left: 15px;
        text-align: center;
        justify-content: center;
    }
}

/* Mobile Phones (up to 575px) */
@media screen and (max-width: 575px) {
    /* General */
    body {
        font-size: 13px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-tag {
        font-size: 0.7rem;
    }
    
    /* Navigation */
    nav {
        padding: 0 3%;
    }
    
    .logo a {
        font-size: 1.1rem;
    }
    
    .nav-actions {
        gap: 0.5rem;
    }
    
    .nav-actions .btn-cart,
    .nav-actions .btn-login,
    .nav-actions .btn-register {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .cart-badge {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }
    
    /* Hero */
    .hero {
        margin-top: 60px;
        padding: 2rem 4% 3rem;
    }
    
    .hero-content h1 {
        font-size: 1.6rem;
    }
    
    .hero-content p {
        font-size: 0.85rem;
    }
    
    .hero-pill {
        font-size: 0.65rem;
        margin-bottom: 1rem;
    }
    
    .hero-btns {
        gap: 0.8rem;
    }
    
    .hero-btns .btn-primary,
    .hero-btns .btn-outline {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
    
    .hero-stats {
        gap: 1.5rem;
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
    
    .stat-num {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.6rem;
    }
    
    /* Categories */
    .cats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .cat-card {
        padding: 0.8rem 0.3rem;
    }
    
    .cat-icon {
        width: 50px;
        height: 50px;
    }
    
    .cat-name {
        font-size: 0.7rem;
    }
    
    /* Products */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .product-img {
        min-height: 150px;
    }
    
    .product-body {
        padding: 0.6rem;
    }
    
    .product-name {
        font-size: 0.75rem;
        min-height: 2.2rem;
    }
    
    .product-cat {
        font-size: 0.6rem;
    }
    
    .product-price {
        font-size: 0.9rem;
    }
    
    .product-stars {
        font-size: 0.65rem;
    }
    
    .review-count {
        font-size: 0.6rem;
    }
    
    .product-price-old {
        font-size: 0.7rem;
    }
    
    .product-discount {
        font-size: 0.6rem;
    }
    
    .stock-warning {
        font-size: 0.6rem;
    }
    
    /* Price Tiers */
    .price-tiers small {
        font-size: 0.5rem;
    }
    
    /* Featured Small Cards */
    .featured-small {
        flex-direction: column;
        text-align: center;
    }
    
    .featured-small img {
        width: 100%;
        height: 150px;
    }
    
    .featured-small-body {
        text-align: center;
    }
    
    .featured-small-body .product-meta {
        justify-content: center;
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    .testimonial-card {
        padding: 1rem;
    }
    
    .testimonial-text {
        font-size: 0.85rem;
    }
    
    /* Newsletter */
    .newsletter-inner {
        padding: 1.5rem;
    }
    
    .newsletter-content h2 {
        font-size: 1.2rem;
    }
    
    .newsletter-form .btn-primary {
        padding: 0.8rem;
        font-size: 0.85rem;
    }
    
    /* Filters */
    .filters-sidebar {
        padding: 1rem;
    }
    
    .filter-title {
        font-size: 0.9rem;
    }
    
    .filter-checkbox {
        font-size: 0.75rem;
    }
    
    .price-link {
        font-size: 0.7rem;
    }
    
    /* Product Detail */
    .product-detail {
        margin: 80px auto 40px;
        padding: 0 12px;
    }
    
    .product-grid {
        padding: 1rem;
        gap: 1.5rem;
    }
    
    .product-title {
        font-size: 1.2rem;
    }
    
    .price {
        font-size: 1.2rem;
    }
    
    .old-price {
        font-size: 0.8rem;
    }
    
    .qty-btn {
        width: 32px;
        height: 32px;
    }
    
    .qty-input {
        width: 60px;
        height: 32px;
    }
    
    .btn-cart,
    .btn-buy {
        padding: 0.7rem;
        font-size: 0.85rem;
    }
    
    /* Reviews Section */
    .reviews-section {
        padding: 1rem;
        margin-top: 1.5rem;
    }
    
    .write-review-section {
        padding: 1rem;
    }
    
    .rating-input label {
        font-size: 1.2rem;
    }
    
    .review-textarea {
        font-size: 0.8rem;
    }
    
    .submit-review-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Cart Page */
    .cart-page,
    .checkout-page {
        padding: 80px 12px 40px;
    }
    
    .cart-summary {
        padding: 1rem;
    }
    
    .cart-items th,
    .cart-items td {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .cart-product {
        flex-direction: column;
        text-align: center;
    }
    
    .cart-product img {
        width: 50px;
        height: 50px;
    }
    
    /* Checkout */
    .form-section {
        padding: 1rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
    
    /* Account Page */
    .account-container {
        padding: 1rem 12px;
    }
    
    .account-sidebar {
        padding: 1rem;
    }
    
    .account-content {
        padding: 1rem;
    }
    
    /* Modal */
    #contactModal > div {
        padding: 1rem;
    }
    
    .modal-form-group input,
    .modal-form-group textarea {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
    
    /* Wishlist */
    .wishlist-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    /* View Details Button */
    .view-details-btn {
        padding: 0.5rem;
        font-size: 0.7rem;
    }
    
    /* Badges */
    .product-badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
    }
    
    .discount-badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* QR Code */
    .qr-code-wrapper {
        min-width: auto;
    }
    
    .qr-code img {
        width: 70px;
        height: 70px;
    }
}

/* Extra Small Devices (up to 380px) */
@media screen and (max-width: 380px) {
    /* Products */
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-card {
        max-width: 100%;
    }
    
    /* Categories */
    .cats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Hero */
    .hero-content h1 {
        font-size: 1.3rem;
    }
    
    /* Navigation */
    .nav-actions {
        gap: 0.3rem;
    }
    
    .nav-actions .btn-cart,
    .nav-actions .btn-login,
    .nav-actions .btn-register {
        padding: 0.2rem 0.4rem;
        font-size: 0.65rem;
    }
    
    /* Cart */
    .cart-items table {
        font-size: 0.7rem;
    }
    
    /* Footer */
    .footer-col h4 {
        font-size: 1rem;
    }
    
    .footer-col ul li a {
        font-size: 0.75rem;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .nav-actions,
    .hero-btns,
    .actions,
    .btn-add-with-qty,
    .wishlist-btn,
    .view-details-btn,
    .newsletter,
    footer,
    .pagination,
    .filters-sidebar,
    .sort-bar,
    .write-review-section {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .product-card,
    .featured-main,
    .featured-small {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Landscape Mode for Mobile */
@media screen and (max-width: 900px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 2rem 5%;
    }
    
    .hero-image-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .hero-img-card {
        aspect-ratio: 1/1;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .featured-main {
        min-height: 300px;
    }
}

/* High Resolution Screens (Retina) */
@media screen and (min-width: 1600px) {
    .container {
        max-width: 1400px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .hero-content h1 {
        font-size: 4rem;
    }
    
    section {
        padding: 6rem 10%;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-add-with-qty,
    .qty-btn,
    .wishlist-btn,
    .view-details-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .product-card:hover {
        transform: none;
    }
    
    .nav-item,
    .cat-card,
    .product-card {
        cursor: pointer;
    }
}