/*================================ PRODUCTS =================================*/
html {
    scroll-behavior: smooth;
}

html,
body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #0f1b2d;
}

main {
    flex: 1;
}

/*================================ PRODUCTS TOOLS =================================*/

.products-tools {
    background: #f7f8fa;
    padding: 35px 0;
    border-bottom: 1px solid #eee;
}

.tools-container {
    width: 1200px;
    max-width: 100%;
    margin: auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.products-tools h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

/* TOOL BAR */

.tools-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
}

.tools-bar .search-box {
    margin-left: auto;
}

/* FILTER CATEGORY */

.mobile-tools {
    display: none;
}

.filter-category,
.filter-subcategory {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    position: relative;
}

.desktop-filter-btn {
    width: 265px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    background: white;
    color: #1f2937;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    white-space: nowrap;

    cursor: pointer;
}

.desktop-filter-btn:disabled {
    opacity: 1;
    background: rgb(180, 180, 180);
    color: #1f2937;
    border-color: #ddd;
    cursor: default;
    border: 1px solid rgb(180, 180, 180);
}


.desktop-filter-btn span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.desktop-filter-btn.active img {
    transform: rotate(0deg);
}

.desktop-filter-btn img {
    width: 12px;
    height: 8px;
    opacity: 0.8;
    transition: transform 0.3s;
    transform: rotate(-90deg);
}

.mobile-filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.mobile-filter-option-btn {
    width: 100%;
    min-height: 45px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    background: white;
    color: #1f2937;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    cursor: pointer;
    transition: all 0.3s;
}

.mobile-filter-option-btn:disabled {
    opacity: 1;
    background: rgb(180, 180, 180);
    color: #1f2937;
    border-color: #ddd;
    cursor: default;
    border: 1px solid rgb(180, 180, 180);
}

.mobile-filter-option-btn span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.mobile-filter-option-btn img {
    width: 12px;
    height: 8px;
    opacity: 0.8;
    transition: transform 0.3s;
    transform: rotate(-90deg);
}

.mobile-filter-option-btn.active img {
    transform: rotate(0deg);
}

.mobile-filter-option-btn.active {
    color: black;
}

.desktop-filter-dropdown {
    position: absolute;
    top: calc(100%);
    left: 0;
    max-height: 280px;
    width: 100%;
    overflow-y: auto;
    z-index: 110;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.desktop-filter-dropdown li {
    padding: 10px 12px;
    font-size: 13px;
    cursor: pointer;
}

.desktop-filter-dropdown li:hover {
    background: #3f8274;
    color: white;
}

.desktop-filter-dropdown li.active {
    display: none;
}

/* MOBILE TOOLBAR */

.filter-box {
    position: relative;
    display: flex;
    width: 100%;
}

.filter-box.hidden {
    display: none !important;
}

.filter-dropdown {
    position: absolute;
    top: calc(100%);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
}

.filter-dropdown li {
    padding: 12px 15px;
    font-size: 14px;
    cursor: pointer;
}

.filter-dropdown li:hover {
    background: #3f8274;
    color: white;
}

.filter-dropdown li.active {
    display: none;
}

.search-box {
    position: relative;
    width: 280px;
}

.search-box input, .search-input-wrapper input {
    width: 100%;
    min-height: 40px;
    padding: 10px 12px 10px 38px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}

.search-icon, .search-icon-mobile {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    opacity: 0.6;
    pointer-events: none;
}

.mobile-search-box {
    display: flex;
    align-items: center;
    justify-content: end;
    width: 100%;
    gap: 8px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    flex: 1;
}


/* PRODUCTS GRID */
.products-section {
    padding: 40px 0;
    background: #f7f8fa;
}

.products-grid {
    width: calc(100% - 120px);
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    position: relative;
}

.product-card {
    position: relative;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #cbcbcb;
    transition: .25s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .08);
}

.product-image {
    position: relative;
    height: 220px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #b3b7b7;
}

.product-image img {
    width: 200px;
    height: 200px;
    object-fit: contain;
}

.product-tag {
    position: absolute;
    top: 10px;
    left: 10px;

    background: #3f8274;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
    color: white;
}

.product-content {
    padding: 18px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.product-desc {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 15px;
}

.product-btn {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    color: #374151;
    transition: .2s;
}

.product-btn:hover {
    background: #f3f4f6;
}

/* HOVER PANEL */
.product-hover-panel {
    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    background: rgba(255, 255, 255, 0.90);

    padding: 30px;

    opacity: 0;
    visibility: hidden;

    transition: .35s ease;

    z-index: 10;

    display: flex;
    align-items: center;
}

.product-card:hover .product-hover-panel {
    opacity: 1;
    visibility: visible;
}

.hover-content {
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
    padding-right: 10px;
    font-size: 16px;
    line-height: 1.5;
    color: #1f2937;
}

.hover-content p {
    margin: 0 0 10px;
}

.hover-content ul,
.hover-content ol {
    margin: 0 0 12px 18px;
    padding-left: 12px;
}

.hover-content ul {
    list-style: disc;
}

.hover-content ol {
    list-style: decimal;
}

.hover-content li {
    margin-bottom: 6px;
}

.hover-content::-webkit-scrollbar {
    width: 6px;
}

.hover-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.hover-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.hover-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .tools-container {
        width: 100%;
        padding: 0 30px;
        box-sizing: border-box;
    }

    .tools-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 20px;
    }

    .search-box {
        width: 240px;
    }

    .products-grid {
        width: 90%;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .product-image {
        height: 200px;
    }

    .product-image img {
        width: 170px;
        height: 170px;
    }
}

@media (max-width:768px) {
    .products-tools {
        padding: 25px 0;
    }

    .products-tools h2 {
        font-size: 28px;
        margin-bottom: 10px;
    }

    .search-box {
        display: none !important;
    }

    .search-icon {
        display: none;
    }

    .mobile-search-box .search-input-wrapper {
        display: none;
    }

    .mobile-search-box.is-open .search-input-wrapper {
        display: flex;
    }

    .tools-bar {
        display: none;
    }

    .mobile-tools {
        display: flex;
        justify-content: space-between;
        width: 100%;
        gap: 10px;
        position: relative;
    }

    .mobile-filters-wrapper {
        display: none;
        width: 100%;
        gap: 10px;
    }

    .mobile-filters-wrapper.active {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }

    .mobile-tools.filters-active .filter-box,
    .mobile-tools.filters-active .mobile-search-box {
        display: none;
    }

    .mobile-filter-options {
        flex: 1;
        min-width: 0;
        position: relative;
    }

    .mobile-filter-option-btn {
        position: relative;
        z-index: 1;
    }

    .mobile-search-box {
        flex: 1;
    }

    .tool-btn {
        width: 45px;
        height: 45px;
        border: 1px solid #ccc;
        background: white;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .tool-btn img {
        width: 20px;
    }

    .tools-container {
        width: 92%;
        padding: 0;
    }

    .tools-container h2 {
        text-align: center;
    }

    .products-grid {
        width: 92%;
        grid-template-columns: 1fr;
        gap: 18px;

    }

    .product-image {
        height: 190px;
    }

    .product-image img {
        width: 160px;
        height: 160px;
    }

    .product-content {
        padding: 16px;
    }

    .product-title {
        font-size: 15px;
    }

    .filter-dropdown {
        width: 100%;
    }
}