/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE CSS FOR IPAD MINI (TABLET) - CATEGORY PAGE
   ═══════════════════════════════════════════════════════════════════
   
   iPad Mini Breakpoints:
   • Portrait: 768px
   • Landscape: 1024px
   • General tablet: 768px - 1024px
   
   This stylesheet optimizes the category page for tablet devices
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   TABLET MEDIUM (768px - 1024px) - iPad Mini & Similar
   ═══════════════════════════════════════════════════════════════════ */

@media screen and (min-width: 768px) and (max-width: 1024px) {

    /* ═══════════════════════════════════════════════════════════════
       LAYOUT & SPACING
       ═══════════════════════════════════════════════════════════════ */
    
    body, html {
        font-size: 15px;
    }

    /* Main container adjustments */
    .container,
    .container-fluid {
        padding: 0 12px;
    }

    section {
        padding: 12px 0;
    }

    /* ═══════════════════════════════════════════════════════════════
       HEADER & NAVIGATION
       ═══════════════════════════════════════════════════════════════ */

    .header__top {
        height: auto;
        flex-wrap: wrap;
    }

    .header__logo {
        flex: 0 0 auto;
        width: auto;
        padding: 8px 0;
    }

    .header__logo img {
        height: 40px;
        width: auto;
    }

    .header__search {
        flex: 1;
        min-width: 250px;
        margin: 0 10px;
    }

    .header__search input {
        font-size: 14px;
        padding: 8px 10px;
    }

    /* Hamburger menu adjustments */
    .hamburger-toggle,
    .icons-heads {
        font-size: 18px;
        padding: 8px;
    }

    .all-icons-head {
        height: auto;
        gap: 8px;
    }

    .icons-heads {
        line-height: 1;
        min-width: 40px;
    }

    /* Mobile menu overlay adjustments */
    .mobile-menu-overlay {
        z-index: 1000;
    }

    .mobile-menu-content {
        height: 100vh;
    }

    .mobile-menu-header {
        padding: 12px 15px;
        position: sticky;
        top: 0;
        background-color: #f2fbc2;
        z-index: 10;
    }

    .mobile-menu-header h2 {
        font-size: 18px;
        margin: 0;
    }

    .mobile-menu-link {
        padding: 14px 18px;
        font-size: 15px;
    }

    .mobile-menu-link i {
        width: 24px;
    }

    .mobile-submenu li a {
        padding: 12px 20px 12px 50px;
        font-size: 14px;
    }

    /* ═══════════════════════════════════════════════════════════════
       CATEGORY PAGE - FILTER & SIDEBAR
       ═══════════════════════════════════════════════════════════════ */

    /* Filter sidebar */
    .filter-sidebar {
        width: 240px;
        padding-right: 15px;
        position: sticky;
        top: 15px;
        max-height: calc(100vh - 30px);
        overflow-y: auto;
    }

    .filter-box {
        padding: 14px;
        border-radius: 6px;
        margin-bottom: 12px;
    }

    .filter-title {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 10px;
    }

    .filter-option {
        font-size: 13px;
        gap: 6px;
    }

    .filter-option input[type="checkbox"] {
        width: 14px;
        height: 14px;
    }

    .count {
        font-size: 12px;
    }

    /* Mobile filter triggers */
    .mobile-filter-triggers {
        display: block;
        padding: 12px;
        background-color: #f5f5f5;
        border-bottom: 1px solid #ddd;
        margin-bottom: 12px;
    }

    .filter-toggle-btn {
        padding: 10px 15px;
        font-size: 14px;
        border-radius: 4px;
        background-color: #fff;
        border: 1px solid #ddd;
        cursor: pointer;
    }

    /* ═══════════════════════════════════════════════════════════════
       CATEGORY PAGE - PRODUCT GRID
       ═══════════════════════════════════════════════════════════════ */

    /* Product grid adjustments */
    .product-list,
    .product-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 0 8px;
    }

    /* Adjust to 2 columns for smaller tablets if needed */
    @media (max-width: 820px) {
        .product-list,
        .product-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }
    }

    .item-product,
    .product-item {
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        padding: 8px;
        transition: box-shadow 0.3s ease;
    }

    .item-product:hover,
    .product-item:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .item-product img,
    .product-item img {
        width: 100%;
        height: auto;
        border-radius: 3px;
    }

    .item-product__name,
    .product-name {
        font-size: 13px;
        line-height: 1.4;
        margin: 8px 0;
        min-height: 28px;
    }

    .item-product__price,
    .product-price {
        font-size: 14px;
        font-weight: 600;
        color: #c10017;
        margin: 8px 0;
    }

    .item-product__original-price,
    .product-original-price {
        font-size: 12px;
        text-decoration: line-through;
        color: #999;
        margin-bottom: 4px;
    }

    /* ═══════════════════════════════════════════════════════════════
       SORTING & PAGINATION
       ═══════════════════════════════════════════════════════════════ */

    .sort-section {
        padding: 12px 0;
        margin-bottom: 12px;
        border-bottom: 1px solid #e0e0e0;
    }

    .sort-select {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        align-items: center;
    }

    .sort-select label {
        font-size: 13px;
        font-weight: 500;
    }

    .sort-select select,
    #sort-by-option {
        padding: 8px 10px;
        font-size: 13px;
        border: 1px solid #ddd;
        border-radius: 4px;
        background-color: #fff;
    }

    .sort-total {
        font-size: 13px;
        color: #666;
    }

    /* Pagination */
    .pagination {
        display: flex;
        justify-content: center;
        gap: 4px;
        margin: 20px 0;
        flex-wrap: wrap;
    }

    .pagination li {
        margin: 0;
    }

    .pagination a,
    .pagination span {
        padding: 8px 10px;
        font-size: 12px;
        min-width: 36px;
        text-align: center;
        border: 1px solid #ddd;
        border-radius: 3px;
        background-color: #fff;
    }

    .pagination a:hover {
        background-color: #f5f5f5;
        border-color: #999;
    }

    .pagination .active span {
        background-color: #fe0000;
        color: #fff;
        border-color: #fe0000;
    }

    /* ═══════════════════════════════════════════════════════════════
       BANNER SECTION
       ═══════════════════════════════════════════════════════════════ */

    .top-banner {
        margin-bottom: 12px;
        display: none;
    }

    .top-banner section {
        padding: 0;
    }

    .slider-bannertop {
        height: 200px;
    }

    .slider-bannertop img {
        height: 200px;
        object-fit: cover;
    }

    /* ═══════════════════════════════════════════════════════════════
       FILTER BOX (Top filters)
       ═══════════════════════════════════════════════════════════════ */

    .box-filter {
        padding: 12px;
        background-color: #fafafa;
        border-bottom: 1px solid #ddd;
        margin-bottom: 12px;
    }

    .filter-item {
        margin-bottom: 12px;
    }

    .filter-item__title {
        font-size: 14px;
        font-weight: 600;
        padding: 10px 0;
        cursor: pointer;
        border-bottom: 1px solid #e0e0e0;
    }

    .filter-show {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 8px;
        padding: 8px 0;
    }

    .c-btnbox {
        padding: 6px 10px;
        font-size: 12px;
        border: 1px solid #ddd;
        border-radius: 3px;
        background-color: #fff;
        transition: all 0.3s ease;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .c-btnbox:hover {
        background-color: #f2fbc2;
        border-color: #fe0000;
    }

    .c-btnbox img {
        width: 50px;
        height: auto;
    }

    /* ═══════════════════════════════════════════════════════════════
       SIDEBAR & MAIN CONTENT LAYOUT
       ═══════════════════════════════════════════════════════════════ */

    .main-content-wrapper {
        display: grid;
        grid-template-columns: 240px 1fr;
        gap: 15px;
    }

    @media (max-width: 820px) {
        .main-content-wrapper {
            grid-template-columns: 220px 1fr;
            gap: 12px;
        }
    }

    .content-area {
        padding: 0;
    }

    /* ═══════════════════════════════════════════════════════════════
       FOOTER
       ═══════════════════════════════════════════════════════════════ */

    .footer_list-link,
    .footer-bottom {
        font-size: 13px;
    }

    footer .col-footer {
        margin-bottom: 20px;
    }

    footer .col-footer h3 {
        font-size: 15px;
        margin-bottom: 12px;
    }

    footer .col-footer ul li {
        margin-bottom: 6px;
        font-size: 13px;
    }

    .col-footer #email_newsletter {
        width: 150px;
        padding: 6px 8px;
        font-size: 13px;
    }

    .col-footer #now_submit {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* ═══════════════════════════════════════════════════════════════
       TYPOGRAPHY & TEXT ADJUSTMENTS
       ═══════════════════════════════════════════════════════════════ */

    h1, h2, h3, h4, h5, h6 {
        line-height: 1.3;
    }

    h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 18px;
    }

    h3 {
        font-size: 16px;
    }

    h4 {
        font-size: 15px;
    }

    p {
        font-size: 14px;
        line-height: 1.5;
    }

    /* ═══════════════════════════════════════════════════════════════
       BUTTONS & INTERACTIVE ELEMENTS
       ═══════════════════════════════════════════════════════════════ */

    button,
    .btn,
    .button {
        padding: 10px 16px;
        font-size: 14px;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    button:hover,
    .btn:hover,
    .button:hover {
        transform: translateY(-2px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .btn-primary,
    .button-primary {
        background-color: #fe0000;
        color: #fff;
        border: none;
    }

    .btn-primary:hover {
        background-color: #d91c1c;
    }

    /* ═══════════════════════════════════════════════════════════════
       QUICK FILTERS / TAGS
       ═══════════════════════════════════════════════════════════════ */

    .lst-quickfilter,
    .quick-filter {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 12px;
    }

    .lst-quickfilter li,
    .quick-filter li {
        list-style: none;
    }

    .lst-quickfilter a,
    .quick-filter a {
        padding: 6px 12px;
        font-size: 12px;
        border: 1px solid #ddd;
        border-radius: 20px;
        background-color: #f5f5f5;
        transition: all 0.3s ease;
    }

    .lst-quickfilter a:hover,
    .quick-filter a:hover {
        background-color: #fe0000;
        color: #fff;
        border-color: #fe0000;
    }

    /* ═══════════════════════════════════════════════════════════════
       SCROLLBAR STYLING FOR SIDEBAR
       ═══════════════════════════════════════════════════════════════ */

    .filter-sidebar {
        scrollbar-width: thin;
        scrollbar-color: #ccc #f5f5f5;
    }

    .filter-sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .filter-sidebar::-webkit-scrollbar-track {
        background: #f5f5f5;
        border-radius: 10px;
    }

    .filter-sidebar::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 10px;
    }

    .filter-sidebar::-webkit-scrollbar-thumb:hover {
        background: #999;
    }

    /* ═══════════════════════════════════════════════════════════════
       SPECIAL STYLES FOR IPAD INTERACTION
       ═══════════════════════════════════════════════════════════════ */

    /* Touch-friendly tap targets */
    button,
    a,
    input,
    select,
    [role="button"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover on touch devices, use active state instead */
    @media (hover: none) {
        .item-product:hover,
        .product-item:hover,
        .c-btnbox:hover,
        .lst-quickfilter a:hover {
            box-shadow: none;
        }

        .item-product:active,
        .product-item:active,
        .c-btnbox:active,
        .lst-quickfilter a:active {
            opacity: 0.8;
            transform: scale(0.98);
        }
    }

    /* Better spacing for touch */
    input[type="checkbox"],
    input[type="radio"] {
        margin: 4px;
        padding: 4px;
    }

    /* ═══════════════════════════════════════════════════════════════
       LOADING & PERFORMANCE
       ═══════════════════════════════════════════════════════════════ */

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

    .lazyload {
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .lazyload.loaded {
        opacity: 1;
    }

    /* ═══════════════════════════════════════════════════════════════
       UTILITY CLASSES
       ═══════════════════════════════════════════════════════════════ */

    .hidden-mobile {
        display: block !important;
    }

    .visible-mobile {
        display: block !important;
    }

    .hide-desktop {
        display: none !important;
    }

    .show-tablet {
        display: block !important;
    }

}

/* ═══════════════════════════════════════════════════════════════════
   SMALL TABLET (768px - 820px) - Smaller iPad Models
   ═══════════════════════════════════════════════════════════════════ */

@media screen and (min-width: 768px) and (max-width: 820px) {

    .product-list,
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .filter-sidebar {
        width: 200px;
    }

    .main-content-wrapper {
        gap: 10px;
    }

    .item-product__name,
    .product-name {
        font-size: 12px;
    }

    .box-filter {
        padding: 10px;
    }

    .filter-show {
        gap: 6px;
    }

}

/* ═══════════════════════════════════════════════════════════════════
   LANDSCAPE IPAD MINI (1024px) - Full Size
   ═══════════════════════════════════════════════════════════════════ */

@media screen and (min-width: 1025px) and (max-width: 1366px) {

    /* Slightly adjust for landscape */
    .product-list,
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .filter-sidebar {
        width: 240px;
    }

}

/* ═══════════════════════════════════════════════════════════════════
   PRINT STYLES (For printing category pages)
   ═══════════════════════════════════════════════════════════════════ */

@media print {

    .filter-sidebar,
    .mobile-filter-triggers,
    .sort-section,
    .pagination,
    .header__top,
    footer {
        display: none;
    }

    .product-list,
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .item-product,
    .product-item {
        page-break-inside: avoid;
        border: 1px solid #000;
    }

}
