/* ===== MAGAZINE FLIP STYLE ===== */
/* Simulates a real magazine page-by-page experience */

.catalog-magazine .catalog-brand {
    z-index: 1001;
}

.magazine-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    position: relative;
    overflow: hidden;
}

/* Ambient glow */
.magazine-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.08) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    pointer-events: none;
}

.magazine-container {
    width: 100%;
    max-width: 460px;
    height: 85vh;
    max-height: 750px;
    position: relative;
    perspective: 1200px;
    margin: 30px auto;
}

.magazine-page {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    background: var(--section-bg);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s ease;
    backface-visibility: hidden;
    overflow-y: auto;
}

.magazine-page::-webkit-scrollbar {
    width: 4px;
}

.magazine-page::-webkit-scrollbar-track {
    background: transparent;
}

.magazine-page::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

/* Page states */
.magazine-page.page-hidden-left {
    transform: translateX(-120%) rotateY(30deg) scale(0.85);
    opacity: 0;
    pointer-events: none;
}

.magazine-page.page-active {
    transform: translateX(0) rotateY(0) scale(1);
    opacity: 1;
    z-index: 10;
}

.magazine-page.page-hidden-right {
    transform: translateX(120%) rotateY(-30deg) scale(0.85);
    opacity: 0;
    pointer-events: none;
}

/* Page edge effect */
.magazine-page.page-active::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.15), transparent);
    pointer-events: none;
}

/* Cover inside magazine */
.magazine-page .cover-page {
    min-height: 100%;
    border-radius: 12px;
}

/* Article inside magazine */
.magazine-page .article-page {
    border-radius: 12px;
}

.magazine-page .article-image-full {
    max-height: 40%;
}

.magazine-page .article-text-area {
    padding: 20px;
}

/* Catalog inside magazine */
.magazine-page .catalog-page {
    padding: 20px;
}

.magazine-page .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.magazine-page .product-image {
    height: 120px;
}

.magazine-page .product-info {
    padding: 10px;
}

.magazine-page .product-name {
    font-size: 14px;
}

.magazine-page .product-price {
    font-size: 16px;
}

/* Navigation */
.magazine-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 30px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mag-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mag-nav-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

.mag-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.mag-nav-btn:disabled:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: none;
}

.mag-page-info {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

/* Swipe indicator */
.magazine-page.page-active .cover-overlay::after {
    content: '← Deslize para navegar →';
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
    animation: pulse 2s ease infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.7;
    }
}

/* Desktop: widen */
@media (min-width: 769px) {
    .magazine-container {
        max-width: 520px;
        max-height: 800px;
    }
}

/* Large desktop: book spread */
@media (min-width: 1200px) {
    .magazine-container {
        max-width: 560px;
        height: 88vh;
        max-height: 880px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .magazine-container {
        max-width: 100%;
        height: 80vh;
        margin: 10px;
        border-radius: 16px;
    }

    .magazine-page {
        border-radius: 16px;
    }

    .magazine-nav {
        bottom: 16px;
        padding: 12px 20px;
        gap: 14px;
    }

    .mag-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .magazine-page .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .magazine-page .product-image {
        height: 90px;
    }

    .magazine-page .product-name {
        font-size: 12px;
    }

    .magazine-page .product-price {
        font-size: 14px;
    }
}

@media (max-width: 400px) {
    .magazine-page .products-grid {
        grid-template-columns: 1fr;
    }
}