/**
 * WooCommerce Category Tabs - Frontend Styles
 * أزرار متساوية + كروسيل في الموبايل بـ 2 كولمن
 */

/* ===== Container ===== */
.wcct-container {
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* ===== Tabs Wrapper - Desktop ===== */
.wcct-tabs-wrapper {
    display: flex !important;
    flex-wrap: wrap;
    align-items: stretch;
    direction: rtl;
    box-sizing: border-box;
    padding: 12px 10px;
    gap: 8px;
}

/* ===== Individual Tab (Button Style) - Equal Width ===== */
.wcct-tab {
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    transition: all 0.25s ease;
    cursor: pointer;
    position: relative;
    line-height: 1.2;
    font-family: inherit;
    border: none;
    outline: none;
    box-sizing: border-box;
    margin: 0;
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 15px;
}

/* ===== Tab Hover Effect ===== */
.wcct-tab:hover {
    opacity: 0.85;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* ===== Active Tab ===== */
.wcct-tab.wcct-tab-active {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    font-weight: 700 !important;
}

/* ===== Show More Button ===== */
.wcct-tab.wcct-show-more {
    font-weight: 700;
}

.wcct-tab.wcct-show-more:hover {
    opacity: 0.9;
}

/* ===== Mobile Carousel ===== */
@media (max-width: 767px) {
    .wcct-tabs-wrapper {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        -ms-overflow-style: none;
        scrollbar-width: none;
        padding: 10px 8px;
        gap: 8px;
        scroll-snap-type: x mandatory;
    }

    .wcct-tabs-wrapper::-webkit-scrollbar {
        display: none;
    }

    /* Each tab = 50% width minus gap (2 columns) */
    .wcct-tab {
        flex: 0 0 calc(50% - 8px) !important;
        min-width: calc(50% - 8px) !important;
        max-width: calc(50% - 8px) !important;
        scroll-snap-align: start;
        /* ضمان نفس الارتفاع */
        min-height: 50px; 
        display: flex !important;
        align-items: center;
        justify-content: center;
        word-break: break-word;
        white-space: normal !important; /* السماح للنص بالنزول لسطر جديد لو طويل */
    }

    .wcct-tab.wcct-show-more {
        flex: 0 0 calc(50% - 8px) !important;
        min-width: calc(50% - 8px) !important;
        max-width: calc(50% - 8px) !important;
    }
}

/* ===== Tablet ===== */
@media (min-width: 768px) and (max-width: 991px) {
    .wcct-tab {
        flex: 1 1 calc(25% - 12px) !important;
    }
}

/* ===== Placeholder in editor ===== */
.wcct-placeholder {
    text-align: center;
    width: 100%;
    color: #999;
    padding: 20px;
    font-size: 14px;
}
