/* Mobile Responsive Styles */

/* Base mobile styles */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .container {
        max-width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Header */
    .top-header {
        height: auto;
        padding: 10px 0;
    }

    .header-block {
        flex-wrap: wrap;
    }

    .header-left {
        width: 100%;
    }

    .header-right {
        width: 100%;
    }

    .navbar {
        padding: 0;
    }

    .navbar-toggler {
        display: block;
        position: absolute;
        right: 10px;
        top: 10px;
    }

    .navbar-collapse {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        z-index: 1000;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        padding: 15px;
    }

    .navbar-nav {
        flex-direction: column;
        width: 100%;
    }

    .head-menu {
        width: 100%;
        margin: 5px 0;
        text-align: center;
    }

    .title-right {
        position: absolute;
        right: 60px;
        top: 10px;
    }

    .dropdown-menu {
        position: absolute;
        right: 0;
        left: auto;
        min-width: 120px;
    }

    /* Logo */
    .topnav-logo {
        display: flex;
        align-items: center;
    }

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

    /* Page title */
    .page-title-box {
        padding: 10px 0;
    }

    .page-title {
        font-size: 18px;
    }

    /* Search box */
    .app-search {
        width: 100%;
        margin-top: 10px;
    }

    .app-search .form-control {
        width: 100%;
    }

    /* Navigation tabs */
    .nav-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
        white-space: nowrap;
    }

    .tab-link {
        flex-shrink: 0;
        min-width: 80px;
        padding: 8px 15px;
        font-size: 13px;
    }

    /* Product cards */
    .hyper-wrapper {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px 0;
    }

    .home-card {
        margin-bottom: 0;
    }

    .home-card .home-img {
        height: 120px;
    }

    .home-card .name {
        font-size: 12px;
        line-height: 1.3;
        height: auto;
        min-height: 50px;
    }

    .home-card .price {
        font-size: 14px;
    }

    /* Buy page */
    .buy-grid {
        display: block;
    }

    .buy-shop {
        width: 100%;
        order: 2;
    }

    .buy-product {
        width: 100%;
        order: 1;
        margin-bottom: 15px;
    }

    .buy-shop .sticky {
        position: relative;
        top: 0;
    }

    .buy-title {
        font-size: 14px;
    }

    .buy-price {
        font-size: 20px;
    }

    /* Form controls */
    .form-control {
        font-size: 16px;
    }

    .btn {
        padding: 10px 15px;
        font-size: 14px;
    }

    /* Articles */
    .card-body {
        padding: 15px;
    }

    .blog-post-title {
        font-size: 18px;
    }

    .blog-content {
        font-size: 14px;
    }

    .blog-content img {
        max-width: 100%;
        height: auto;
    }

    /* Article table */
    .table {
        font-size: 13px;
    }

    .home-tab td {
        padding: 8px 5px;
    }

    .article-updated-at {
        font-size: 11px;
    }

    /* Footer */
    .hyper-footer {
        padding: 15px 0;
        text-align: center;
    }

    .footer-links {
        font-size: 12px;
    }

    /* Back to top button */
    .back-to-top {
        bottom: 20px;
        right: 20px;
    }

    #back-to-top {
        width: 40px;
        height: 40px;
        padding: 0;
    }

    /* Pay type buttons */
    .pay-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .pay-type {
        flex: 1;
        min-width: 80px;
        height: 40px;
    }

    /* Modal */
    .modal-dialog {
        margin: 10px;
    }

    .modal-content {
        padding: 15px;
    }

    /* Video wrapper */
    .video-wrapper video {
        max-width: 100%;
        height: auto;
    }

    /* Product images in buy page */
    .buy-product img {
        max-width: 100%;
        height: auto;
    }

    .buy-product p img {
        width: 70px !important;
        height: auto !important;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .hyper-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .home-card .home-img {
        height: 100px;
    }

    .home-card .name {
        font-size: 11px;
        min-height: 40px;
    }

    .home-card .price {
        font-size: 12px;
    }

    .home-card .price b {
        font-size: 14px;
    }

    .tab-link {
        min-width: 70px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .head-menu {
        font-size: 12px;
        padding: 6px 10px;
    }

    .page-title {
        font-size: 16px;
    }

    h3 {
        font-size: 16px;
    }

    .buy-price {
        font-size: 18px;
    }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .hyper-wrapper {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .home-card .home-img {
        height: 140px;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .hyper-wrapper {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .home-card {
        transition: transform 0.2s, box-shadow 0.2s;
    }

    .home-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }
}

/* Image lazy loading */
.home-img {
    background-color: #f5f5f5;
    object-fit: cover;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Touch friendly */
@media (hover: none) and (pointer: coarse) {
    .btn, .head-menu, .tab-link, .home-card {
        min-height: 44px;
    }

    a {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Fix iOS input zoom */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px;
    }
}

/* Loading animation */
.loading-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Ribbon for out of stock */
.ribbon-box {
    position: relative;
    overflow: hidden;
}

.ribbon-two {
    position: absolute;
    top: 15px;
    right: -35px;
    transform: rotate(45deg);
    padding: 5px 30px;
    font-size: 10px;
    z-index: 10;
}

.ribbon-two-danger {
    background-color: #dc3545;
    color: white;
}

/* Badge styles */
.badge {
    font-size: 11px;
    padding: 4px 8px;
    margin: 2px;
}

/* Better touch targets for mobile */
@media (max-width: 768px) {
    .badge {
        font-size: 10px;
        padding: 3px 6px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .input-group {
        flex-wrap: wrap;
    }

    /* Alert boxes */
    .alert {
        padding: 10px 15px;
        font-size: 13px;
    }

    /* Order search tabs */
    .nav-tabs {
        flex-wrap: wrap;
    }

    .nav-tabs .nav-item {
        flex: 1;
    }

    .nav-tabs .nav-link {
        text-align: center;
        padding: 10px 5px;
        font-size: 13px;
    }
}
