/* ===================================
   Needway Nutrition — Components
   Product cards, Carousels, Tabs, etc.
   =================================== */

/* ── Product Card ── */
.product-card {
    background: var(--bg-card-dark);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--duration-normal) var(--ease-out),
        border-color var(--duration-normal),
        box-shadow var(--duration-normal);
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.product-card__image-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--bg-dark);
}

.product-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out);
}

.product-card:hover .product-card__image {
    transform: scale(1.08);
}

.product-card__badges {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    z-index: 2;
}

.product-card__favorite {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 36px;
    height: 36px;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: var(--fs-md);
    cursor: pointer;
    transition: all var(--duration-fast);
    z-index: 2;
}

.product-card__favorite:hover,
.product-card__favorite.active {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.product-card__quick-add {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-sm);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    transform: translateY(100%);
    transition: transform var(--duration-normal) var(--ease-out);
    z-index: 2;
}

.product-card:hover .product-card__quick-add {
    transform: translateY(0);
}

.product-card__body {
    padding: var(--space-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.product-card__category {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.product-card__name {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    line-height: 1.4;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--duration-fast);
}

.product-card:hover .product-card__name {
    color: var(--primary);
}

.product-card__rating {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.product-card__rating-count {
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

.product-card__price-wrap {
    margin-top: auto;
    padding-top: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.product-card__price-original {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-card__price {
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    color: var(--primary);
    font-family: var(--font-heading);
}

.product-card__price-pix {
    font-size: var(--fs-xs);
    color: var(--success);
    font-weight: var(--fw-medium);
}

.product-card__price-installment {
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

/* Quick Add: desktop = full button, mobile = icon only */
.quick-add__icon {
    display: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
    margin-left: auto;
}

/* ── Category Card ── */
.category-card {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    aspect-ratio: 3 / 4;
    cursor: pointer;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: transform var(--duration-normal) var(--ease-out),
        border-color var(--duration-normal);
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.category-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out);
}

.category-card:hover .category-card__image {
    transform: scale(1.05);
}

.category-card__overlay {
    position: absolute;
    inset: 0;
    background: var(--gradient-overlay);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-lg);
}

.category-card__name {
    font-family: var(--font-heading);
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.category-card__count {
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

.category-card__arrow {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border-radius: var(--radius-full);
    color: #fff;
    font-size: var(--fs-sm);
    margin-top: var(--space-sm);
    transition: transform var(--duration-fast);
}

.category-card:hover .category-card__arrow {
    transform: translateX(4px);
}

/* ── Objective Card ── */
.objective-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
}

.objective-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.objective-card__icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: var(--radius-xl);
    margin: 0 auto var(--space-md);
    font-size: var(--fs-2xl);
    color: var(--primary);
}

.objective-card__name {
    font-family: var(--font-heading);
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
}

.objective-card__desc {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* ── Carousel ── */
.carousel {
    position: relative;
    overflow: hidden;
}

.carousel__track {
    display: flex;
    transition: transform var(--duration-slow) var(--ease-out);
}

.carousel__slide {
    min-width: 100%;
    position: relative;
}

.carousel__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 3;
    transition: all var(--duration-fast);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.carousel__btn:hover {
    color: var(--primary);
    transform: translateY(-50%) scale(1.2);
}

.carousel__btn--prev {
    left: var(--space-md);
}

.carousel__btn--next {
    right: var(--space-md);
}

.carousel__dots {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

.carousel__dot {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--duration-fast);
    position: relative;
    overflow: hidden;
    border: none;
    padding: 0;
}

.carousel__dot:hover {
    background: rgba(255, 255, 255, 0.5);
}

.carousel__dot-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: #fff;
    border-radius: var(--radius-full);
    pointer-events: none;
}

.carousel__dot.active {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes dotProgress {
    from { width: 0%; }
    to { width: 100%; }
}

/* ── Tabs ── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--glass-border);
    overflow-x: auto;
    scrollbar-width: none;
}

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

.tabs__tab {
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-heading);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--duration-fast);
    position: relative;
    white-space: nowrap;
    background: none;
    border: none;
}

.tabs__tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform var(--duration-normal) var(--ease-out);
}

.tabs__tab:hover {
    color: var(--text-light);
}

.tabs__tab.active {
    color: var(--primary);
}

.tabs__tab.active::after {
    transform: scaleX(1);
}

.tabs__content {
    display: none;
    padding: var(--space-xl) 0;
    animation: fadeIn var(--duration-normal);
}

.tabs__content.active {
    display: block;
}

/* ── Accordion ── */
.accordion {}

.accordion__item {
    border-bottom: 1px solid var(--glass-border);
}

.accordion__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-lg) 0;
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    color: var(--text-light);
    cursor: pointer;
    text-align: left;
    background: none;
    border: none;
}

.accordion__icon {
    font-size: var(--fs-lg);
    transition: transform var(--duration-normal) var(--ease-out);
    color: var(--primary);
}

.accordion__item.active .accordion__icon {
    transform: rotate(45deg);
}

.accordion__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--duration-normal) var(--ease-out);
}

.accordion__item.active .accordion__body {
    max-height: 2000px;
}

.accordion__content {
    padding: 0 0 var(--space-lg);
    color: var(--text-muted);
    font-size: var(--fs-sm);
    line-height: 1.7;
}

/* ── Quantity Selector ── */
.qty-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.qty-selector__btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    color: var(--text-light);
    font-size: var(--fs-lg);
    transition: background var(--duration-fast), color var(--duration-fast);
}

.qty-selector__btn:hover {
    background: var(--primary);
    color: #fff;
}

.qty-selector__input {
    width: 50px;
    height: 40px;
    text-align: center;
    background: var(--bg-card-dark);
    border: none;
    border-left: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
    color: var(--text-light);
    font-weight: var(--fw-bold);
    font-size: var(--fs-base);
}

.qty-selector__input::-webkit-inner-spin-button,
.qty-selector__input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

/* ── Tag / Chip ── */
.tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 6px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    font-size: var(--fs-sm);
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.tag:hover,
.tag.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── Review Card ── */
.review-card {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
}

.review-card__header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.review-card__avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--fw-bold);
    color: var(--primary);
    font-size: var(--fs-sm);
}

.review-card__author {
    font-weight: var(--fw-semibold);
    font-size: var(--fs-sm);
}

.review-card__date {
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

.review-card__text {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    line-height: 1.6;
}

/* ── Countdown Timer ── */
.countdown {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
}

.countdown__block {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    min-width: 60px;
}

.countdown__number {
    font-family: var(--font-heading);
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    color: var(--accent-gold);
}

.countdown__label {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ── Stock Status ── */
.stock-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
}

.stock-status--available {
    color: var(--success);
}

.stock-status--low {
    color: var(--warning);
}

.stock-status--unavailable {
    color: var(--danger);
}

.stock-status__dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: currentColor;
    animation: pulse 2s infinite;
}

/* ── Pagination ── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-2xl);
}

.pagination__btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    transition: all var(--duration-fast);
}

.pagination__btn:hover,
.pagination__btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: var(--space-4xl) var(--space-xl);
}

.empty-state__icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

.empty-state__title {
    font-family: var(--font-heading);
    font-size: var(--fs-xl);
    margin-bottom: var(--space-sm);
}

.empty-state__text {
    color: var(--text-muted);
    font-size: var(--fs-sm);
    margin-bottom: var(--space-xl);
}

/* ── Sidebar Filters ── */
.sidebar-filter {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

.sidebar-filter__group {
    margin-bottom: var(--space-xl);
}

.sidebar-filter__title {
    font-family: var(--font-heading);
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-light);
}

.sidebar-filter__option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
    font-size: var(--fs-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--duration-fast);
}

.sidebar-filter__option:hover {
    color: var(--primary);
}

.sidebar-filter__checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-sm);
    position: relative;
    transition: all var(--duration-fast);
    flex-shrink: 0;
}

.sidebar-filter__checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.sidebar-filter__checkbox.checked::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
}

/* ── Price Range Slider ── */
.price-range {
    padding: var(--space-md) 0;
}

.price-range__track {
    position: relative;
    height: 4px;
    background: var(--bg-card-dark);
    border-radius: var(--radius-full);
    margin: var(--space-md) 0;
}

.price-range__fill {
    position: absolute;
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
}

.price-range__values {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

/* ── Newsletter Section ── */
.newsletter {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter__title {
    font-family: var(--font-heading);
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
}

.newsletter__subtitle {
    color: var(--text-muted);
    font-size: var(--fs-sm);
    margin-bottom: var(--space-lg);
}

/* ── Blog Carousel ── */
.blog-carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.blog-carousel__track {
    display: flex;
    gap: var(--space-lg);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: var(--space-sm) 0;
}

.blog-carousel__track::-webkit-scrollbar {
    display: none;
}

.blog-carousel__card {
    flex: 0 0 calc(33.333% - var(--space-lg) * 2 / 3);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    min-width: 0;
}

.blog-carousel__btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card-dark);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--duration-fast);
    z-index: 2;
}

.blog-carousel__btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

@media (max-width: 768px) {
    .blog-carousel__card {
        flex: 0 0 85%;
    }

    .blog-carousel__btn {
        width: 32px;
        height: 32px;
    }

    /* Mobile badge proportions */
    .badge {
        padding: 2px 6px;
        font-size: 10px;
    }

    .badge--discount {
        padding: 2px 8px;
        font-size: 11px;
    }

    .product-card__badges {
        top: var(--space-xs);
        left: var(--space-xs);
        gap: 2px;
    }

    .product-card__quick-add {
        transform: translateY(0);
        padding: var(--space-xs);
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    }

    .quick-add__full {
        display: none !important;
    }

    .quick-add__icon {
        display: inline-flex;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .blog-carousel__card {
        flex: 0 0 calc(50% - var(--space-lg) / 2);
    }
}