/**
 * Custom Products Tabs Frontend Styles
 */

/* Mobile-First Base Styles */
.custom-products-tabs {
    width: 100%;
    margin: 15px 0;
    font-family: inherit;
}

.custom-products-tabs * {
    box-sizing: border-box;
}

/* Mobile-First Tabs Header */
.custom-products-tabs-header {
    margin-bottom: 20px;
}

.custom-tabs-navigation {
    position: relative;
}

.custom-tabs-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 2px;
    /* Mobile: Allow horizontal scrolling if needed */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
    scroll-behavior: smooth;
}

/* Mobile scrollbar styling */
.custom-tabs-nav::-webkit-scrollbar {
    height: 3px;
}

.custom-tabs-nav::-webkit-scrollbar-track {
    background: transparent;
}

.custom-tabs-nav::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.custom-tabs-nav::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.custom-tab-nav-item {
    position: relative;
    flex-shrink: 0;
    margin-bottom: 0;
}

.custom-tab-nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 14px;
    position: relative;
    min-height: 44px; /* Touch-friendly minimum height */
    white-space: nowrap;
    text-align: center;
}

.custom-tab-nav-link:hover {
    color: var(--btn-default-bgcolor);
}

.custom-tab-nav-item.active .custom-tab-nav-link {
    color: var(--btn-default-bgcolor);
    font-weight: 600;
}

.custom-tab-nav-item.active .tab-icon svg {
    fill: var(--btn-default-bgcolor);
}

/* Mobile-First Tab Icons */
.tab-icon {
    margin-left: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tab-icon-image {
    max-width: 32px;
    max-height: 32px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.tab-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.tab-icon svg {
    width: 32px;
    height: 32px;
}

.tab-icon i {
    font-size: 14px;
    line-height: 1;
}

/* Mobile: Stack icons above text for very small screens */
@media (max-width: 480px) {
    .custom-products-tabs {
        margin: 10px 0;
    }
    
    .custom-products-tabs-header {
        margin-bottom: 15px;
    }
    
    .custom-tabs-nav {
        flex-wrap: nowrap;
        padding-bottom: 5px;
        margin-bottom: 5px;
    }
    
    .custom-tab-nav-link {
        flex-direction: column;
        padding: 8px 10px;
        font-size: 12px;
        min-height: 50px;
        -webkit-tap-highlight-color: rgba(0, 115, 170, 0.1);
    }
    
    .tab-icon {
        margin-right: 0;
        margin-left: 0;
        margin-bottom: 4px;
    }
    
    .tab-icon-image {
        max-width: 36px;
        max-height: 36px;
    }
    
    .tab-icon img {
        width: 36px;
        height: 36px;
    }
    
    .tab-icon svg {
        width: 36px;
        height: 36px;
    }
    
    .tab-icon i {
        font-size: 16px;
    }
    
    .custom-products-tabs-content {
        min-height: 120px;
    }
    
    /* Enhanced mobile loading states */
    .custom-tab-loading {
        padding: 30px 15px;
    }
    
    .custom-spinner {
        width: 30px;
        height: 30px;
        border-width: 2px;
        margin-bottom: 10px;
    }
}

/* Tab Styles */
.tabs-style-underline .custom-tab-nav-item.active .custom-tab-nav-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--btn-default-bgcolor);
}

.tabs-style-background .custom-tab-nav-item.active .custom-tab-nav-link {
    background-color: #f0f0f0;
    border-radius: 4px 4px 0 0;
}

.tabs-style-border .custom-tab-nav-item.active .custom-tab-nav-link {
    border: 1px solid #e0e0e0;
    border-bottom: 1px solid #fff;
    border-radius: 4px 4px 0 0;
    margin-bottom: -1px;
}

.tabs-style-pills .custom-tabs-nav {
    border-bottom: none;
    gap: 10px;
}

.tabs-style-pills .custom-tab-nav-link {
    border-radius: 20px;
    background-color: #f5f5f5;
}

.tabs-style-pills .custom-tab-nav-item.active .custom-tab-nav-link {
    background-color: var(--btn-default-bgcolor);
    color: #fff;
}

/* Alignment */
.alignment-left .custom-tabs-nav {
    justify-content: flex-start;
}

.alignment-center .custom-tabs-nav {
    justify-content: center;
}

.alignment-right .custom-tabs-nav {
    justify-content: flex-end;
}

/* Mobile-First Tab Content */
.custom-products-tabs-content {
    position: relative;
    min-height: 150px;
}

.custom-tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.custom-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading States */
.custom-tab-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #666;
}

.custom-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--btn-default-bgcolor);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.content-loading {
    opacity: 0.7;
    pointer-events: none;
}

.content-loaded {
    opacity: 1;
    pointer-events: auto;
}

/* Error States */
.custom-tab-error {
    text-align: center;
    padding: 40px 20px;
    color: #d63638;
}

.error-message {
    margin-bottom: 15px;
    font-size: 16px;
}

.retry-button {
    background-color: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.retry-button:hover {
    background-color: var(--btn-default-bgcolor);
}

/* Products Grid - Now using theme's native structure */
.custom-products-tabs .products.wd-products {
    margin-top: 20px;
    /* All product styling is handled by the theme */
}

/* Navigation Arrows - Mobile First (Hidden by default) */
.custom-tabs-navigation-arrows {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: -40px;
    right: -40px;
    display: none; /* Hidden on mobile by default */
    justify-content: space-between;
    pointer-events: none;
}

.custom-tab-prev,
.custom-tab-next {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    color: #666;
}

.custom-tab-prev:hover,
.custom-tab-next:hover {
    background-color: var(--btn-default-bgcolor);
    border-color: var(--btn-default-bgcolor);
    color: #fff;
}

/* Indicators */
.custom-tabs-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.custom-tab-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #e0e0e0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.custom-tab-indicator.active {
    background-color: var(--btn-default-bgcolor);
}

/* Design Variations */
.design-modern {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.design-modern .custom-tabs-nav {
    background-color: #f8f9fa;
    border-bottom: none;
    padding: 5px;
}

.design-modern .custom-tab-nav-link {
    border-radius: 8px;
    margin: 0 2px;
}

.design-modern .custom-tab-nav-item.active .custom-tab-nav-link {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.design-minimal .custom-tabs-nav {
    border-bottom: 2px solid var(--brdcolor-gray-300);
    gap: 30px;
}

.design-minimal .custom-tab-nav-link {
    padding: 10px 0;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.design-classic .custom-tabs-nav {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px 4px 0 0;
}

.design-classic .custom-tab-nav-item.active .custom-tab-nav-link {
    background-color: #fff;
    border-bottom: 1px solid #fff;
}

/* Mobile-First Responsive Design */

/* Tablet and up: Enhanced layout */
@media (min-width: 481px) {
    .custom-products-tabs {
        margin: 20px 0;
    }
    
    .custom-products-tabs-header {
        margin-bottom: 25px;
    }
    
    .custom-tabs-nav {
        gap: 5px;
        overflow-x: visible;
    }
    
    .custom-tab-nav-link {
        padding: 10px 16px;
        font-size: 15px;
        flex-direction: row;
        min-height: 40px;
    }
    
    .tab-icon {
        margin-left: 8px;
        margin-bottom: 0;
    }
    
    .tab-icon-image {
        max-width: 36px;
        max-height: 36px;
    }
    
    .tab-icon img {
        width: 36px;
        height: 36px;
    }
    
    .tab-icon svg {
        width: 36px;
        height: 36px;
    }
    
    .tab-icon i {
        font-size: 15px;
    }
    
    .custom-products-tabs-content {
        min-height: 180px;
    }
}

/* Desktop: Full-featured layout */
@media (min-width: 769px) {
    .custom-products-tabs {
        margin: 25px 0;
    }
    
    .custom-products-tabs-header {
        margin-bottom: 30px;
    }
    
    .custom-tabs-nav {
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    .custom-tab-nav-link {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .tab-icon {
        margin-left: 8px;
    }
    
    .tab-icon-image {
        max-width: 40px;
        max-height: 40px;
    }
    
    .tab-icon img {
        width: 40px;
        height: 40px;
    }
    
    .tab-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .tab-icon i {
        font-size: 16px;
    }
    
    .custom-products-tabs-content {
        min-height: 200px;
    }
}

/* Large Desktop: Maximum enhanced layout */
@media (min-width: 1025px) {
    .custom-tabs-navigation-arrows {
        display: flex;
    }
    
    .custom-tab-nav-link {
        padding: 14px 24px;
        font-size: 17px;
    }
    
    .tab-icon {
        margin-left: 10px;
    }
    
    .tab-icon-image {
        max-width: 44px;
        max-height: 44px;
    }
    
    .tab-icon img {
        width: 44px;
        height: 44px;
    }
    
    .tab-icon svg {
        width: 44px;
        height: 44px;
    }
    
    .tab-icon i {
        font-size: 18px;
    }
}

/* Accessibility */
.custom-tab-nav-link:focus {
    /* outline: 2px solid var(--btn-default-bgcolor); */
    outline-offset: 2px;
}

.custom-tab-nav-link[aria-expanded="true"] {
    font-weight: 600;
}

/* Print Styles */
@media print {
    .custom-tabs-navigation-arrows,
    .custom-tabs-indicators {
        display: none;
    }
    
    .custom-tab-content {
        display: block !important;
    }
    
    .custom-tab-content:not(.active) {
        page-break-before: always;
    }
} 