/**
 * Flavor Product Carousel - Styles v2.0
 * Com hover effects, action buttons, quick view e parcelamento
 */

/* ==========================================================================
   WRAPPER & CONTAINER
   ========================================================================== */

.flavor-carousel-wrapper {
    position: relative;
    width: 100%;
    padding: 0 50px;
    box-sizing: border-box;
}

.flavor-carousel {
    overflow: hidden;
}

/* ==========================================================================
   PRODUCT CARD
   ========================================================================== */

.flavor-product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.flavor-product-card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   PRODUCT IMAGE
   ========================================================================== */

.flavor-product-image {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f8f8f8;
    border-radius: 12px;
}

.flavor-image-link {
    display: block;
    width: 100%;
    position: relative;
}

.flavor-product-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: opacity 0.4s ease;
}

/* Segunda imagem - hover */
.flavor-secondary-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
}

.flavor-product-card:hover .flavor-primary-image {
    opacity: 0;
}

.flavor-product-card:hover .flavor-secondary-image {
    opacity: 1;
}

/* ==========================================================================
   ACTION BUTTONS (Wishlist, Compare, Quick View) - HIDDEN
   ========================================================================== */

.flavor-action-buttons {
    display: none !important;
}

/* ==========================================================================
   ADD TO CART HOVER BUTTON
   ========================================================================== */

.flavor-add-to-cart-hover {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 15px;
    background: linear-gradient(to top, rgba(255,255,255,1) 0%, rgba(255,255,255,0.95) 60%, rgba(255,255,255,0) 100%);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 5;
}

.flavor-product-card:hover .flavor-add-to-cart-hover {
    transform: translateY(0);
}

.flavor-add-cart-btn {
    display: block;
    width: 100%;
    padding: 15px 20px;
    background: #c58791;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: var(--gz-button-font-size, 14px);
    font-family: inherit;
    font-weight: 700;
    text-transform: none;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.flavor-add-cart-btn:hover {
    background: #b07680;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(197, 135, 145, 0.4);
}

.flavor-out-of-stock {
    display: block;
    text-align: center;
    padding: 15px 20px;
    background: #f0f0f0;
    color: #999;
    border-radius: 8px;
    font-size: var(--gz-button-font-size, 14px);
    font-weight: 600;
}

/* ==========================================================================
   BADGES
   ========================================================================== */

.flavor-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 6px;
    z-index: 2;
}

.flavor-badge-sale {
    background: #e74c3c;
    color: #fff;
}

.flavor-badge-featured {
    background: #f39c12;
    color: #fff;
}

.flavor-badge-soldout {
    background: #95a5a6;
    color: #fff;
}

/* ==========================================================================
   PRODUCT INFO
   ========================================================================== */

.flavor-product-info {
    padding: 18px 5px;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.flavor-product-title {
    margin: 0 0 10px 0;
    font-size: var(--gz-product-title-font-size, 17px);
    font-family: var(--gz-heading-font-family, inherit);
    font-weight: 500;
    line-height: 1.4;
}

.flavor-product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.flavor-product-title a:hover {
    color: #c58791;
}

/* ==========================================================================
   RATING
   ========================================================================== */

.flavor-product-rating {
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
}

.flavor-product-rating .star-rating {
    font-size: 12px;
    color: #f39c12;
}

/* ==========================================================================
   PRICE
   ========================================================================== */

.flavor-product-price {
    font-size: var(--gz-product-price-font-size, 20px);
    font-family: var(--gz-heading-font-family, inherit);
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.flavor-product-price del {
    color: #999;
    font-weight: 400;
    font-size: calc(var(--gz-product-price-font-size, 20px) - 4px);
    margin-right: 8px;
}

.flavor-product-price ins {
    text-decoration: none;
    color: #c58791;
}

/* ==========================================================================
   INSTALLMENTS / PARCELAMENTO
   ========================================================================== */

.flavor-product-installments {
    margin-top: 4px;
}

.flavor-installments {
    font-size: var(--gz-product-price-font-size, 14px);
    font-family: var(--gz-body-font-family, inherit);
    color: #888;
    font-weight: 400;
}

/* ==========================================================================
   SWIPER NAVIGATION
   ========================================================================== */

.flavor-carousel-wrapper .swiper-button-prev,
.flavor-carousel-wrapper .swiper-button-next {
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.flavor-carousel-wrapper .swiper-button-prev:after,
.flavor-carousel-wrapper .swiper-button-next:after {
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.flavor-carousel-wrapper .swiper-button-prev:hover,
.flavor-carousel-wrapper .swiper-button-next:hover {
    background: #333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.flavor-carousel-wrapper .swiper-button-prev:hover:after,
.flavor-carousel-wrapper .swiper-button-next:hover:after {
    color: #fff;
}

.flavor-carousel-wrapper .swiper-button-prev {
    left: 0;
}

.flavor-carousel-wrapper .swiper-button-next {
    right: 0;
}

.flavor-carousel-wrapper .swiper-button-disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ==========================================================================
   SWIPER PAGINATION
   ========================================================================== */

.flavor-carousel-wrapper .swiper-pagination {
    position: relative;
    margin-top: 25px;
}

.flavor-carousel-wrapper .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #ddd;
    opacity: 1;
    transition: all 0.3s ease;
}

.flavor-carousel-wrapper .swiper-pagination-bullet-active {
    background: #333;
    width: 28px;
    border-radius: 5px;
}

/* ==========================================================================
   TABBED CAROUSEL
   ========================================================================== */

.flavor-tabbed-carousel {
    width: 100%;
}

.flavor-carousel-title {
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 25px;
    color: #333;
}

.flavor-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 35px;
    flex-wrap: wrap;
}

.flavor-tab {
    padding: 12px 28px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.flavor-tab:hover {
    color: #333;
}

.flavor-tab.active {
    color: #333;
    border-bottom-color: #333;
}

.flavor-tab-panel {
    display: none;
}

.flavor-tab-panel.active {
    display: block;
}

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

.flavor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
}

.flavor-modal.active {
    display: block;
}

.flavor-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.flavor-modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
}

.flavor-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flavor-modal-close:hover {
    background: #333;
    color: #fff;
}

.flavor-modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

.flavor-modal-loading {
    padding: 80px;
    text-align: center;
}

.flavor-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Quick View Content */
.flavor-qv-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

.flavor-qv-gallery {
    position: relative;
}

.flavor-qv-main-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.flavor-qv-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.flavor-qv-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.flavor-qv-thumb:hover,
.flavor-qv-thumb.active {
    opacity: 1;
    border-color: #333;
}

.flavor-qv-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flavor-qv-info {
    padding: 10px 0;
}

.flavor-qv-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
}

.flavor-qv-price {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.flavor-qv-price del {
    color: #999;
    font-size: 16px;
    font-weight: 400;
}

.flavor-qv-price ins {
    text-decoration: none;
    color: #e74c3c;
}

.flavor-qv-installments {
    margin-bottom: 20px;
}

.flavor-qv-installments .flavor-installments {
    font-size: 14px;
}

.flavor-qv-description {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.flavor-qv-description p {
    margin: 0 0 10px 0;
}

/* Variations */
.flavor-qv-variations {
    margin-bottom: 25px;
}

.flavor-qv-variation {
    margin-bottom: 15px;
}

.flavor-qv-variation label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.flavor-qv-variation select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

/* Actions */
.flavor-qv-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.flavor-qv-quantity {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.flavor-qty-btn {
    width: 40px;
    height: 44px;
    border: none;
    background: #f5f5f5;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.flavor-qty-btn:hover {
    background: #e0e0e0;
}

.flavor-qty-input {
    width: 50px;
    height: 44px;
    border: none;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
}

.flavor-qty-input::-webkit-outer-spin-button,
.flavor-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.flavor-qv-add-to-cart {
    flex: 1;
    padding: 12px 25px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.flavor-qv-add-to-cart:hover {
    background: #e74c3c;
}

.flavor-qv-view-full {
    display: inline-block;
    color: #666;
    font-size: 13px;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.flavor-qv-view-full:hover {
    color: #333;
}

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

.flavor-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: #fff;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 999999;
    opacity: 0;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

.flavor-toast.success {
    background: #27ae60;
}

.flavor-toast.error {
    background: #e74c3c;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
    .flavor-carousel-wrapper {
        padding: 0 40px;
    }
}

@media (max-width: 768px) {
    .flavor-carousel-wrapper {
        padding: 0 35px;
    }
    
    .flavor-carousel-wrapper .swiper-button-prev,
    .flavor-carousel-wrapper .swiper-button-next {
        width: 38px;
        height: 38px;
    }
    
    .flavor-carousel-wrapper .swiper-button-prev:after,
    .flavor-carousel-wrapper .swiper-button-next:after {
        font-size: 14px;
    }
    
    .flavor-tabs {
        gap: 5px;
    }
    
    .flavor-tab {
        padding: 10px 18px;
        font-size: 13px;
    }
    
    .flavor-carousel-title {
        font-size: 22px;
    }
    
    /* Quick View Mobile */
    .flavor-qv-content {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .flavor-qv-title {
        font-size: 18px;
    }
    
    .flavor-qv-actions {
        flex-direction: column;
    }
    
    .flavor-qv-quantity {
        justify-content: center;
    }
    
    /* Always show add to cart on mobile */
    .flavor-add-to-cart-hover {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .flavor-carousel-wrapper {
        padding: 0 25px;
    }
    
    .flavor-product-info {
        padding: 12px 3px;
    }
    
    .flavor-product-title {
        font-size: 14px;
    }
    
    .flavor-product-price {
        font-size: 16px;
    }
    
    .flavor-installments {
        font-size: 12px;
    }
    
    .flavor-badge {
        padding: 4px 10px;
        font-size: 9px;
    }
    
    .flavor-add-cart-btn {
        padding: 12px 15px;
        font-size: 12px;
    }
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */

.flavor-carousel.loading .swiper-wrapper {
    opacity: 0.5;
}

/* ==========================================================================
   ADDING TO CART ANIMATION
   ========================================================================== */

.flavor-add-cart-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.flavor-add-cart-btn.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

/* ==========================================================================
   GRID MODE (Sem Carousel)
   ========================================================================== */

.flavor-grid {
    width: 100%;
}

.flavor-grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Grid responsivo */
@media (max-width: 1024px) {
    .flavor-grid-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .flavor-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .flavor-grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* Grid item */
.flavor-grid-item {
    width: 100%;
}

/* Ajuste para grid mode não ter padding lateral */
.flavor-carousel-wrapper:has(.flavor-grid) {
    padding: 0;
}
