/* File Location: /buyer/catalog.css
   Shared styles for catalog-generate.php, download-brand-pdf.php, download-category-pdf.php
   All classes are prefixed "cg-" so they never clash with the site's own header/footer CSS. */

.cg-wrap, .cg-wrap * { box-sizing: border-box; }
.cg-wrap {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #2D3748;
    background-color: #EAEDF0;
    padding: 28px;
    position: relative;
    overflow: hidden;
}

/* ================= WATERMARK ================= */
.cg-watermark {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    gap: 90px;
    transform: rotate(-28deg) scale(1.4);
    pointer-events: none;
    opacity: 0.05;
    overflow: hidden;
}
.cg-watermark img { width: 170px; height: auto; filter: grayscale(100%); }

.cg-container { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; }

/* ================= SCREEN-ONLY BANNER (back + print) ================= */
.cg-banner {
    background: #ffffff;
    padding: 14px 22px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    border-left: 5px solid #24A6AB;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.cg-banner-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cg-banner span { font-size: 13.5px; color: #4A5568; font-weight: 500; }
.cg-btn, .cg-back {
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}
.cg-btn { background: #24A6AB; color: #fff; }
.cg-btn:hover { background: #1d888c; }
.cg-back { background: #EDF2F7; color: #2D3748; }
.cg-back:hover { background: #E2E8F0; }

/* ================= TOP ACCENT BAR ================= */
.cg-accent {
    height: 6px;
    width: 100%;
    border-radius: 6px;
    margin-bottom: 18px;
    background: linear-gradient(90deg, #24A6AB 0%, #1d888c 50%, #FF5722 100%);
}

/* ================= HEADER ================= */
.cg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background: #ffffff;
    border-radius: 14px;
    padding: 22px 28px;
    margin-bottom: 22px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
    border: 1px solid #EDF2F7;
}
.cg-company { display: flex; align-items: center; gap: 14px; }
.cg-company img { height: 48px; width: auto; object-fit: contain; }
.cg-company h1 { font-size: 18px; font-weight: 800; color: #1A202C; margin: 0; letter-spacing: 0.2px; }
.cg-company p { font-size: 11.5px; color: #718096; margin: 3px 0 0 0; font-weight: 500; }

.cg-title { text-align: right; max-width: 60%; }
.cg-label {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #24A6AB;
    background: #E6F7F8;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}
.cg-title h2 {
    font-size: 26px;
    font-weight: 900;
    color: #1A202C;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    word-wrap: break-word;
}
.cg-title h2.cg-title-normal { font-size: 24px; text-transform: none; letter-spacing: 0.2px; }
.cg-title p { font-size: 11.5px; color: #A0AEC0; margin: 6px 0 0 0; font-weight: 600; }

/* ================= INFO STRIP ================= */
.cg-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    background: #1A202C;
    color: #fff;
    border-radius: 10px;
    padding: 12px 22px;
    margin-bottom: 24px;
    font-size: 12.5px;
    row-gap: 6px;
}
.cg-item { display: flex; align-items: center; gap: 8px; font-weight: 500; color: #CBD5E0; }
.cg-item b { color: #ffffff; font-weight: 700; }
.cg-dot { color: #4A5568; }

/* ================= SECTION HEADING ================= */
.cg-section {
    font-size: 15px;
    font-weight: 800;
    color: #1A202C;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-left: 4px solid #24A6AB;
    padding-left: 10px;
    margin: 0 0 14px 0;
}

/* ================= PRICE HERO (single product) ================= */
.cg-hero {
    background: #ffffff;
    border: 1px solid #E9EDF2;
    border-radius: 12px;
    padding: 18px 22px;
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    overflow: hidden;
    margin-bottom: 24px;
}
.cg-hero .cg-current { font-size: 26px; }
.cg-hero .cg-original { font-size: 14px; }
.cg-hero-badge {
    background-color: #FF5722;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(255,87,34,0.25);
    text-transform: uppercase;
}

/* ================= GRID + CARDS ================= */
.cg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cg-grid.cg-gallery { margin-bottom: 28px; }

.cg-card {
    background: #ffffff;
    border: 1px solid #E9EDF2;
    border-radius: 12px;
    padding: 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    page-break-inside: avoid;
    break-inside: avoid;
    overflow: hidden;
}
.cg-gallery .cg-card { justify-content: center; }

/* top gradient line shared by cards, hero and description */
.cg-card::before, .cg-hero::before, .cg-desc::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #24A6AB, #1d888c);
}

.cg-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: #FF5722;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: 6px;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(255,87,34,0.25);
}

.cg-img {
    width: 100%;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
    background: #FAFBFC;
    border-radius: 8px;
    border: 1px solid #F1F4F7;
}
.cg-gallery .cg-img { height: 150px; margin-bottom: 0; }
.cg-img img { max-width: 90%; max-height: 90%; object-fit: contain; }

.cg-name {
    font-size: 12.5px;
    color: #3D4A5C;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 10px;
    height: 34px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cg-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    border-top: 1px dashed #EDF2F7;
    padding-top: 9px;
}
.cg-current { font-size: 15.5px; font-weight: 800; color: #1d888c; }
.cg-original { color: #A0AEC0; text-decoration: line-through; font-size: 11.5px; }

.cg-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #718096;
    padding: 50px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #EDF2F7;
}

/* ================= DESCRIPTION (single product) ================= */
.cg-desc {
    background: #ffffff;
    border: 1px solid #E9EDF2;
    border-radius: 12px;
    padding: 22px 26px;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    overflow: hidden;
    margin-bottom: 24px;
}
.cg-desc-content { font-size: 13.5px; line-height: 1.75; color: #4A5568; }
.cg-desc-content table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.cg-desc-content table td, .cg-desc-content table th { border: 1px solid #E2E8F0; padding: 8px; font-size: 12.5px; }
.cg-desc-content img { max-width: 280px; height: auto; border-radius: 6px; }

/* ================= CATALOG FOOTER ================= */
.cg-footer {
    margin-top: 34px;
    border-top: 2px solid #E2E8F0;
    padding-top: 16px;
    font-size: 11px;
    color: #718096;
    text-align: center;
    line-height: 1.7;
}
.cg-footer p { margin: 0 0 4px 0; }
.cg-footer strong { color: #4A5568; }

/* ================= PRINT ================= */
@media print {
    /* Print only the catalog: hide back/print banner and the site's own header/footer */
    .no-print,
    body > header, body > footer, body > nav,
    #site-header, #site-footer, .site-header, .site-footer {
        display: none !important;
    }
    .cg-wrap { padding: 0; background: #ffffff; overflow: visible; }
    .cg-container { max-width: 100%; }
    .cg-header, .cg-info, .cg-card, .cg-hero, .cg-desc { box-shadow: none; }
    .cg-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
    .cg-watermark { opacity: 0.06; gap: 60px; }
    .cg-watermark img { width: 130px; }
    .cg-badge, .cg-hero-badge, .cg-card::before, .cg-hero::before, .cg-desc::before, .cg-accent {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    @page { size: A4; margin: 1cm; }
}