/**
 * HRB Advanced Content Tabs Carousel
 *
 * @package HRB_Content_Tabs_Carousel
 * @version 2.1.4
 */

/* ============================================
   Section Wrapper
   ============================================ */

.hrb-tabs-carousel-section {
    position: relative;
    overflow: hidden;
    background-color: #1c2b3a;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    border-radius: 24px;
    padding: 60px;
    isolation: isolate;
}

.hrb-tabs-carousel-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(28, 43, 58, 0.92) 0%, rgba(20, 60, 90, 0.55) 100%);
    z-index: 0;
    pointer-events: none;
}

.hrb-tabs-carousel-section.hrb-no-overlay::before {
    display: none;
}

.hrb-tabs-carousel {
    position: relative;
    z-index: 1;
    width: 100%;
    font-family: inherit;
    outline: none;
}

/* ============================================
   Section Header (Eyebrow + Heading + Tabs row)
   ============================================ */

.hrb-section-header {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 40px;
}

.hrb-section-eyebrow {
    display: block;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #FF8A00;
    margin-bottom: 10px;
}

.hrb-section-heading {
    margin: 0;
    font-size: 42px;
    font-weight: 800;
    line-height: 1.15;
    color: #ffffff;
}

/* The tabs row sits to the right of the heading on desktop (as in the reference design) */
.hrb-tabs-carousel > .tabs-navigation {
    margin-bottom: 40px;
}

@media (min-width: 992px) {
    .hrb-section-header {
        margin-bottom: 0;
    }

    .hrb-tabs-carousel {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        align-items: start;
        column-gap: 24px;
    }

    .hrb-section-header {
        grid-column: 1;
        grid-row: 1;
    }

    .hrb-tabs-carousel > .tabs-navigation {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
        margin-bottom: 0;
    }

    .hrb-tabs-carousel > .tabs-panels {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-top: 40px;
    }
}

/* ============================================
   Tab Navigation (pill buttons)
   ============================================ */

.hrb-tabs-carousel .tabs-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hrb-tabs-carousel .tab-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    outline: none;
    white-space: nowrap;
}

.hrb-tabs-carousel .tab-item:hover {
    border-color: #FF8A00;
    color: #FF8A00;
}

.hrb-tabs-carousel .tab-item.active {
    background: #FF8A00;
    border-color: #FF8A00;
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(255, 138, 0, 0.35);
}

.hrb-tabs-carousel .tab-item:focus-visible {
    outline: 2px solid #FF8A00;
    outline-offset: 2px;
}

/* ============================================
   Tab Panels
   ============================================ */

.hrb-tabs-carousel .tab-panel {
    position: relative;
    width: 100%;
}

.hrb-tabs-carousel .tab-panel.hidden {
    display: none;
}

.hrb-tabs-carousel .tab-panel.active {
    display: block;
    animation: hrbFadeIn 0.35s ease-in-out;
}

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

/* ============================================
   Carousel (each tab owns its own Swiper instance)
   ============================================ */

.hrb-tabs-carousel .carousel-wrapper {
    position: relative;
}

.hrb-tabs-carousel .swiper {
    width: 100%;
    overflow: visible;
    padding: 10px 4px 50px;
}

.hrb-tabs-carousel .swiper-slide {
    height: 420px;
    flex-shrink: 0;
}

/* ============================================
   Center Mode (active slide enlarged, side slides dimmed)
   Toggled by JS via the .hrb-center-scale class on the .swiper container,
   so it only applies when Layout Mode = Center AND "Scale/Dim Side Slides" is on.
   ============================================ */

.hrb-tabs-carousel .swiper.hrb-center-scale .swiper-slide {
    opacity: 0.55;
    transform: scale(0.88);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
    filter: saturate(0.85);
}

.hrb-tabs-carousel .swiper.hrb-center-scale .swiper-slide-active {
    opacity: 1;
    transform: scale(1);
    filter: saturate(1);
    z-index: 2;
}

/* Coverflow / Cube / Flip effects need slides to not be flex-shrunk so Swiper's
   own transform math is not fought by our base flex layout. */
.hrb-tabs-carousel .swiper-coverflow .swiper-wrapper,
.hrb-tabs-carousel .swiper-cube .swiper-wrapper,
.hrb-tabs-carousel .swiper-flip .swiper-wrapper {
    align-items: center;
}

/* ============================================
   Card — Overlay skin (matches reference design)
   ============================================ */

.hrb-tabs-carousel .card {
    position: relative;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.hrb-tabs-carousel .card.card-overlay {
    background: #0d1b27;
    border: 3px solid transparent;
}

.hrb-tabs-carousel.layout-center .swiper-slide-active .card.card-overlay {
    border-color: #ffffff;
}

.hrb-tabs-carousel .card.card-overlay .card-image {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
}

.hrb-tabs-carousel .card.card-overlay .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hrb-tabs-carousel .card.card-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(8, 16, 24, 0.92) 0%, rgba(8, 16, 24, 0.35) 45%, rgba(8, 16, 24, 0) 70%);
    z-index: 1;
    pointer-events: none;
}

.hrb-tabs-carousel .card.card-overlay .card-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 24px;
    color: #ffffff;
}

.hrb-tabs-carousel .card.card-overlay .title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 8px 0;
    color: #ffffff;
}

.hrb-tabs-carousel .card.card-overlay .title a {
    color: inherit;
    text-decoration: none;
}

.hrb-tabs-carousel .card.card-overlay .excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.hrb-tabs-carousel .card.card-overlay .button {
    display: inline-flex;
    align-items: center;
    margin-top: 14px;
    padding: 8px 18px;
    background: #FF8A00;
    color: #fff;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    z-index: 3;
}

.hrb-tabs-carousel .card .card-link-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ============================================
   Card — Classic skin (fallback, non-overlay)
   ============================================ */

.hrb-tabs-carousel .card.card-classic {
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.hrb-tabs-carousel .card.card-classic .card-image {
    position: relative;
    padding-top: 60%;
    overflow: hidden;
    background: #f1f1f1;
}

.hrb-tabs-carousel .card.card-classic .card-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hrb-tabs-carousel .card.card-classic .card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.hrb-tabs-carousel .card.card-classic .title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1c2b3a;
}

.hrb-tabs-carousel .card.card-classic .title a {
    color: inherit;
    text-decoration: none;
}

.hrb-tabs-carousel .card.card-classic .excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #5b6b78;
    margin: 0 0 14px 0;
    flex: 1;
}

.hrb-tabs-carousel .card.card-classic .button {
    display: inline-flex;
    align-self: flex-start;
    padding: 8px 18px;
    background: #FF8A00;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    z-index: 3;
}

/* ============================================
   WooCommerce Product Card
   ============================================ */

.hrb-tabs-carousel .card.product .price {
    font-size: 18px;
    font-weight: 700;
    margin: 6px 0;
}

.hrb-tabs-carousel .card.product.card-overlay .price,
.hrb-tabs-carousel .card.product.card-overlay .stock-status {
    color: #ffffff;
    position: relative;
    z-index: 3;
}

.hrb-tabs-carousel .card.product .price del {
    opacity: 0.6;
    margin-right: 6px;
}

.hrb-tabs-carousel .card.product .price ins {
    text-decoration: none;
    color: #FF8A00;
}

.hrb-tabs-carousel .card.product .rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 8px;
    position: relative;
    z-index: 3;
}

.hrb-tabs-carousel .card.product .rating .stars .star {
    color: rgba(255, 255, 255, 0.35);
}

.hrb-tabs-carousel .card.product .rating .stars .star.filled {
    color: #ffc107;
}

.hrb-tabs-carousel .card.product .rating .rating-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.hrb-tabs-carousel .card.product .stock-status {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.hrb-tabs-carousel .card.product .stock-status.outofstock {
    color: #ff8a8a;
}

.hrb-tabs-carousel .card.product .sale-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    background: #FF8A00;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 999px;
}

.hrb-tabs-carousel .card.product .add-to-cart-button {
    position: relative;
    z-index: 3;
}

/* ============================================
   Navigation Arrows
   ============================================ */

.hrb-tabs-carousel .swiper-button-next,
.hrb-tabs-carousel .swiper-button-prev {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    color: #FF8A00;
    transition: all 0.3s ease;
    top: 45%;
}

.hrb-tabs-carousel .swiper-button-next:hover,
.hrb-tabs-carousel .swiper-button-prev:hover {
    background: #FF8A00;
    color: #ffffff;
}

.hrb-tabs-carousel .swiper-button-next:after,
.hrb-tabs-carousel .swiper-button-prev:after {
    font-size: 16px;
    font-weight: 700;
}

/* ============================================
   Pagination Dots
   ============================================ */

.hrb-tabs-carousel .swiper-pagination {
    bottom: 0;
}

.hrb-tabs-carousel .swiper-pagination-bullet {
    width: 9px;
    height: 9px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
    transition: all 0.3s ease;
}

.hrb-tabs-carousel .swiper-pagination-bullet-active {
    background: #ffffff;
    width: 22px;
    border-radius: 5px;
}

/* ============================================
   Skeleton Loader
   ============================================ */

.hrb-tabs-carousel .skeleton-loader {
    display: flex;
    gap: 20px;
    padding: 10px 4px;
}

.hrb-tabs-carousel .skeleton-loader .skeleton-image,
.hrb-tabs-carousel .skeleton-loader .skeleton-title,
.hrb-tabs-carousel .skeleton-loader .skeleton-excerpt {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    animation: hrbPulse 1.5s ease-in-out infinite;
}

.hrb-tabs-carousel .skeleton-loader .skeleton-image {
    width: 100%;
    height: 380px;
}

@keyframes hrbPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ============================================
   Empty & Error States
   ============================================ */

.hrb-tabs-carousel .empty-state,
.hrb-tabs-carousel .tab-error {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.hrb-tabs-carousel .empty-state p,
.hrb-tabs-carousel .tab-error p {
    margin: 0;
    font-size: 16px;
}

.hrb-tabs-carousel .tab-error p {
    color: #ff8a8a;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 991px) {
    .hrb-section-heading {
        font-size: 32px;
    }
}

@media (max-width: 768px) {
    .hrb-tabs-carousel-section {
        padding: 36px 24px;
        border-radius: 16px;
    }

    .hrb-section-heading {
        font-size: 26px;
    }

    .hrb-tabs-carousel .tab-item {
        padding: 9px 18px;
        font-size: 13px;
    }

    .hrb-tabs-carousel .swiper-slide {
        height: 340px;
    }

    .hrb-tabs-carousel .swiper-button-next,
    .hrb-tabs-carousel .swiper-button-prev {
        width: 34px;
        height: 34px;
    }

    .hrb-tabs-carousel .swiper-button-next:after,
    .hrb-tabs-carousel .swiper-button-prev:after {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .hrb-tabs-carousel .tabs-navigation {
        gap: 8px;
    }

    .hrb-tabs-carousel .tab-item {
        padding: 7px 14px;
        font-size: 12px;
    }

    .hrb-tabs-carousel .card.card-overlay .card-content {
        padding: 16px;
    }

    .hrb-tabs-carousel .card.card-overlay .title {
        font-size: 17px;
    }
}

/* ============================================
   Accessibility
   ============================================ */

.hrb-tabs-carousel .tab-item[aria-selected="true"] {
    font-weight: 600;
}

.hrb-tabs-carousel .swiper-slide:focus-visible {
    outline: 2px solid #FF8A00;
    outline-offset: 2px;
}

/* ============================================
   RTL Support
   ============================================ */

.rtl .hrb-tabs-carousel .swiper-button-next {
    left: 10px;
    right: auto;
}

.rtl .hrb-tabs-carousel .swiper-button-prev {
    right: 10px;
    left: auto;
}

.rtl .hrb-tabs-carousel .swiper-button-next:after {
    content: 'prev';
}

.rtl .hrb-tabs-carousel .swiper-button-prev:after {
    content: 'next';
}
