/* ===== VIEWER BASE STYLES ===== */
/* Shared across all catalog display styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.catalog-body {
    font-family: var(--body-font);
    color: var(--section-text);
    background: var(--section-bg);
    overflow-x: hidden;
}

/* Brand watermark */
.catalog-brand {
    position: fixed;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    border-radius: 0 0 14px 0;
    transition: opacity 0.3s;
}

.catalog-brand--top-left {
    top: 0;
    left: 0;
    border-radius: 0 0 14px 0;
}

.catalog-brand--top-center {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0 0 14px 14px;
}

.catalog-brand--top-right {
    top: 0;
    right: 0;
    border-radius: 0 0 0 14px;
}

.brand-logo {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}

.brand-name {
    font-family: var(--heading-font);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

/* ===== COVER PAGES ===== */
.cover-page {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-color: var(--cover-bg);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}

.cover-logo {
    max-width: var(--cover-logo-size, 150px);
    max-height: var(--cover-logo-size, 150px);
    width: auto;
    height: auto;
    margin-bottom: 30px;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
    animation: fadeInDown 1s ease;
    object-fit: contain;
}

/* Logo frame (moldura) */
.cover-logo.has-frame,
.grid-hero-logo.has-frame,
.elegant-hero-logo.has-frame {
    background: var(--logo-frame-bg, rgba(255, 255, 255, 0.15));
    padding: var(--logo-frame-padding, 20px);
    border-radius: var(--logo-frame-radius, 20px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    filter: none;
}

.cover-title {
    font-family: var(--heading-font);
    font-size: clamp(28px, 6vw, 60px);
    font-weight: 900;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 16px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6), 0 4px 40px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease 0.2s both;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.cover-subtitle {
    font-size: clamp(14px, 2.5vw, 20px);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    max-width: 90%;
    animation: fadeInUp 1s ease 0.4s both;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
}

.cover-company {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 30px;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: fadeInUp 1s ease 0.6s both;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

/* ===== ARTICLE PAGES ===== */
.article-page {
    min-height: 100%;
    padding: 0;
}

.article-title {
    font-family: var(--heading-font);
    font-size: clamp(20px, 4vw, 32px);
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.25;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-content {
    font-size: 15px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-content h2 {
    font-family: var(--heading-font);
    font-size: 22px;
    margin: 20px 0 10px;
}

.article-content h3 {
    font-family: var(--heading-font);
    font-size: 18px;
    margin: 16px 0 8px;
}

.article-content p {
    margin-bottom: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-content ul,
.article-content ol {
    padding-left: 20px;
    margin-bottom: 12px;
}

.article-image-full {
    width: 100%;
    max-height: 50vh;
    overflow: hidden;
}

.article-image-full img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-text-area {
    padding: 30px 24px;
}

.article-bg-image {
    min-height: 100%;
    background-size: cover;
    background-position: center;
}

.article-bg-overlay {
    min-height: 100vh;
    padding: 50px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.article-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100%;
}

.article-split-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-split-text {
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.article-split-left {
    direction: ltr;
}

.article-split-right .article-split-image {
    order: 2;
}

/* ===== CATALOG / PRODUCT PAGES ===== */
.catalog-page {
    padding: var(--section-pad);
    min-height: 100%;
    position: relative;
}

/* Semi-transparent backdrop behind catalog content for readability */
.catalog-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
}

.catalog-page>* {
    position: relative;
    z-index: 1;
}

.catalog-section-title {
    font-family: var(--heading-font);
    font-size: clamp(22px, 4vw, 36px);
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: #fff;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.catalog-section-subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
    font-size: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

/* ===== GRID FORMAT (Cards com foto) ===== */
.products-grid {
    display: grid;
    grid-template-columns: var(--product-cols);
    gap: 20px;
}

.product-card {
    background: var(--product-bg, rgba(0, 0, 0, 0.55));
    border: 1px solid var(--product-border, rgba(255, 255, 255, 0.12));
    border-radius: var(--card-radius);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.product-image {
    width: 100%;
    height: var(--product-img-h);
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-info {
    padding: 16px;
}

.product-category {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.product-name {
    font-family: var(--heading-font);
    font-size: 16px;
    font-weight: 600;
    margin: 6px 0 8px;
    color: var(--product-name-color, #fff);
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.product-desc {
    font-size: 13px;
    color: var(--product-desc-color, rgba(255, 255, 255, 0.75));
    line-height: 1.5;
    margin-bottom: 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-details {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--product-details-color, rgba(255, 255, 255, 0.6));
    margin-bottom: 10px;
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--price-color, var(--accent));
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* ===== LIST FORMAT ===== */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.products-list.products-list-2col .list-items-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.products-list .list-category-group {
    margin-bottom: 20px;
}

.products-list .list-category-title {
    font-family: var(--heading-font);
    font-size: 18px;
    font-weight: 700;
    color: var(--category-title-color, #fff);
    padding: 12px 16px;
    background: var(--category-bg, rgba(0, 0, 0, 0.6));
    backdrop-filter: blur(10px);
    border-radius: 10px;
    margin-bottom: 8px;
    border-left: 4px solid var(--accent);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.products-list .list-product-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px 14px;
    background: var(--list-row-bg, rgba(0, 0, 0, 0.5));
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 4px;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.products-list .list-product-row:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: translateX(4px);
}

.products-list .list-product-img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.products-list .list-product-info h4 {
    font-family: var(--heading-font);
    font-size: 15px;
    font-weight: 600;
    color: var(--product-name-color, #fff);
    margin-bottom: 3px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.products-list .list-product-info p {
    font-size: 13px;
    color: var(--product-desc-color, rgba(255, 255, 255, 0.75));
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.products-list .list-product-info .list-meta {
    font-size: 12px;
    color: var(--product-details-color, rgba(255, 255, 255, 0.6));
    margin-top: 3px;
}

.products-list .list-product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--price-color, var(--accent));
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* ===== COMPACT FORMAT ===== */
.products-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.compact-card {
    background: var(--product-bg, rgba(0, 0, 0, 0.55));
    border: 1px solid var(--product-border, rgba(255, 255, 255, 0.12));
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.compact-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.compact-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.compact-card .compact-info {
    padding: 10px;
}

.compact-card .compact-info h4 {
    font-family: var(--heading-font);
    font-size: 13px;
    font-weight: 600;
    color: var(--product-name-color, #fff);
    margin-bottom: 4px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.compact-card .compact-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--price-color, var(--accent));
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.compact-card .compact-dosage {
    font-size: 11px;
    color: var(--product-details-color, rgba(255, 255, 255, 0.6));
    margin-bottom: 3px;
}

/* ===== SOCIAL LINKS (Back Cover) ===== */
.social-links-container {
    margin-top: 30px;
    text-align: center;
    animation: fadeInUp 1s ease 0.8s both;
}

.social-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.social-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.social-icon:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.social-instagram:hover {
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    border-color: transparent;
}

.social-tiktok:hover {
    background: #010101;
    border-color: #69C9D0;
    box-shadow: 0 0 15px rgba(105, 201, 208, 0.4);
}

.social-whatsapp:hover {
    background: #25D366;
    border-color: transparent;
}

.social-email:hover {
    background: #667eea;
    border-color: transparent;
}

.social-website:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .article-split {
        grid-template-columns: 1fr;
    }

    .article-split-right .article-split-image {
        order: 0;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .product-image {
        height: 120px;
    }

    .catalog-brand {
        padding: 8px 12px;
    }

    .brand-name {
        font-size: 12px;
    }

    .brand-logo {
        max-height: 28px;
    }

    .cover-title {
        font-size: clamp(22px, 6vw, 44px);
    }

    .product-name {
        font-size: 14px;
    }

    .products-list .list-product-row {
        padding: 10px 10px;
    }

    .products-list .list-product-price {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .products-list .list-product-row {
        grid-template-columns: 1fr auto;
    }

    .products-list .list-product-img {
        display: none;
    }
}