/**
 * Public Styles - Professional Design
 */

.pcw-widget-container {
    width: 100%;
    margin: 40px 0;
    direction: rtl;
    text-align: right;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* RTL Support */
.rtl .pcw-widget-container,
[dir="rtl"] .pcw-widget-container {
    direction: rtl;
}

.ltr .pcw-widget-container,
[dir="ltr"] .pcw-widget-container {
    direction: ltr;
}

/* Categories List - Swiper */
.pcw-categories-list {
    margin-bottom: 30px;
    padding: 0;
}

.pcw-widget-container .swiper-button-next {
    left: 0 !important;
}

.pcw-widget-container .swiper-button-prev {
    right: 0 !important;
}

.pcw-widget-container .swiper-button-prev,
.pcw-widget-container .swiper-button-next {
    background-image: none !important;
}

.pcw-widget-container .swiper-button-prev::after,
.pcw-widget-container .swiper-button-next::after {
    /* -webkit-transform: scaleX(-1);
    transform: scaleX(-1); */
}

.pcw-categories-swiper {
    position: relative;
    padding: 10px 50px;
}

.pcw-categories-swiper .swiper-wrapper {
    align-items: center;
}

.pcw-categories-swiper .swiper-slide {
    width: auto;
    height: auto;
    border-radius: 12px;
    overflow: hidden;
    
}

/* Swiper Navigation Buttons */
.pcw-categories-swiper .swiper-button-prev,
.pcw-categories-swiper .swiper-button-next {
    width: 40px;
    height: 40px;
    background: #fff;
    border: 2px solid #e5e5e5;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: #666;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-top: 0;
    top: 50%;
    transform: translateY(-50%);
}

.pcw-widget-container .swiper-button-next {
    left: 0 !important;
    right: auto !important;
}

.pcw-widget-container .swiper-button-prev {
    right: 0 !important;
    left: auto !important;
}

.pcw-categories-swiper .swiper-button-prev:hover,
.pcw-categories-swiper .swiper-button-next:hover {
    background-color: #0072BB !important;
    border-color: #0072BB;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 114, 187, 0.3);
}

.pcw-categories-swiper .swiper-button-prev:active,
.pcw-categories-swiper .swiper-button-next:active {
    transform: translateY(-50%) scale(0.95);
}

.pcw-categories-swiper .swiper-button-prev::after,
.pcw-categories-swiper .swiper-button-next::after {
    font-size: 16px;
    font-weight: 700;
}

.pcw-categories-swiper .swiper-button-prev.swiper-button-disabled,
.pcw-categories-swiper .swiper-button-next.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.pcw-category-tab {
    width: 100%;
    padding: 12px 24px;
    background: #fff;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pcw-category-tab:hover {
    background: #e8edf3;
    border-color: #0072BB;
    color: #0072BB;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 114, 187, 0.2);
}

.pcw-category-tab.active {
    background: linear-gradient(135deg, #0072BB 0%, #005a94 100%);
    border-color: #0072BB;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0, 114, 187, 0.4);
    transform: translateY(-2px);
}

.pcw-category-tab-name {
    display: inline-block;
}

/* Products Table */
.pcw-products-container {
    margin-top: 30px;
}

.pcw-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.pcw-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0072BB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.pcw-loading-text {
    font-size: 16px;
    font-weight: 500;
    color: #0072BB;
}

.pcw-products-table-wrapper {
    position: relative;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e5e5e5;
    scrollbar-width: thin;
    scrollbar-color: #0072BB #f0f0f0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

.pcw-products-table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.pcw-products-table-wrapper::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
    margin: 10px;
}

.pcw-products-table-wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0072BB 0%, #005a94 100%);
    border-radius: 10px;
}

.pcw-products-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #005a94 0%, #004d7a 100%);
}

.pcw-products-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.pcw-products-table thead {
    background: linear-gradient(135deg, #0072BB 0%, #005a94 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.pcw-products-table th {
    padding: 18px 20px;
    text-align: right;
    font-weight: 600;
    font-size: 14px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.pcw-products-table th:first-child {
    border-top-right-radius: 16px;
}

.pcw-products-table th:last-child {
    border-top-left-radius: 16px;
}

[dir="ltr"] .pcw-products-table th,
.ltr .pcw-products-table th {
    text-align: left;
}

.pcw-products-table td {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.pcw-products-table tbody tr {
    transition: all 0.2s ease;
    cursor: pointer;
}

.pcw-products-table tbody tr[data-product-link]:hover {
    background: #e8edf3;
}

.pcw-products-table tbody tr:last-child td {
    border-bottom: none;
}

.pcw-products-table .pcw-col-image {
    display: none;
}

.pcw-product-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pcw-product-image-link {
    display: inline-block;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.pcw-product-image-link:hover {
    transform: scale(1.05);
}

.pcw-product-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e5e5e5;
    transition: border-color 0.3s ease;
}

.pcw-product-image-link:hover img {
    border-color: #0072BB;
}

.pcw-product-image .pcw-no-image {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: #f5f5f5;
    border-radius: 8px;
    border: 2px solid #e5e5e5;
    color: #999;
}

.pcw-product-image .pcw-no-image .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
}

.pcw-products-table .pcw-col-name {
    min-width: 120px;
    width: 40%;
}

.pcw-product-name {
    font-weight: 600;
    color: #1d2327;
    font-size: 15px;
    line-height: 1.5;
    text-align: right;
}

.pcw-product-name {
    color: #1d2327;
}

.pcw-products-table .pcw-col-price {
    min-width: 150px;
    width: 20%;
}

.pcw-product-price {
    font-weight: 700;
    color: #0072BB;
    text-align: right;
    font-size: 17px;
}

.pcw-products-table .pcw-attr-header {
    min-width: 150px;
}

.pcw-attr-cell {
    color: #666;
    text-align: right;
    font-size: 14px;
}

.pcw-attr-value {
    display: inline-block;
    padding: 6px 12px;
    background: #e8edf3;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    font-weight: 500;
}

.pcw-empty-row {
    text-align: center;
    padding: 60px 20px !important;
}

.pcw-empty-row .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #ccc;
    margin-bottom: 15px;
}

.pcw-empty-row p {
    margin: 0;
    color: #999;
    font-size: 16px;
}

.pcw-no-products {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.pcw-no-products .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #ddd;
    margin-bottom: 20px;
}

.pcw-no-products p {
    margin: 0;
    font-size: 16px;
    color: #666;
}

.pcw-no-settings,
.pcw-no-categories {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    text-align: center;
    margin: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .pcw-categories-swiper {
        padding: 10px 45px;
    }

    .pcw-categories-swiper .swiper-button-prev,
    .pcw-categories-swiper .swiper-button-next {
        width: 36px;
        height: 36px;
    }

    .pcw-categories-swiper .swiper-button-prev::after,
    .pcw-categories-swiper .swiper-button-next::after {
        font-size: 14px;
    }

    .pcw-category-tab {
        padding: 10px 18px;
        font-size: 14px;
        min-height: 44px;
    }

    .pcw-products-table {
        font-size: 13px;
    }

    .pcw-products-table th,
    .pcw-products-table td {
        padding: 10px;
    }

    .pcw-products-table-wrapper {
        overscroll-behavior-y: contain;
        overscroll-behavior-x: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y pan-x;
        scroll-snap-type: none;
    }

    .pcw-product-image img {
        width: 60px;
        height: 60px;
    }

    .pcw-product-image .pcw-no-image {
        width: 60px;
        height: 60px;
    }

    .pcw-product-image .pcw-no-image .dashicons {
        font-size: 24px;
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .pcw-categories-swiper {
        padding: 10px 40px;
    }

    .pcw-categories-swiper .swiper-button-prev,
    .pcw-categories-swiper .swiper-button-next {
        width: 32px;
        height: 32px;
    }

    .pcw-categories-swiper .swiper-button-prev::after,
    .pcw-categories-swiper .swiper-button-next::after {
        font-size: 12px;
    }

    .pcw-category-tab {
        padding: 8px 14px;
        font-size: 13px;
        min-height: 40px;
    }

    .pcw-products-table-wrapper {
        overscroll-behavior-y: contain;
        overscroll-behavior-x: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y pan-x;
    }

    .pcw-product-image img {
        width: 50px;
        height: 50px;
    }

    .pcw-product-image .pcw-no-image {
        width: 50px;
        height: 50px;
    }

    .pcw-product-image .pcw-no-image .dashicons {
        font-size: 20px;
        width: 20px;
        height: 20px;
    }
}