/* ==========================================
   KEBRICK - RESPONSIVE DESIGN
   Works together with styles.css
========================================== */

/* GLOBAL RESPONSIVE FIXES */

html {
    scroll-behavior: smooth;
}

img {
    max-width: 100%;
}

body {
    overflow-x: hidden;
}

button,
input,
select,
textarea {
    max-width: 100%;
}

.container {
    min-width: 0;
}

.products,
#productList,
#wishlistList,
#collectionList {
    min-width: 0;
}

.product-card {
    min-width: 0;
    overflow-wrap: break-word;
}


/* ==========================================
   TABLETS AND SMALL LAPTOPS
========================================== */

@media (max-width: 1024px) {

    .container {
        width: 92%;
        max-width: 100%;
    }

    .products {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    #productList,
    #wishlistList,
    #collectionList {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .collection-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .comparison-section {
        min-width: 0;
    }

    .table-wrapper {
        max-width: 100%;
        overflow-x: auto;
    }

}


/* ==========================================
   MOBILE
========================================== */

@media (max-width: 768px) {

    .container {
        width: 94%;
        margin: 65px auto;
    }

    .products,
    #productList,
    #wishlistList,
    #collectionList {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .product-card {
        width: 100%;
        padding: 10px;
    }

    .product-card img {
        width: 100%;
        height: 130px;
        object-fit: contain;
    }

    .product-card h3 {
        overflow-wrap: anywhere;
    }

    .product-card button {
        width: 100%;
    }

    .collection-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-options {
        grid-template-columns: 1fr;
    }

    .filter-group {
        min-width: 0;
        width: 100%;
    }

    .search-box {
        width: 100%;
    }

    .search-input-wrap {
        min-width: 0;
        width: 100%;
    }

    .search-box select {
        width: 100%;
        min-width: 0;
    }

    .advanced-filters {
        padding: 15px;
    }

    .comparison-section {
        padding: 22px;
    }

    .table-wrapper {
        overflow-x: auto;
    }

    #comparisonTable {
        min-width: 0;
    }

    .modal-overlay {
        align-items: flex-start;
        padding: 15px;
    }

    .modal-content,
    .profile-modal {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .profile-modal {
        margin: auto 0;
    }

    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .collection-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .collection-actions button {
        max-width: 100%;
    }

}


/* ==========================================
   SMALL MOBILE
========================================== */

@media (max-width: 480px) {

    .container {
        width: 92%;
    }

    .products,
    #productList,
    #wishlistList,
    #collectionList {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .product-card {
        padding: 8px;
        border-radius: 12px;
    }

    .product-card img {
        height: 110px;
    }

    .product-card h3 {
        font-size: 10px;
    }

    .product-card p {
        font-size: 9px;
    }

    .product-card button {
        padding: 8px 4px;
        font-size: 9px;
    }

    .collection-stats {
        grid-template-columns: 1fr;
    }

    .filter-options {
        grid-template-columns: 1fr;
    }

    .filter-heading {
        align-items: flex-start;
        gap: 10px;
    }

    .comparison-section {
        padding: 16px;
    }

    .detail-grid {
        grid-template-columns: 1fr 1fr;
    }

    .profile-avatar-edit {
        flex-wrap: wrap;
    }

    .profile-modal-actions {
        flex-wrap: wrap;
    }

    .profile-modal-actions button {
        flex: 1;
    }

    .footer-links {
        gap: 12px;
    }

}


/* ==========================================
   VERY SMALL SCREENS
========================================== */

@media (max-width: 350px) {

    .products,
    #productList,
    #wishlistList,
    #collectionList {
        grid-template-columns: 1fr;
    }

    .product-card img {
        height: 180px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .dashboard {
        grid-template-columns: 1fr;
    }

}


/* ==========================================
   ACCESSIBILITY
========================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

}
/* COLLECTION & WISHLIST TABS */

.collection-tabs {
    display: flex;
    gap: 12px;
    margin: 28px 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.collection-tab {
    padding: 12px 22px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s ease;
}

.collection-tab:hover {
    transform: translateY(-2px);
}

.collection-tab.active {
    background: var(--yellow);
    color: #17191f;
    border-color: var(--yellow);
    box-shadow: 0 5px 18px rgba(255, 212, 59, 0.2);
}

.collection-tab-panel[hidden] {
    display: none !important;
}

@media (max-width: 480px) {
    .collection-tabs {
        gap: 8px;
    }

    .collection-tab {
        flex: 1;
        padding: 11px 8px;
        font-size: 13px;
    }
}