/* ==========================================================
   E-BAG – RAFA 2026
   Připojit v <head> až ZA main.css:
   <link rel="stylesheet" href="css/ebag.css">
   ========================================================== */

.ebag-area {
    background-color: #eeeeee;
    padding: 30px 0 60px;
}

/* --- Úvod --- */
.ebag-intro {
    max-width: 820px;
    margin-bottom: 25px;
}

.ebag-intro p {
    margin-bottom: 8px;
}

.ebag-intro .ebag-hint {
    font-size: 13px;
    color: #7f6a65;
}

/* --- Rychlá navigace po firmách --- */
.ebag-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.ebag-nav a {
    display: inline-block;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.ebag-nav a:hover {
    background: #f78b09;
    border-color: #f78b09;
    color: #fff;
}

/* --- Řádek firmy: logo vlevo, letáky vpravo --- */
.ebag-company {
    display: flex;
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
    scroll-margin-top: 140px; /* aby kotva nezajela pod fixní menu */
}

.ebag-company:target {
    box-shadow: 0 0 0 3px #f78b09;
}

/* Levý panel s logem */
.ebag-brand {
    flex: 0 0 230px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 25px 20px;
    border-right: 3px solid #f78b09;
    text-align: center;
}

.ebag-logo {
    width: 100%;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ebag-logo img {
    max-width: 100%;
    max-height: 90px;
    object-fit: contain;
}

/* Náhradní text, když logo chybí */
.ebag-logo .ebag-logo-text {
    display: none;
    font-size: 24px;
    font-weight: 700;
    color: #7f6a65;
    line-height: 1.2em;
}

.ebag-logo.no-logo .ebag-logo-text {
    display: block;
}

.ebag-brand h3 {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    margin: 0;
}

.ebag-count {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #f78b09;
    background: #fff4e6;
    border-radius: 12px;
    padding: 2px 10px;
}

/* Pravý panel s letáky */
.ebag-docs {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px;
    padding: 25px;
}

.ebag-doc {
    width: 150px;
    display: block;
    color: #222;
}

/* Přebal (první strana PDF) */
.ebag-thumb {
    display: block;
    position: relative;
    width: 150px;
    aspect-ratio: 1 / 1.414; /* A4 */
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ebag-thumb canvas,
.ebag-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

/* Ikona, dokud se přebal nenačte (nebo když se načíst nedá) */
.ebag-thumb .ebag-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    color: #d93025;
    opacity: 0.6;
}

.ebag-thumb.loaded .ebag-placeholder,
.ebag-thumb img ~ .ebag-placeholder {
    display: none;
}

/* Překryv při najetí myší */
.ebag-thumb .ebag-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(247, 139, 9, 0.85);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ebag-doc:hover .ebag-thumb {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.ebag-doc:hover .ebag-overlay {
    opacity: 1;
}

.ebag-doc-title {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35em;
}

.ebag-doc:hover .ebag-doc-title {
    color: #f78b09;
}

/* --- Tablet a mobil --- */
@media (max-width: 767px) {
    .ebag-company {
        flex-direction: column;
    }

    .ebag-brand {
        flex: none;
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        border-right: none;
        border-bottom: 3px solid #f78b09;
        padding: 15px 20px;
    }

    .ebag-logo {
        width: 110px;
        height: 60px;
        flex-shrink: 0;
    }

    .ebag-logo img {
        max-height: 60px;
    }

    .ebag-logo .ebag-logo-text {
        font-size: 18px;
    }

    .ebag-docs {
        gap: 16px;
        padding: 20px;
    }

    .ebag-doc,
    .ebag-thumb {
        width: calc(50% - 8px);
    }

    .ebag-doc .ebag-thumb {
        width: 100%;
    }
}
