/* ============================================================
   FOTOPORTÁL – Kodak Express Jakoubě – Styly v2
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --ke-red:    #E31D1A;
    --ke-dark:   #2D2D2D;
    --ke-gray:   #5A5A5A;
    --ke-light:  #F5F5F5;
    --brand:     #1a56db;
    --brand-dk:  #1740a8;
    --bg:        #F2F2F2;
    --card:      #ffffff;
    --text:      #1a1a2e;
    --muted:     #6b7280;
    --border:    #e5e7eb;
    --success:   #16a34a;
    --error:     #dc2626;
    --radius:    10px;
    --shadow:    0 2px 16px rgba(0,0,0,.09);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.5;
}

/* --- LOGIN ------------------------------------------------- */
.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 20% -10%, rgba(227,29,26,.35), transparent 55%),
        radial-gradient(circle at 100% 110%, rgba(227,29,26,.18), transparent 50%),
        linear-gradient(160deg, #232323 0%, var(--ke-dark) 60%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-logo-wrap {
    margin-bottom: 1.75rem;
    text-align: center;
}
.login-logo-wrap img {
    height: 56px;
    width: auto;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,.4));
}

.login-wrap {
    background: var(--card);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,.45), 0 2px 0 rgba(255,255,255,.04) inset;
    padding: 2rem 1.6rem 1.75rem;
    max-width: 420px;
    width: 100%;
    border-top: 4px solid var(--ke-red);
}

.login-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--ke-dark);
    margin-bottom: .3rem;
    text-align: center;
    letter-spacing: -.01em;
}
.login-subtitle {
    color: var(--muted);
    font-size: .9rem;
    text-align: center;
    margin-bottom: 1.75rem;
    line-height: 1.4;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.25rem 0;
    color: var(--muted);
    font-size: .8rem;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* .form-control (níž v souboru) nastavuje font-size: 1rem se stejnou
   specificitou – bez druhé třídy v selektoru by ho přebilo pořadí
   v souboru a číslo kódu by se zmenšilo na běžný text. */
.form-control.code-input {
    text-align: center;
    font-size: clamp(1.05rem, 5.2vw, 1.35rem);
    letter-spacing: .1em;
    text-transform: uppercase;
    font-weight: 700;
    padding-top: .8rem;
    padding-bottom: .8rem;
}
.code-input::placeholder {
    letter-spacing: .02em;
    font-size: clamp(.72rem, 3.6vw, .95rem);
    text-transform: none;
    font-weight: 500;
    color: #a8b0b8;
}

/* --- HEADER ----------------------------------------------- */
.site-header {
    background: var(--ke-dark);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: .6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-logo img { height: 38px; width: auto; display: block; }

.header-info { flex: 1; padding: 0 1rem; }
.header-gallery { font-weight: 700; font-size: .95rem; color: #fff; }
.header-meta { font-size: .75rem; color: #9ca3af; }

.cart-btn {
    display: flex;
    align-items: center;
    gap: .4rem;
    background: var(--ke-red);
    color: #fff;
    border-radius: 99px;
    padding: .5rem 1.1rem;
    text-decoration: none;
    font-weight: 700;
    font-size: .9rem;
    white-space: nowrap;
    transition: background .15s;
}
.cart-btn:hover { background: #c41816; }

.cart-badge {
    background: #fff;
    color: var(--ke-red);
    border-radius: 99px;
    font-size: .7rem;
    font-weight: 800;
    padding: .1rem .45rem;
    min-width: 1.2rem;
    text-align: center;
}

.back-link { color: #9ca3af; text-decoration: none; font-size: .9rem; }
.back-link:hover { color: #fff; }
.header-title-sm { font-weight: 600; color: #fff; font-size: .9rem; }

/* --- GALLERY GRID ----------------------------------------- */
.gallery-main { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem 4rem; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .75rem;
}
@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
}

.gallery-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background: #222;
    aspect-ratio: 3/2;
    cursor: pointer;
}

.gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.gallery-item:hover .gallery-thumb { transform: scale(1.04); }

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 55%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: .75rem;
    opacity: 0;
    transition: opacity .2s;
}
.gallery-item:hover .gallery-item-overlay,
.gallery-item:focus .gallery-item-overlay { opacity: 1; }

@media (hover: none) { .gallery-item-overlay { opacity: 1; } }

/* --- LIGHTBOX / FULLSCREEN PREVIEW ------------------------ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 600;
    background: rgba(0,0,0,.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.lightbox.hidden { display: none; }

.lightbox-img-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    width: 100%;
    min-height: 0;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,.6);
}

.lightbox-bar {
    width: 100%;
    background: rgba(20,20,20,.95);
    padding: .85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.lightbox-filename {
    flex: 1;
    color: #9ca3af;
    font-size: .8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lightbox-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 2.4rem; height: 2.4rem;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.lightbox-close:hover { background: rgba(255,255,255,.25); }

/* --- ORDER PANEL (drawer ze spodu v lightboxu) ------------ */
.order-panel {
    width: 100%;
    max-width: 520px;
    background: #1a1a2e;
    border-top: 2px solid var(--ke-red);
    padding: 1rem 1.25rem 1.5rem;
    display: none;
}
.order-panel.open { display: block; }

.product-list { display: flex; flex-direction: column; gap: .4rem; margin: .75rem 0; }

.product-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .85rem;
    border: 1.5px solid #334155;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    background: #111827;
}
.product-row:has(input:checked) { border-color: var(--ke-red); background: #1f1215; }
.product-row input[type=radio] { accent-color: var(--ke-red); width: 1rem; height: 1rem; }
.product-name { flex: 1; font-weight: 600; font-size: .9rem; color: #e5e7eb; }
.product-desc { font-size: .75rem; color: #6b7280; }
.product-price { font-weight: 700; color: var(--ke-red); white-space: nowrap; }

.qty-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; color: #9ca3af; font-size: .9rem; }
.qty-controls { display: flex; align-items: center; gap: .5rem; }
.qty-btn { width: 2rem; height: 2rem; border: 1px solid #334155; border-radius: 6px; background: #1f2937; color: #e5e7eb; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.qty-btn:hover { background: #374151; }
.qty-input { width: 3rem; text-align: center; border: 1px solid #334155; border-radius: 6px; padding: .3rem; font-size: 1rem; background: #1f2937; color: #fff; }

/* --- CART ------------------------------------------------- */
.cart-main { max-width: 640px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.page-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.25rem; }

.cart-items { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1rem; }

.cart-item {
    display: flex;
    gap: .75rem;
    background: var(--card);
    border-radius: var(--radius);
    padding: .85rem;
    box-shadow: var(--shadow);
    align-items: center;
}
.cart-thumb { width: 80px; height: 64px; object-fit: contain; object-position: center; background:#171717; border-radius: 6px; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 700; font-size: .95rem; }
.cart-item-file { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-item-qty { font-size: .85rem; color: var(--muted); }
/* Rozpis pod položkou: proč je cena nižší než ceníková. */
.cart-item-note { font-size: .78rem; color: #147a45; background: #eef7f1;
                  border-radius: 5px; padding: .22rem .45rem; margin-top: .25rem;
                  display: inline-block; line-height: 1.35; }
.cart-saving-line { font-size: .85rem; color: #147a45; font-weight: 600; }
.cart-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
.cart-item-subtotal { font-weight: 700; white-space: nowrap; color: var(--ke-red); }
.btn-remove {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
    /* Neviditelná plocha kolem "✕" – prst se snadněji trefí, i když
       samotná ikonka je vizuálně malá. */
    padding: .6rem;
    margin: -.6rem;
    line-height: 1;
    border-radius: 50%;
    transition: background .15s, color .15s;
}
.btn-remove:hover { color: var(--error); background: #fee2e2; }

.cart-total { text-align: right; font-size: 1.2rem; padding: .85rem 0; border-top: 2px solid var(--border); margin-bottom: .75rem; }
.cart-total strong { color: var(--ke-red); }

.cart-note { background: #fef9c3; border: 1px solid #fde68a; border-radius: 8px; padding: .75rem 1rem; font-size: .88rem; color: #92400e; margin-bottom: 1.5rem; }

.checkout-form-wrap { background: var(--card); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.checkout-form-wrap h2 { font-size: 1.1rem; margin-bottom: 1rem; }

.order-summary-box { background: var(--ke-light); border-radius: 8px; padding: .75rem 1rem; margin: 1rem 0; font-size: .9rem; display: flex; flex-direction: column; gap: .25rem; border-left: 3px solid var(--ke-red); }

@media (max-width: 600px) {
    .header-inner { padding: .55rem .7rem; gap: .55rem; }
    .header-logo img { height: 30px; max-width: 140px; object-fit: contain; }
    .header-title-sm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    .cart-main { padding: 1rem .65rem 3rem; }
    .page-title { font-size: 1.3rem; margin-bottom: 1rem; }
    .cart-item {
        display: grid;
        grid-template-columns: 68px minmax(0, 1fr) auto;
        align-items: center;
        gap: .65rem;
        padding: .7rem;
    }
    .cart-thumb { width: 68px; height: 52px; }
    .cart-item-name { font-size: .88rem; line-height: 1.25; }
    .cart-item-file { max-width: 100%; }
    .cart-item-right { min-width: 58px; }
    .cart-item-subtotal { font-size: .9rem; }
    .checkout-form-wrap { padding: 1rem .85rem; }
    .checkout-form-wrap input,
    .checkout-form-wrap select,
    .checkout-form-wrap textarea,
    .checkout-form-wrap .btn { width: 100%; max-width: 100%; box-sizing: border-box; }
}

@media (max-width: 380px) {
    .cart-item {
        grid-template-columns: 58px minmax(0, 1fr);
        align-items: start;
    }
    .cart-thumb { width: 58px; height: 48px; }
    .cart-item-right {
        grid-column: 2;
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* --- THANK YOU -------------------------------------------- */
.thankyou-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: 100vh;
    min-height: 100dvh;
    /* Stejný vizuální jazyk jako vstupní stránka (login-page) – ať
       poslední krok objednávky nepůsobí jako jiný web. */
    background:
        radial-gradient(circle at 15% 100%, rgba(22,163,74,.25), transparent 55%),
        radial-gradient(circle at 100% -10%, rgba(227,29,26,.22), transparent 50%),
        linear-gradient(160deg, #232323 0%, var(--ke-dark) 60%);
}
.thankyou-wrap { text-align: center; max-width: 480px; width: 100%; }
.thankyou-icon {
    font-size: 3.4rem;
    margin: 0 auto 1.1rem;
    width: 4.6rem;
    height: 4.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(22,163,74,.15);
    border-radius: 50%;
}
.thankyou-wrap h1 { font-size: 1.7rem; color: #fff; margin-bottom: .75rem; letter-spacing: -.01em; }
.thankyou-wrap p { color: #9ca3af; margin-bottom: .5rem; line-height: 1.5; }
.thankyou-box { background: var(--card); border-radius: 14px; padding: 1.25rem 1.5rem; margin: 1.25rem auto; box-shadow: var(--shadow); text-align: left; display: flex; flex-direction: column; gap: .5rem; font-size: .95rem; border-top: 4px solid var(--success); }

/* --- FORMS ------------------------------------------------ */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.form-control {
    width: 100%;
    padding: .65rem .85rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color .15s;
    background: #fff;
    /* Na Linuxu/Androidu umí prohlížeč kreslit nativní "neplatné pole"
       zvýraznění (růžový rámeček) přímo ve widgetu, mimo dosah CSS
       (border-color/box-shadow ho nepřebijí). Vlastní vzhled bez
       nativního widgetu to řeší jednou provždy. */
    appearance: none;
    -webkit-appearance: none;
}
.form-control:focus { outline: none; border-color: var(--ke-red); }
textarea.form-control { resize: vertical; }

/* --- BUTTONS ---------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .65rem 1.25rem; border-radius: 8px; font-size: .95rem; font-weight: 700; border: none; cursor: pointer; text-decoration: none; transition: background .15s, opacity .15s; }
.btn-primary { background: var(--ke-red); color: #fff; }
.btn-primary:hover { background: #c41816; }
.btn-light { background: rgba(255,255,255,.92); color: var(--ke-dark); }
.btn-light:hover { background: #fff; }
.btn-sm { padding: .4rem .85rem; font-size: .85rem; }
.btn-full { width: 100%; }
.btn-large { padding: .85rem 1.5rem; font-size: 1.05rem; }
.btn-secondary { background: var(--ke-light); color: var(--ke-dark); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: #fee2e2; color: var(--error); }
.btn-danger:hover { background: #fecaca; }
.btn-success { background: #dcfce7; color: var(--success); }

/* --- ALERTS ----------------------------------------------- */
.alert { border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; font-size: .9rem; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-floating { position: fixed; top: 5rem; left: 50%; transform: translateX(-50%); z-index: 999; white-space: nowrap; box-shadow: var(--shadow); animation: slideIn .2s ease; }
@keyframes slideIn { from { opacity:0; top: 4rem; } to { opacity:1; top: 5rem; } }

.empty-state { text-align: center; color: var(--muted); padding: 3rem 1rem; }

/* --- ADMIN ------------------------------------------------ */
.admin-body { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 230px;
    background: var(--ke-dark);
    color: #cbd5e1;
    flex-shrink: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.sidebar-logo {
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--ke-red);
    margin-bottom: .5rem;
}
.sidebar-logo img { height: 40px; width: auto; }

.sidebar-nav { list-style: none; flex: 1; }
.sidebar-nav li a { display: block; padding: .65rem 1.25rem; color: #94a3b8; text-decoration: none; font-size: .9rem; border-left: 3px solid transparent; transition: all .15s; }
.sidebar-nav li a:hover, .sidebar-nav li a.active { color: #fff; background: rgba(255,255,255,.07); border-left-color: var(--ke-red); }

.admin-content { flex: 1; padding: 2rem; overflow: auto; background: var(--bg); }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.75rem; }
.admin-topbar h1 { font-size: 1.4rem; }
.admin-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.5rem; }

/* --- TABLES (admin) --------------------------------------- */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th { text-align: left; padding: .65rem .85rem; background: #f8fafc; border-bottom: 2px solid var(--border); font-weight: 700; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.data-table td { padding: .7rem .85rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fafc; }

.badge { display: inline-block; padding: .2rem .6rem; border-radius: 99px; font-size: .75rem; font-weight: 700; }
.badge-new       { background: #dbeafe; color: #1e40af; }
.badge-confirmed { background: #d1fae5; color: #065f46; }
.badge-packed    { background: #e5e7eb; color: #374151; }
.badge-open      { background: #d1fae5; color: #065f46; }
.badge-closed    { background: #fee2e2; color: #991b1b; }

.action-btns { display: flex; gap: .4rem; flex-wrap: wrap; }

@media (max-width: 768px) {
    .admin-sidebar { display: none; }
    .admin-content { padding: 1rem; }
}
@media print {
    .admin-sidebar, .admin-topbar button, form .btn, .action-btns { display: none !important; }
    .admin-content { padding: 0; }
    .admin-card { box-shadow: none; border: 1px solid #ccc; }
}




/* --- Výhodná nabídka v košíku: slevový kupón --------------------
   Musí být vidět na první pohled, jinak ji nikdo nezaregistruje. */
.cross-coupon { display: flex; align-items: stretch; margin: 1.35rem 0;
                border: 3px dashed #E31D1A; border-radius: 14px;
                overflow: hidden; background: #fff;
                box-shadow: 0 4px 18px rgba(227,29,26,.16); }
.cross-stub { background: #E31D1A; color: #fff; flex: none; min-width: 132px;
              display: flex; flex-direction: column; align-items: center; justify-content: center;
              padding: 1.1rem .9rem; }
.cross-stub-pct   { font-size: 2.9rem; font-weight: 900; line-height: .95; letter-spacing: -.02em; }
.cross-stub-pct small { font-size: 1.5rem; font-weight: 800; }
.cross-stub-label { font-size: .75rem; font-weight: 800; letter-spacing: .18em;
                    text-transform: uppercase; margin-top: .25rem; }
.cross-body { flex: 1; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
              padding: 1.05rem 1.25rem; }
.cross-title { flex: 1 1 100%; font-size: 1.14rem; font-weight: 900;
               color: #102D25; line-height: 1.28; text-transform: uppercase;
               letter-spacing: .01em; }
.cross-sub   { flex: 1 1 auto; min-width: 120px; font-size: .88rem; color: #6b7280; margin-top: -.35rem; }
.cross-price { white-space: nowrap; }
.cross-price-old { text-decoration: line-through; color: #9aa39f; font-size: .88rem; }
.cross-price-new { color: #E31D1A; font-size: 1.25rem; margin-left: .4rem; }
.cross-btn { background: #E31D1A; color: #fff; border: none; border-radius: 9px;
             padding: .8rem 1.5rem; font-weight: 900; font-size: .95rem;
             text-decoration: none; white-space: nowrap; display: inline-block;
             letter-spacing: .02em; }
.cross-btn:hover { background: #c41816; color: #fff; }
@media (max-width: 560px) {
    .cross-stub { min-width: 96px; }
    .cross-stub-pct { font-size: 2.1rem; }
    .cross-btn { width: 100%; text-align: center; }
}
