/**
 * Martfury Child Theme - Custom Category Dropdown Styles
 * Substitui o highlight azul do browser por #fcb800
 *
 * @version 1.0.0
 */

/* Container do dropdown custom */
.product-cat {
    position: relative;
}

/* Dropdown custom - escondido por defeito */
.mf-custom-cat-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 100%;
    width: max-content;
    max-width: 350px;
    max-height: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 3px 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

/* Dropdown aberto */
.mf-custom-cat-dropdown.open {
    max-height: 400px;
    opacity: 1;
    visibility: visible;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Lista de opcoes */
.mf-cat-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Item individual */
.mf-cat-dropdown-item {
    padding: 5px 12px;
    cursor: pointer;
    color: #333;
    font-size: 13px;
    line-height: 1.3;
    transition: background-color 0.15s ease;
    border-bottom: none;
    white-space: nowrap;
}

.mf-cat-dropdown-item:last-child {
    border-bottom: none;
}

/* Primeiro item (Todas as categorias) */
.mf-cat-dropdown-item[data-depth="0"] {
    font-weight: 500;
}

/* HOVER - Cor amarela #fcb800 */
.mf-cat-dropdown-item:hover {
    background-color: #fcb800 !important;
    color: #000 !important;
}

/* Item selecionado */
.mf-cat-dropdown-item.selected {
    background-color: #fff8e1;
    color: #000;
    font-weight: 600;
}

/* Item selecionado + hover */
.mf-cat-dropdown-item.selected:hover {
    background-color: #fcb800 !important;
    color: #000 !important;
}

/* Label activa (dropdown aberto) */
.product-cat-label.active {
    background-color: #f9f9f9;
}

/* Seta da label quando activa */
.product-cat-label.active:before {
    transform: rotate(180deg);
}

/* Esconder o select nativo completamente */
.product-cat .product-cat-dd {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 1px !important;
    height: 1px !important;
}

/* Scrollbar custom para o dropdown */
.mf-custom-cat-dropdown::-webkit-scrollbar {
    width: 6px;
}

.mf-custom-cat-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.mf-custom-cat-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.mf-custom-cat-dropdown::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Hierarquia de categorias - indentacao */
.mf-cat-dropdown-item[data-depth="1"] {
    padding-left: 24px;
}

.mf-cat-dropdown-item[data-depth="2"] {
    padding-left: 36px;
}

.mf-cat-dropdown-item[data-depth="3"] {
    padding-left: 48px;
}

.mf-cat-dropdown-item[data-depth="4"] {
    padding-left: 60px;
}

.mf-cat-dropdown-item[data-depth="5"] {
    padding-left: 72px;
}

.mf-cat-dropdown-item[data-depth="6"] {
    padding-left: 84px;
}

/* Responsive - mobile */
@media (max-width: 767px) {
    .mf-custom-cat-dropdown {
        min-width: 100%;
        max-width: 280px;
        max-height: 300px;
    }

    .mf-cat-dropdown-item {
        padding: 6px 10px;
        font-size: 13px;
    }

    /* Reduzir indentacao no mobile */
    .mf-cat-dropdown-item[data-depth="1"] { padding-left: 20px; }
    .mf-cat-dropdown-item[data-depth="2"] { padding-left: 30px; }
    .mf-cat-dropdown-item[data-depth="3"] { padding-left: 40px; }
    .mf-cat-dropdown-item[data-depth="4"] { padding-left: 50px; }
    .mf-cat-dropdown-item[data-depth="5"] { padding-left: 60px; }
    .mf-cat-dropdown-item[data-depth="6"] { padding-left: 70px; }
}
