/* Mobile-first light theme using #ffffff and accent #de210d */
:root{
  --bg:#ffffff;
  --card:#ffffff;
  --text:#111111;
  --muted:#5b5b5b;
  --border:#e6e6e6;
  --primary:#de210d;
  --primary-700:#b81c0b;
  --radius:14px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif}
img{max-width:100%;display:block}

.container{padding:16px;max-width:900px;margin:0 auto}
.msg{margin-top:8px;color:var(--muted);font-size:13px}
.label{color:var(--muted);font-size:12px}
.card{background:var(--card);border-radius:var(--radius);border:1px solid var(--border);box-shadow:0 6px 16px rgba(0,0,0,.05)}
.row{display:flex;gap:8px;align-items:center}
.stack{display:grid;gap:8px}

/* Top centered logo (slightly smaller, not full width) */
.top-logo{padding:8px 0}
.top-logo img{max-width:480px;width:90%;height:auto;display:block;margin:0 auto}

/* Back arrow (top-left) */
.back-arrow{position:fixed;top:12px;left:12px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;border-radius:var(--radius);border:1px solid var(--border);background:#fff;color:var(--primary);text-decoration:none;box-shadow:0 4px 12px rgba(0,0,0,.06);z-index:1000}
.back-arrow:hover{background:var(--primary);color:#fff}
.back-arrow:active{transform:translateY(1px)}
.back-arrow svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:2}

/* When page has back arrow, add top padding to avoid overlap */
.has-back{padding-top:56px}

/* Lot cards grid */
.cards{display:grid;gap:16px}
.lot-card{display:block;padding:12px;text-decoration:none;color:inherit}
.thumb{width:100%;border-radius:12px;overflow:hidden;border:1px solid var(--border);background:#f7f7f7}
.thumb img{width:100%;height:auto;display:block}
.lot-info{padding-top:10px}
.price{font-weight:700;color:var(--primary)}
.countdown{font-size:13px;color:var(--muted)}

/* Lot detail */
.detail{display:grid;gap:16px}
.form-grid{display:grid;gap:12px}
.field{display:grid;gap:8px}
input,textarea{width:100%;padding:12px 14px;border-radius:12px;border:1px solid var(--border);background:#fff;color:var(--text);font-size:16px}
input:focus,textarea:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px rgba(222,33,13,.15)}
button.btn{appearance:none;border:none;border-radius:12px;padding:12px 16px;font-weight:700;font-size:16px}
.btn.primary{background:var(--primary);color:#fff}
.btn.primary:active{background:var(--primary-700)}
.btn.outline{background:transparent;color:var(--primary);border:1px solid var(--primary)}
.btn.full{width:100%}

/* Bids list */
.bids{display:grid;gap:8px}
.bid{display:flex;justify-content:space-between;background:#fff;border:1px solid var(--border);padding:10px 12px;border-radius:10px}
.bid small{color:var(--muted)}

/* Admin */
.admin-row{padding:12px}
.admin-row .mini{width:48px;height:48px;border-radius:8px;border:1px solid var(--border);background:#f7f7f7;object-fit:cover}

/* Bottom banner carousel using bottom_banner_carousel.png */
.app-footer{padding:0;margin:16px 0 30px 0;overflow:hidden}
.banner-marquee{position:relative;width:100%;height:72px;background-image:url('/bottom_banner_carousel.png');background-repeat:repeat-x;background-size:auto 72px;animation:banner-scroll 30s linear infinite}
@keyframes banner-scroll{from{background-position:0 0}to{background-position:-1000px 0}}

/* Utility */
.small{font-size:12px}

/* Mobile fixes for admin + safe areas */
@media (max-width:1400px){
  /* Allow rows to wrap to prevent horizontal overflow */
  .row{flex-wrap:wrap}
  /* Admin row right panel becomes full width under header */
  .admin-row > .row > .stack{min-width:0 !important;width:100%;text-align:left !important}
  /* Inputs stack and take full width */
  .admin-row .field{min-width:0 !important;width:100%}
  /* Make action buttons wrap nicely */
  .admin-row .row button.btn{flex:1 1 auto}
}

/* Improve word wrapping for potentially long texts */
.item-title,.bidder{word-break:break-word;overflow-wrap:anywhere}

/* Respect safe area for notch devices */
.has-back{padding-top:calc(56px + env(safe-area-inset-top, 0))}
.back-arrow{top:calc(12px + env(safe-area-inset-top, 0))}

/* Larger screens */
@media (min-width:700px){
  .cards{grid-template-columns:1fr 1fr 1fr}
}

/* Muted inline link for less prominent actions */
.link-muted{color:var(--muted);text-decoration:none;cursor:pointer}
.link-muted:hover,.link-muted:focus{color:var(--text);text-decoration:underline}

/* Simple modal overlay and card */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);display:none;align-items:center;justify-content:center;z-index:1000}
.modal-card{width:min(420px,90vw);padding:16px;background:#fff;border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.2)}

@media (min-width:700px){
  body{padding-bottom:72px}
  .app-footer{margin:0}
  .banner-marquee{position:fixed;left:0;right:0;bottom:30px;width:100%;z-index:900}
}
