/* ========================================
   BG Makes & Acessórios - Modern UI
   Última Geração - 2025/2026
   ======================================== */

/* === ANIMAÇÕES DE LOADING === */

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.3);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.3);
    }

    70% {
        transform: scale(1);
    }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* === ANIMAÇÕES DE CARRINHO E FAVORITOS === */

@keyframes cartBounce {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.3);
    }

    50% {
        transform: scale(0.9);
    }

    75% {
        transform: scale(1.15);
    }
}

@keyframes cartPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4) rotate(-5deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

@keyframes heartPop {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.4);
    }

    50% {
        transform: scale(0.9);
    }

    75% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes flyToCart {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--fly-x, 100px), var(--fly-y, -200px)) scale(0.3);
    }
}

@keyframes successPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 25, 66, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(74, 25, 66, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(74, 25, 66, 0);
    }
}

/* Classes de animação */
.animate-cart-bounce {
    animation: cartBounce 0.6s ease-in-out;
}

.animate-cart-pop {
    animation: cartPop 0.4s ease-out;
}

.animate-heart-pop {
    animation: heartPop 0.5s ease-out;
}

.animate-heart-beat {
    animation: heartBeat 0.8s ease-in-out;
}

.animate-success-pulse {
    animation: successPulse 0.6s ease-out;
}

/* Partícula de voo para o carrinho */
.fly-particle {
    position: fixed;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 50%;
    z-index: 10000;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(74, 25, 66, 0.4);
    animation: flyToCart 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Explosão de corações para favoritos */
.heart-burst {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
}

.heart-burst span {
    position: absolute;
    font-size: 20px;
    animation: burstOut 0.8s ease-out forwards;
}

@keyframes burstOut {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0.5);
    }

    100% {
        opacity: 0;
        transform: translate(var(--burst-x, 0), var(--burst-y, 0)) scale(1.2);
    }
}

/* === SKELETON LOADING === */

.skeleton {
    background: linear-gradient(90deg,
            var(--color-border-light) 25%,
            var(--color-surface) 50%,
            var(--color-border-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 1;
}

.skeleton-card {
    padding: var(--space-4);
}

/* === HEADER MODERNO === */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-fixed);
    background: transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: var(--space-4) 0;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    padding: var(--space-2) 0;
}

.header.scrolled .header__logo-img {
    height: 55px;
}

.header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.header__logo-img {
    height: 100px;
    width: auto;
    transition: height 0.3s ease, transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
    transform: scale(1.25);
    transform-origin: left center;
}

/* === MENU HAMBURGER === */

.header__menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: calc(var(--z-modal) + 1);
    gap: 6px;
}

.header__menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text-primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header__menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.header__menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.header__menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* === NAVEGAÇÃO MOBILE === */

.header__nav {
    display: none;
}

.header__nav--mobile {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 320px;
    height: calc(100vh - 80px);
    height: calc(100dvh - 80px);
    background: var(--color-surface);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    padding: 100px var(--space-6) var(--space-6);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: var(--z-modal);
    overflow-y: auto;
}

.header__nav--mobile.open {
    transform: translateX(0);
}

.header__nav--mobile .header__nav-link {
    display: block;
    padding: var(--space-4) 0;
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border-light);
    transition: all 0.2s ease;
}

.header__nav--mobile .header__nav-link:hover,
.header__nav--mobile .header__nav-link.active {
    color: var(--color-primary);
    padding-left: var(--space-2);
}

/* Overlay do menu */
.header__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 80px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: calc(var(--z-modal) - 1);
}

@media (min-width: 768px) {
    .header__overlay {
        bottom: 0;
    }
}

.header__overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* === DESKTOP NAVIGATION === */

@media (min-width: 768px) {
    .header__menu-toggle {
        display: none;
    }

    .header__nav {
        display: flex;
        gap: var(--space-6);
    }

    .header__nav-link {
        position: relative;
        font-weight: var(--font-medium);
        color: var(--color-text-secondary);
        transition: color 0.2s ease;
        padding: var(--space-2) 0;
    }

    .header__nav-link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 2px;
        background: linear-gradient(90deg, var(--color-primary), var(--color-accent-gold));
        transition: width 0.3s ease;
        border-radius: 2px;
    }

    .header__nav-link:hover,
    .header__nav-link.active {
        color: var(--color-primary);
    }

    .header__nav-link:hover::after,
    .header__nav-link.active::after {
        width: 100%;
    }
}

/* === MINI-CART DRAWER === */

.mini-cart {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: var(--color-surface);
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: var(--z-modal);
    display: flex;
    flex-direction: column;
}

.mini-cart.open {
    transform: translateX(0);
}

.mini-cart__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.mini-cart__title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--color-secondary);
}

.mini-cart__close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

.mini-cart__close:hover {
    background: var(--color-background);
}

.mini-cart__items {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
}

.mini-cart__item {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--color-surface-elevated);
    margin-bottom: var(--space-3);
    animation: fadeInUp 0.3s ease;
}

.mini-cart__item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.mini-cart__item-info {
    flex: 1;
}

.mini-cart__item-name {
    font-weight: var(--font-medium);
    margin-bottom: var(--space-1);
}

.mini-cart__item-variation {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.mini-cart__item-price {
    font-weight: var(--font-bold);
    color: var(--color-secondary);
}

.mini-cart__item-remove {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: center;
}

.mini-cart__item-remove:hover {
    background: var(--color-error);
    color: white;
    transform: scale(1.1);
}

.mini-cart__footer {
    padding: var(--space-6);
    border-top: 1px solid var(--color-border);
    background: var(--color-background);
}

.mini-cart__subtotal {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    font-size: var(--text-lg);
}

.mini-cart__subtotal-value {
    font-weight: var(--font-bold);
    color: var(--color-secondary);
}

.mini-cart__checkout-btn {
    width: 100%;
}

/* === CARDS DE PRODUTO MODERNOS === */

.product-card {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(74, 25, 66, 0.12);
}

.product-card__image-wrapper {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--color-background);
}

/* Fix: Quando .product-card__image é uma div (não img), usar aspect-ratio */
.product-card__image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--color-background);
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Quick actions overlay */
.product-card__actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-4);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.product-card:hover .product-card__actions {
    opacity: 1;
    transform: translateY(0);
    /* Keep pointer-events: none on container, enable on buttons */
}

/* Enable pointer-events only on the buttons, not the container */
.product-card__actions .product-card__action-btn {
    pointer-events: auto;
}

.product-card__action-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-card__action-btn:hover {
    background: var(--color-primary);
    color: white;
    transform: scale(1.1);
}

/* Badge promoção */
.product-card__badge {
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
    padding: var(--space-1) var(--space-3);
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    border-radius: var(--radius-full);
    letter-spacing: 0.05em;
}

/* Favorito */
.product-card__favorite {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.product-card__favorite:hover {
    background: white;
    transform: scale(1.1);
}

.product-card__favorite.active svg {
    fill: #FF6B6B;
    stroke: #FF6B6B;
    animation: heartBeat 0.8s ease;
}

.product-card__info {
    padding: var(--space-4);
}

.product-card__category {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-1);
}

.product-card__name {
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-2);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.product-card__price {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--color-secondary);
}

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

/* Swatches de variação */
.product-card__swatches {
    display: flex;
    gap: var(--space-1);
    margin-top: var(--space-2);
}

.product-card__swatch {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--color-border);
}

/* === BOTÕES MODERNOS COM RIPPLE === */

.btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    font-weight: var(--font-semibold);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-full);
    box-shadow: 0 4px 20px rgba(212, 165, 116, 0.35);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(212, 165, 116, 0.45);
}

.btn-secondary {
    background: var(--color-secondary);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-primary);
}

.btn-ghost:hover {
    background: var(--color-background);
}

/* === BOTTOM NAVIGATION (MOBILE) === */

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-surface);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: var(--z-fixed);
    padding: var(--space-2) 0 env(safe-area-inset-bottom, var(--space-2));
}

.bottom-nav__container {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-2);
    color: var(--color-text-muted);
    transition: color 0.2s ease;
    text-decoration: none;
    position: relative;
}

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

.bottom-nav__icon {
    width: 24px;
    height: 24px;
    margin-bottom: var(--space-1);
}

.bottom-nav__label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

.bottom-nav__badge {
    position: absolute;
    top: 0;
    right: 50%;
    transform: translateX(100%);
    width: 18px;
    height: 18px;
    background: var(--color-error);
    color: white;
    font-size: 10px;
    font-weight: var(--font-bold);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 767px) {
    .bottom-nav {
        display: block;
    }

    /* Ajuste de padding do body para bottom nav */
    body {
        padding-bottom: 80px;
    }
}

/* === QUICK VIEW MODAL === */

.quick-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.quick-view.open {
    opacity: 1;
    visibility: visible;
}

.quick-view__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

.quick-view__content {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-2xl);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-view.open .quick-view__content {
    transform: scale(1) translateY(0);
}

.quick-view__close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--color-background);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
}

.quick-view__close:hover {
    background: var(--color-border);
}

.quick-view__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    padding: var(--space-6);
}

@media (min-width: 768px) {
    .quick-view__grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* === RESPONSIVIDADE APRIMORADA === */

/* Container fluid */
.container {
    width: 100%;
    max-width: var(--container-2xl);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (min-width: 640px) {
    .container {
        padding: 0 var(--space-6);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 var(--space-8);
    }
}

/* Grid responsivo de produtos */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5);
    }
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-6);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Hero responsivo */
.hero {
    min-height: 100vh;
    min-height: 100svh;
    /* Safari fix */
    padding-top: calc(var(--header-height) + var(--space-8));
}

@media (max-width: 767px) {
    .hero {
        padding-top: calc(var(--header-height-mobile) + var(--space-4));
    }

    .hero__title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .hero__subtitle {
        font-size: var(--text-base);
    }
}

/* Section responsiva */
.section {
    padding: var(--space-12) 0;
}

@media (min-width: 768px) {
    .section {
        padding: var(--space-16) 0;
    }
}

@media (min-width: 1024px) {
    .section {
        padding: var(--space-20) 0;
    }
}

/* Tipografia fluid */
.section-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
}

/* Hide on mobile/desktop */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

/* === TOAST NOTIFICATIONS === */

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: var(--space-4) var(--space-6);
    background: var(--color-secondary);
    color: white;
    border-radius: var(--radius-xl);
    font-weight: var(--font-medium);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: var(--z-toast);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.toast.error {
    background: linear-gradient(135deg, #F44336, #d32f2f);
}

.toast.warning {
    background: linear-gradient(135deg, #FF9800, #f57c00);
}

@media (max-width: 767px) {
    .toast {
        bottom: 90px;
        left: var(--space-4);
        right: var(--space-4);
        transform: translateX(0) translateY(100px);
    }

    .toast.show {
        transform: translateX(0) translateY(0);
    }
}

/* === GLASSMORPHISM EFFECTS === */

.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(74, 25, 66, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* === SCROLL PROGRESS === */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent-gold));
    z-index: calc(var(--z-fixed) + 1);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.1s linear;
}

/* === LAZY LOAD IMAGES === */

img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[data-src].loaded {
    opacity: 1;
}

/* === SMOOTH PAGE TRANSITIONS === */

.page-transition {
    animation: fadeInUp 0.5s ease;
}

/* === ACCESSIBILITY === */

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    padding: var(--space-3) var(--space-4);
    background: var(--color-primary);
    color: white;
    z-index: var(--z-toast);
}

.skip-link:focus {
    top: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ========================================
   MOBILE-FIRST RESPONSIVENESS FIXES
   ======================================== */

/* === MOBILE TYPOGRAPHY SCALING === */
@media (max-width: 480px) {

    /* Hero título menor em mobile pequeno */
    .hero__title {
        font-size: clamp(1.5rem, 7vw, 2.5rem) !important;
        line-height: 1.2;
    }

    .hero__subtitle {
        font-size: 0.875rem;
        margin-bottom: var(--space-4);
    }

    /* Botões compactos */
    .hero__actions {
        flex-direction: column;
        gap: var(--space-3);
    }

    .hero__actions .btn {
        width: 100%;
        padding: var(--space-3) var(--space-4);
        font-size: 0.875rem;
    }

    /* Badge menor */
    .hero__badge {
        font-size: 0.75rem;
        padding: var(--space-1) var(--space-3);
        margin-bottom: var(--space-3);
    }

    /* Seções com menos padding */
    .section {
        padding: var(--space-8) 0;
    }

    .section-title {
        font-size: 1.25rem;
        margin-bottom: var(--space-4);
    }
}

@media (max-width: 767px) {

    /* Hero ajustado para mobile */
    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + var(--space-6)) 0 var(--space-8);
    }

    .hero__container {
        gap: var(--space-4);
    }

    .hero__content {
        padding: 0 var(--space-2);
    }

    /* Botões menores */
    .btn {
        font-size: 0.875rem;
        padding: var(--space-2) var(--space-4);
    }

    .btn-lg {
        padding: var(--space-3) var(--space-5);
    }

    /* IMPORTANTE: btn-icon não deve ter padding para não comprimir os ícones */
    .btn-icon {
        padding: 0;
    }

    /* Cards de categoria menores */
    .category-card {
        min-height: 120px;
    }

    .category-card__title {
        font-size: 0.875rem;
    }

    /* Section title */
    .section__header {
        margin-bottom: var(--space-4);
    }
}

/* === WHATSAPP BUTTON FIX === */
@media (max-width: 767px) {

    /* Reposicionar WhatsApp para não sobrepor bottom-nav */
    .whatsapp-float {
        bottom: 90px !important;
        right: 16px !important;
        width: 52px !important;
        height: 52px !important;
    }
}

/* === FILTER SIDEBAR MOBILE === */
@media (max-width: 1023px) {
    .filters {
        margin-bottom: var(--space-6);
    }

    .filters__section {
        padding-bottom: var(--space-4);
        margin-bottom: var(--space-4);
    }

    .filters__title {
        font-size: 0.75rem;
    }
}

/* === PRODUCT CARDS MOBILE === */
@media (max-width: 480px) {
    .product-card__info {
        padding: var(--space-2) var(--space-3);
    }

    .product-card__name {
        font-size: 0.8rem;
        margin-bottom: var(--space-1);
    }

    .product-card__price {
        font-size: 0.875rem;
    }

    .product-card__category {
        font-size: 0.65rem;
    }

    /* Badge de promoção menor */
    .product-card__badge {
        font-size: 0.6rem;
        padding: 2px 6px;
    }
}

/* === CART PAGE MOBILE === */
@media (max-width: 480px) {
    .cart-items {
        gap: var(--space-3);
    }

    .cart-summary {
        padding: var(--space-4);
    }

    .cart-summary__title {
        font-size: 1rem;
    }
}

/* === HEADER MOBILE IMPROVEMENTS === */
@media (max-width: 480px) {
    .header__container {
        padding: var(--space-2) var(--space-3);
    }

    .header__logo-img {
        height: 80px;
    }

    .header__actions {
        gap: var(--space-1);
    }

    .header__actions .btn-icon {
        width: 36px;
        height: 36px;
    }
}

/* ========================================
   MOBILE FILTER DRAWER
   ======================================== */

/* Botão flutuante de filtros (só mobile) */
.filter-fab {
    display: none;
    /* Escondido em desktop */
    position: fixed;
    bottom: 90px;
    /* Acima do bottom-nav */
    left: 16px;
    z-index: calc(var(--z-fixed) + 1);
    /* 301 - acima do bottom-nav (300) mas abaixo do menu mobile (500) */
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.filter-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.filter-fab svg {
    width: 24px;
    height: 24px;
}

/* Mostrar FAB apenas em mobile */
@media (max-width: 1023px) {
    .filter-fab {
        display: flex;
    }
}

/* Overlay para fechar filtros */
.filters-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s;
}

.filters-overlay.active {
    display: block;
    opacity: 1;
}

/* Drawer de filtros mobile */
@media (max-width: 1023px) {
    .filters {
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        z-index: 1002;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        padding-top: var(--space-6);
        padding-bottom: 100px;
        border-radius: 0;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    }

    .filters.open {
        transform: translateX(0);
    }

    /* Header do drawer com botão fechar */
    .filters__drawer-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: var(--space-4) var(--space-6);
        border-bottom: 1px solid var(--color-border-light);
        margin-bottom: var(--space-4);
    }

    .filters__drawer-title {
        font-size: 1.125rem;
        font-weight: 600;
        color: var(--color-secondary);
    }

    .filters__drawer-close {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--color-background);
        border: none;
        border-radius: 50%;
        cursor: pointer;
    }
}

/* Em desktop, esconder elementos do drawer */
@media (min-width: 1024px) {
    .filters__drawer-header {
        display: none;
    }
}