/**
 * Addis Shop Table Styles - Enhanced version
 */

/* ── Wrapper ── */
.addis-shop-wrapper {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
    font-family: 'Mulish', sans-serif;
}

/* ── Product Count Bar ── */
.addis-product-count-bar {
    text-align: center;
    margin: 20px 0 25px;
    padding: 12px 20px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #eee;
}

.addis-count-label {
    color: #54585a;
    font-size: 14px;
    margin-right: 8px;
}

.addis-count-badge {
    color: white;
    background-color: #ea7600;
    padding: 5px 14px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

/* ── Filter Toolbar ── */
.addis-filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    margin: 20px 0;
    padding: 20px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
}

.addis-filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 calc(25% - 15px);
    min-width: 0;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .addis-filter-item {
        flex: 1 1 calc(50% - 10px);
    }
}

@media (max-width: 600px) {
    .addis-filter-toolbar {
        flex-direction: column;
    }

    .addis-filter-item {
        flex: 1 1 100%;
    }

    .addis-brand-grid {
        grid-template-columns: 1fr;
    }
}

.addis-filter-label {
    font-size: 15px;
    font-weight: 600;
    color: #54585a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.addis-filter-item select {
    padding: 10px 14px;
    font-size: 15px;
    font-family: 'Mulish', sans-serif;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    min-width: 160px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.addis-filter-item select:focus {
    border-color: #ea7600;
    box-shadow: 0 0 0 3px rgba(234, 118, 0, 0.1);
    outline: none;
}

.addis-filter-item select.dropdown_product_cat {
    font-family: 'Mulish', sans-serif;
}


/* ── Category Section (Mode A) ── */
.addis-category-section {
    padding: 0;
    margin: 20px 0;
}

.addis-category-header {
    float: left;
    position: relative;
    border: 0;
    margin: 15px;
    padding: 0;
}

.addis-category-badge {
    margin-right: 10px;
    color: white;
    background-color: #ea7600;
    padding: 8px 16px;
    border-style: solid;
    border-color: #54585a;
    border-width: 1px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
}

.addis-category-dropdown-bar {
    width: 100%;
    padding-top: 10px;
    padding-right: 15px;
    text-align: center;
    clear: both;
}

.addis-category-dropdown-bar select.dropdown_product_cat,
.addis-category-bar select.dropdown_product_cat {
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    min-width: 320px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.addis-category-dropdown-bar select.dropdown_product_cat:focus,
.addis-category-bar select.dropdown_product_cat:focus {
    border-color: #ea7600;
    outline: none;
}

/* ── Category Tree (Mode A) ── */
.addis-category-tree {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.addis-category-tree .addis-cat-node {
    margin: 0;
}

.addis-category-tree .addis-cat-link {
    display: block;
    padding: 10px 16px;
    color: #54585a;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border-radius: 6px;
    background: #fafafa;
    border: 1px solid #eee;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.addis-category-tree .addis-cat-link:hover {
    background-color: #ea7600;
    color: white;
    border-color: #ea7600;
}

.addis-category-tree .addis-cat-count {
    color: #999;
    font-weight: 400;
    margin-left: 6px;
}

.addis-category-tree .addis-cat-link:hover .addis-cat-count {
    color: rgba(255,255,255,0.8);
}

.addis-category-tree .addis-cat-children {
    list-style: none;
    padding-left: 20px;
    margin: 4px 0 0;
}

/* ── Parameters / Filters ── */
.addis-parameters {
    text-align: center;
    border: 1px solid #ea7600;
    margin: 20px 0;
    padding: 20px;
    border-radius: 8px;
    background: #fff;
}

.addis-parameters-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.addis-parameter-item {
    text-align: center;
    padding: 10px 14px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fafafa;
    transition: background-color 0.2s, border-color 0.2s;
    min-width: 140px;
}

.addis-parameter-item.hoverstyle:hover {
    background-color: #fff5eb;
    border-color: #ea7600;
}

.addis-parameter-label {
    color: #54585a;
    background-color: white;
    padding: 3px 8px;
    border-radius: 3px;
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}

.addis-parameter-item select {
    margin-top: 5px;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    min-width: 140px;
    transition: border-color 0.2s;
}

.addis-parameter-item select:focus {
    border-color: #ea7600;
    outline: none;
}

/* ── Brand filter grid (4 columns) ── */
.addis-brand-filter-item {
    flex: 1 1 calc(25% - 15px);
    min-width: 0;
}

@media (max-width: 1024px) {
    .addis-brand-filter-item {
        flex: 1 1 calc(50% - 10px);
    }
}

@media (max-width: 600px) {
    .addis-brand-filter-item {
        flex: 1 1 100%;
    }
}

/* ── Brand multi-select dropdown ── */
.addis-brand-select {
    position: relative;
}

.addis-brand-toggle {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    line-height: 1.4;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.addis-brand-toggle:hover,
.addis-brand-select.is-open .addis-brand-toggle {
    border-color: #ea7600;
}

.addis-brand-toggle::after {
    content: "▼";
    float: right;
    font-size: 15px;
    margin-left: 8px;
    color: #666;
}

.addis-brand-select.is-open .addis-brand-toggle::after {
    content: "▲";
}

.addis-brand-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    padding: 12px;
    background: #fff;
    border: 1px solid #ea7600;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    box-sizing: border-box;
}

.addis-brand-select.is-open .addis-brand-dropdown {
    display: block;
}

/* Vertical scrollable brand list */
.addis-brand-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    text-align: left;
    padding-right: 4px;
}

.addis-brand-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: border-color 0.2s, background-color 0.2s;
}

.addis-brand-checkbox:hover {
    border-color: #ea7600;
    background-color: #fff5eb;
}

.addis-brand-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.addis-brand-checkbox span {
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Custom scrollbar for WebKit */
.addis-brand-grid::-webkit-scrollbar {
    width: 6px;
}

.addis-brand-grid::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.addis-brand-grid::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* ── Table ── */
.addis-shop-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-top: 20px;
    margin-bottom: 20px;
    border: 1px solid #ea7600;
    text-align: center;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
}

.addis-shop-table thead td,
.addis-shop-table tbody td {
    width: 20%;
}

.addis-shop-table thead td {
    font-size: 12px;
    padding: 10px 8px;
    border: 1px solid #ea7600;
    background-color: #ea7600;
    text-align: center;
    font-weight: bold;
    white-space: nowrap;
    color: white;
}

.addis-shop-table tbody td {
    font-size: 12px;
    padding: 8px;
    border: 1px solid #ea7600;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}

.addis-shop-table tbody tr:nth-child(even) {
    background-color: #f5f5f5;
}

.addis-shop-table tbody tr:hover {
    background-color: #f5f5f5;
}

/* ── Product row separators (orange line between each product row) ── */
.addis-shop-table tbody tr:not(:last-child) td {
    border-bottom: 2px solid #ea7600;
}

/* ── Sort Buttons ── */
.myButton,
.myButtonactivated {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    font-size: 0;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 4px;
    cursor: pointer;
    background: rgba(255,255,255,0.15);
    color: #fff;
    margin: 0 3px;
    transition: background 0.2s, transform 0.1s;
    vertical-align: middle;
}

.myButton::before {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.myButton[value$="_asc"]::before {
    border-bottom: 6px solid currentColor;
}

.myButton[value$="_desc"]::before {
    border-top: 6px solid currentColor;
}

.myButton:hover {
    background: rgba(255,255,255,0.35);
}

.myButton:active {
    transform: scale(0.95);
}

.myButtonactivated {
    background: #fff;
    color: #ea7600;
    border-color: #fff;
}

/* ── Product Links ── */
.product_case {
    cursor: pointer;
}

.product_link {
    color: #333;
    text-decoration: none;
    font-weight: bold;
}

.product_link:hover {
    color: #ea7600;
    text-decoration: underline;
}

/* ── Brand Thumbnail ── */
.brand-thumbnail {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
}

/* ── Tooltips ── */
.addistooltip {
    position: relative;
    display: inline-block;
}

.addistooltip .addistooltiptext {
    visibility: hidden;
    min-width: 200px;
    background-color: #fff;
    color: #000;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1000;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: 1px solid #ddd;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.addistooltip:hover .addistooltiptext {
    visibility: visible;
    opacity: 1;
}

.addistooltiptext table {
    width: 100%;
    border-collapse: collapse;
}

.addistooltiptext td {
    padding: 6px;
    font-size: 12px;
    border: 1px solid #ddd;
}

/* ── Pagination ── */
.addis-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 25px 0;
    padding: 15px;
    flex-wrap: wrap;
}

.addis-page-link,
.addis-page-current,
.addis-page-dots,
.addis-page-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.addis-page-link {
    background: #f4f4f4;
    color: #54585a;
    border: 1px solid #ddd;
    cursor: pointer;
}

.addis-page-link:hover {
    background: #ea7600;
    color: #fff;
    border-color: #ea7600;
}

.addis-page-current {
    background: #ea7600;
    color: #fff;
    border: 1px solid #ea7600;
    font-weight: bold;
}

.addis-page-dots {
    color: #888;
    border: none;
    background: transparent;
    cursor: default;
}

.addis-page-disabled {
    background: #f4f4f4;
    color: #bbb;
    border: 1px solid #e0e0e0;
    cursor: not-allowed;
}

.addis-page-prev,
.addis-page-next {
    font-weight: 600;
    padding: 0 14px;
}

/* ── Loading ── */
.addis-shop-table-container.addis-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Error ── */
.addis-shop-error {
    color: #c62828;
    padding: 30px;
    background: #ffebee;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
    font-size: 15px;
}

/* ── Category List Fallback ── */
.addis-cat-list-wrapper h3 {
    color: #54585a;
    margin-bottom: 15px;
}

.addis-cat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.addis-cat-list li {
    margin-bottom: 8px;
}

.addis-cat-list a {
    color: #ea7600;
    text-decoration: none;
    font-size: 14px;
}

.addis-cat-list a:hover {
    text-decoration: underline;
}

/* ── Shop Category Selector (Prod style) ── */
.addis-shop-category-selector {
    font-family: 'Mulish', sans-serif;
    color: #000;
    margin: 0 0 20px;
}

/* Header bar: badge left + dropdown right */
.addis-category-header-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px;
}

.addis-category-header {
    flex: 0 0 auto;
}

.addis-category-badge {
    display: inline-block;
    color: #fff;
    background-color: #ea7600;
    padding: 5px 10px;
    border: 1px solid #54585a;
    border-radius: 3px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.addis-category-dropdown-bar {
    flex: 1 1 auto;
    padding-top: 2px;
    text-align: left;
}

.addis-category-dropdown-bar select.dropdown_product_cat {
    width: 100%;
    max-width: 500px;
    padding: 6px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    font-family: 'Mulish', sans-serif;
}

/* Parameters panel — orange border, draggable, LEFT aligned */
.addis-shop-category-selector .addis-parameters {
    position: relative;
    border: 1px solid #ea7600;
    margin: 15px;
    padding: 10px;
    overflow-x: auto;
    cursor: grab;
    text-align: left;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.addis-shop-category-selector .addis-parameters:active {
    cursor: grabbing;
}

/* Category list — vertical tree with bullet dots */
.addis-cat-list-prod {
    list-style: disc;
    padding-left: 20px;
    margin: 0;
    display: block;
}

.addis-cat-list-prod > li {
    display: list-item;
    text-align: left;
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.5;
}

.addis-cat-list-prod li a {
    color: #54585a;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.addis-cat-list-prod li a:hover {
    color: #ea7600;
    text-decoration: none;
}

/* Children ul — indented with dots */
.addis-cat-list-prod .children {
    list-style: disc;
    padding: 0 0 0 20px;
    margin: 2px 0 4px;
}

.addis-cat-list-prod .children > li {
    margin: 0 0 2px;
    font-weight: 400;
}

.addis-cat-list-prod .children .children {
    list-style: circle;
    padding-left: 18px;
}

.addis-cat-list-prod .children li a {
    font-weight: 400;
}

/* ── Responsive ── */
@media ( max-width: 1024px ) {
    .addis-shop-wrapper {
        padding: 0 15px;
        margin: 20px auto;
    }

    .addis-filter-toolbar {
        gap: 15px;
        padding: 15px;
    }

    .addis-parameter-item {
        min-width: 120px;
    }

    .addis-shop-table {
        display: block;
        overflow-x: auto;
        font-size: 11px;
    }

    .addis-shop-table thead td,
    .addis-shop-table tbody td {
        padding: 6px 4px;
    }
}

@media ( max-width: 768px ) {
    .addis-shop-wrapper {
        padding: 0 10px;
        margin: 15px auto;
    }

    .addis-filter-toolbar {
        flex-direction: row;
        gap: 12px;
    }

    .addis-filter-item {
        flex: 1 1 calc(50% - 6px);
        width: auto;
        min-width: auto;
    }

    .addis-parameters {
        padding: 12px;
        margin: 12px 0;
    }

    .addis-parameters-list {
        flex-direction: column;
        align-items: stretch;
    }

    .addis-parameter-item {
        width: 100%;
    }

    .addis-shop-table thead td,
    .addis-shop-table tbody td {
        padding: 4px 2px;
        font-size: 11px;
    }

    .addis-brand-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .brand-thumbnail {
        max-width: 50px;
        max-height: 50px;
    }

    .addis-category-header {
        float: none;
        text-align: center;
    }

    .addis-category-tree {
        grid-template-columns: 1fr;
    }

    .addis-pagination {
        gap: 3px;
    }

    .addis-page-link,
    .addis-page-current,
    .addis-page-dots,
    .addis-page-disabled {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* ── Shop Home Type Product List ── */
.addis-shop-type-section {
    margin-top: 30px;
    padding: 20px 0;
    border-top: 2px solid #ea7600;
}

.addis-shop-type-title {
    font-family: 'Mulish', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #ea7600;
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
