/* AlvinCR Eshop – mobile-first responsive */
.ae-wrap *, .ae-wrap *::before, .ae-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }
.ae-wrap { font-family: 'Segoe UI', Roboto, Arial, sans-serif; font-size: 15px; color: #263238; background: #f0f2f5; }

/* ── LOGIN ───────────────────────────────────────────────── */
.ae-login-wrap { display: flex; align-items: center; justify-content: center; min-height: 60vh; padding: 24px 16px; }
.ae-login-card { background: #fff; border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,.14); padding: 40px 36px; width: 100%; max-width: 400px; }
.ae-login-logo { font-size: 28px; font-weight: 900; color: #1a237e; letter-spacing: -1px; margin-bottom: 6px; }
.ae-login-logo span { color: #e65100; }
.ae-login-card h2 { font-size: 18px; font-weight: 600; color: #37474f; margin-bottom: 24px; }
.ae-field { margin-bottom: 18px; }
.ae-field label { display: block; font-size: 13px; font-weight: 600; color: #607d8b; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .4px; }
.ae-field input { width: 100%; border: 2px solid #e0e0e0; border-radius: 10px; padding: 13px 15px; font-size: 15px; transition: border-color .2s, box-shadow .2s; outline: none; background: #fafafa; }
.ae-field input:focus { border-color: #1565c0; box-shadow: 0 0 0 3px rgba(21,101,192,.12); background: #fff; }
.ae-btn-primary { width: 100%; background: linear-gradient(135deg, #1565c0, #1a237e); color: #fff; border: none; border-radius: 10px; padding: 15px; font-size: 16px; font-weight: 700; cursor: pointer; transition: opacity .2s, transform .1s; letter-spacing: .3px; }
.ae-btn-primary:hover { opacity: .92; }
.ae-btn-primary:active { transform: scale(.98); }
.ae-btn-primary:disabled { background: #bdbdbd; cursor: not-allowed; }
.ae-error { color: #c62828; font-size: 14px; margin-top: 14px; min-height: 18px; font-weight: 500; }

/* ── TOP BAR ─────────────────────────────────────────────── */
.ae-topbar { background: linear-gradient(90deg, #1a237e, #283593); color: #fff; padding: 12px 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.ae-topbar-user { flex: 1; font-size: 14px; color: #c5cae9; min-width: 0; }
.ae-topbar-user strong { color: #fff; }
.ae-logout { color: #90caf9; font-size: 13px; text-decoration: none; }
.ae-logout:hover { color: #fff; text-decoration: underline; }
.ae-cart-badge { background: #e65100; color: #fff; border: none; border-radius: 24px; padding: 9px 18px; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .2s; flex-shrink: 0; }
.ae-cart-badge:hover { background: #bf360c; }

/* ── SEARCH ──────────────────────────────────────────────── */
.ae-search-wrap { background: #fff; padding: 14px 20px 12px; border-bottom: 1px solid #e8eaed; }
.ae-search-inner { display: flex; gap: 8px; max-width: 900px; }
.ae-search-input { flex: 1; border: 2px solid #e0e0e0; border-radius: 10px; padding: 13px 16px; font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s; background: #fafafa; }
.ae-search-input:focus { border-color: #1565c0; box-shadow: 0 0 0 3px rgba(21,101,192,.1); background: #fff; }
.ae-search-btn { background: #1565c0; color: #fff; border: none; border-radius: 10px; padding: 13px 26px; font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .2s; }
.ae-search-btn:hover { background: #0d47a1; }

/* jQuery UI autocomplete override */
.ui-autocomplete { border: 1px solid #e0e0e0; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.12); font-family: inherit; font-size: 14px; max-height: 260px; overflow-y: auto; overflow-x: hidden; }
.ui-menu-item-wrapper { padding: 10px 14px; }
.ui-state-active, .ui-widget-content .ui-state-active { background: #e3f2fd; color: #1565c0; border: none; }

/* ── CATALOG FILTER ─────────────────────────────────────── */
.ae-catalog-filter { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.ae-cf-label { font-size: 11px; font-weight: 700; color: #9e9e9e; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; flex-shrink: 0; }
.ae-cf-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.ae-cf-chip { background: #fff; border: 1.5px solid #cfd8dc; border-radius: 6px; padding: 5px 11px; font-size: 12px; font-weight: 700; color: #455a64; cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s, color .15s; line-height: 1.4; }
.ae-cf-chip:hover { border-color: #1565c0; background: #e3f2fd; color: #1565c0; }
.ae-cf-chip.ae-cf-active { background: #1565c0; border-color: #1565c0; color: #fff; }

/* ── RESULTS PANEL ───────────────────────────────────────── */
.ae-results-panel { padding: 16px 20px; }

/* ── STATUS / EMPTY ──────────────────────────────────────── */
.ae-results-info { font-size: 13px; color: #607d8b; margin-bottom: 12px; }
.ae-loading, .ae-empty { text-align: center; padding: 48px 20px; color: #9e9e9e; }
.ae-welcome-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.ae-empty p { font-size: 15px; }

/* ── PRODUCTS TABLE ──────────────────────────────────────── */
.ae-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.07); }
.ae-table thead th { background: #1a237e; color: #fff; padding: 11px 12px; text-align: left; font-size: 13px; font-weight: 600; white-space: nowrap; user-select: none; }
.ae-table tbody tr { border-bottom: 1px solid #f0f0f0; transition: background .1s; }
.ae-table tbody tr:last-child { border-bottom: none; }
.ae-table tbody tr:hover { background: #e8f4fd; }
.ae-table td { padding: 9px 12px; font-size: 14px; vertical-align: middle; }
.ae-td-code { font-family: 'Courier New', monospace; font-weight: 700; color: #1565c0; white-space: nowrap; font-size: 13px; }
.ae-td-name { max-width: 220px; }
.ae-td-price { text-align: right; white-space: nowrap; }
.ae-td-price strong { font-size: 14px; }
.ae-td-stock { text-align: center; white-space: nowrap; }
.ae-stock-badge { display: inline-block; border-radius: 12px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.ae-stock-ok  { background: #e8f5e9; color: #2e7d32; }
.ae-stock-low { background: #fff8e1; color: #f57f17; }
.ae-stock-no  { background: #fce4ec; color: #880e4f; }
.ae-td-add { white-space: nowrap; }
.ae-qty-input { width: 70px; max-width: 70px; border: 1px solid #ddd; border-radius: 6px; padding: 5px 4px; font-size: 13px; text-align: center; background: #fafafa; }
.ae-qty-input:focus { outline: none; border-color: #1565c0; }
.ae-add-btn { background: #e65100; color: #fff; border: none; border-radius: 7px; padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; margin-left: 4px; transition: background .2s, transform .1s; }
.ae-add-btn:hover { background: #bf360c; }
.ae-add-btn:active { transform: scale(.96); }
.ae-add-btn.ae-in-cart { background: #2e7d32; }
.ae-add-btn.ae-in-cart:hover { background: #1b5e20; }
.ae-rezv-btn { background: #fff; border: 2px solid #f57f17; color: #e65100; }
.ae-rezv-btn:hover { background: #fff3e0; border-color: #e65100; }
.ae-rezv-btn.ae-in-cart { background: #fff3e0; border-color: #f57f17; color: #e65100; }

/* ── PAGINATION ──────────────────────────────────────────── */
.ae-pagination { display: flex; gap: 5px; margin-top: 16px; flex-wrap: wrap; }
.ae-page-btn { background: #fff; border: 1px solid #ddd; border-radius: 7px; padding: 7px 13px; font-size: 13px; cursor: pointer; transition: all .15s; }
.ae-page-btn:hover:not(.ae-page-active) { background: #e3f2fd; border-color: #1565c0; }
.ae-page-btn.ae-page-active { background: #1565c0; color: #fff; border-color: #1565c0; font-weight: 700; }

/* ── CART MODAL ──────────────────────────────────────────── */
.ae-cart-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 300; }
.ae-cart-backdrop.ae-open { display: block; }

.ae-cart-panel { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(.96); width: 92%; max-width: 780px; max-height: 85vh; background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.28); z-index: 301; display: flex; flex-direction: column; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.ae-cart-panel.ae-open { opacity: 1; pointer-events: auto; transform: translate(-50%,-50%) scale(1); }

.ae-cart-title { background: linear-gradient(90deg, #1a237e, #283593); color: #fff; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.ae-cart-title-text { font-size: 16px; font-weight: 700; }
.ae-cart-count-badge { background: #e65100; color: #fff; border-radius: 12px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.ae-cart-close { background: rgba(255,255,255,.15); border: none; color: #fff; font-size: 16px; cursor: pointer; border-radius: 6px; padding: 4px 9px; line-height: 1; transition: background .15s; }
.ae-cart-close:hover { background: rgba(255,255,255,.3); }

.ae-cart-empty { text-align: center; color: #bdbdbd; font-size: 14px; padding: 40px 20px; }
.ae-cart-items { flex: 1; overflow-y: auto; }

.ae-cart-table { width: 100%; border-collapse: collapse; }
.ae-cart-table thead th { background: #f5f6fa; color: #607d8b; padding: 9px 12px; font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; border-bottom: 2px solid #e0e0e0; position: sticky; top: 0; z-index: 1; }
.ae-cart-table tbody td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; font-size: 13px; }
.ae-cart-table tbody tr:last-child td { border-bottom: none; }
.ae-cart-table tbody tr:hover { background: #f9fafc; }
.ae-ct-code { font-family: 'Courier New', monospace; font-weight: 700; color: #1565c0; white-space: nowrap; font-size: 13px; }
.ae-ct-name { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #37474f; }
.ae-ct-qty { text-align: center; width: 80px; }
.ae-cart-item-qty { width: 60px; font-size: 15px; font-weight: 700; text-align: center; border: 2px solid #e0e0e0; border-radius: 7px; padding: 5px 4px; transition: border-color .15s; }
.ae-cart-item-qty:focus { outline: none; border-color: #1565c0; }
.ae-ct-price { text-align: right; white-space: nowrap; color: #607d8b; }
.ae-ct-sub { text-align: right; white-space: nowrap; }
.ae-ct-sub strong { font-size: 14px; color: #1a237e; }
.ae-ct-del { text-align: center; width: 36px; }
.ae-cart-item-del { background: none; border: none; color: #e0e0e0; cursor: pointer; font-size: 20px; line-height: 1; padding: 2px 4px; transition: color .15s; }
.ae-cart-item-del:hover { color: #c62828; }
.ae-cart-row-rezv td { background: #fffde7; }
.ae-rezv-tag { display: inline-block; background: #ff6f00; color: #fff; border-radius: 4px; padding: 1px 5px; font-size: 10px; font-weight: 700; letter-spacing: .4px; vertical-align: middle; margin-left: 4px; }

.ae-billing-info { border-top: 1px solid #e8eaed; background: #f5f6fa; padding: 12px 16px; flex-shrink: 0; }
.ae-billing-inner { }
.ae-billing-head { font-size: 11px; font-weight: 700; color: #9e9e9e; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 8px; }

.ae-cart-footer { border-top: 2px solid #e8eaed; background: #f9fafc; padding: 14px 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ae-cart-totals { font-size: 14px; }
.ae-cart-total-row { display: flex; justify-content: space-between; gap: 28px; color: #607d8b; margin-bottom: 4px; }
.ae-cart-total-last { font-size: 17px; font-weight: 700; color: #1a237e; margin-bottom: 0; }
.ae-order-btn { background: linear-gradient(135deg, #2e7d32, #1b5e20); color: #fff; border: none; border-radius: 10px; padding: 13px 28px; font-size: 15px; font-weight: 700; cursor: pointer; transition: opacity .2s; white-space: nowrap; }
.ae-order-btn:hover { opacity: .9; }
.ae-order-btn:disabled { background: #bdbdbd; cursor: not-allowed; }

/* ── ORDER MODAL ─────────────────────────────────────────── */
.ae-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ae-modal { background: #fff; border-radius: 16px; width: 100%; max-width: 660px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); display: flex; flex-direction: column; }
.ae-modal-head { background: linear-gradient(90deg, #1a237e, #283593); color: #fff; padding: 20px 24px; border-radius: 16px 16px 0 0; flex-shrink: 0; }
.ae-modal-head h3 { font-size: 20px; font-weight: 700; margin: 0; }
.ae-modal-body { padding: 20px 24px; flex: 1; overflow-y: auto; }

/* Zákazník / fakturační */
.ae-order-info { display: flex; gap: 16px; background: #f5f6fa; border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; }
.ae-order-info-col { flex: 1; min-width: 0; }
.ae-order-info-col h4 { font-size: 10px; font-weight: 700; color: #9e9e9e; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 8px; }
.ae-info-table { font-size: 13px; border-collapse: collapse; width: 100%; }
.ae-info-table td { padding: 2px 6px 4px 0; vertical-align: top; }
.ae-info-table td:first-child { color: #9e9e9e; white-space: nowrap; padding-right: 10px; font-size: 12px; }
.ae-info-table td:last-child { font-weight: 500; color: #263238; }

/* Order items table */
.ae-modal-table { width: 100%; border-collapse: collapse; }
.ae-modal-table thead th { background: #1a237e; color: #fff; padding: 10px 12px; text-align: left; font-size: 13px; font-weight: 600; white-space: nowrap; }
.ae-modal-table tbody td { padding: 9px 12px; border-bottom: 1px solid #f0f0f0; font-size: 13px; vertical-align: middle; }
.ae-modal-table tbody tr:hover { background: #f5f9ff; }
.ae-modal-table tbody tr:last-child td { border-bottom: none; }
.ae-modal-table tfoot td { background: #e8f5e9; font-weight: 700; padding: 10px 12px; font-size: 14px; }
.ae-modal-table tfoot tr:first-child td { border-top: 2px solid #c8e6c9; }
.ae-modal-row-rezv td { background: #fffde7; }

.ae-modal-actions { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid #e8eaed; background: #f9fafc; border-radius: 0 0 16px 16px; flex-shrink: 0; }
.ae-btn-cancel  { flex: 1; background: #eeeeee; color: #37474f; border: none; border-radius: 10px; padding: 13px; font-size: 15px; cursor: pointer; font-weight: 600; }
.ae-btn-confirm { flex: 2; background: linear-gradient(135deg, #2e7d32, #1b5e20); color: #fff; border: none; border-radius: 10px; padding: 13px; font-size: 15px; font-weight: 700; cursor: pointer; }
.ae-btn-confirm:disabled { background: #bdbdbd; cursor: not-allowed; }

/* ── TOAST ───────────────────────────────────────────────── */
.ae-toast { position: fixed; bottom: 24px; right: 24px; color: #fff; padding: 13px 20px; border-radius: 10px; font-size: 14px; font-weight: 500; z-index: 10000; transform: translateY(80px); opacity: 0; transition: transform .3s, opacity .3s; pointer-events: none; max-width: 320px; }
.ae-toast.ae-show { transform: translateY(0); opacity: 1; }
.ae-toast-success { background: #2e7d32; }
.ae-toast-error   { background: #c62828; }
.ae-toast-info    { background: #1565c0; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 700px) {
    .ae-cart-panel { width: 96%; max-height: 90vh; }
    .ae-order-info { flex-direction: column; gap: 10px; }
    .ae-results-panel { padding: 12px 14px; }
    .ae-search-wrap { padding: 12px 14px 10px; }
    .ae-topbar { padding: 10px 14px; gap: 8px; }
    .ae-cart-badge { font-size: 13px; padding: 8px 14px; }
    .ae-table thead th:nth-child(4),
    .ae-table tbody td:nth-child(4) { display: none; }
    .ae-ct-name { max-width: 130px; }
}
@media (max-width: 480px) {
    .ae-login-card { padding: 28px 20px; }
    .ae-table thead th:nth-child(2),
    .ae-table tbody td:nth-child(2),
    .ae-table thead th:nth-child(5),
    .ae-table tbody td:nth-child(5) { display: none; }
    .ae-table td, .ae-table th { padding: 7px 6px; font-size: 12px; }
    .ae-qty-input { width: 38px; max-width: 38px; font-size: 12px; padding: 4px 2px; }
    .ae-add-btn { padding: 5px 8px; font-size: 11px; margin-left: 2px; }
    .ae-cart-footer { flex-direction: column; align-items: stretch; }
    .ae-order-btn { text-align: center; }
}
