:root{
  --bg:#f6f7fb;
  --card: rgba(255,255,255,0.7);
  --glass: rgba(255,255,255,0.55);
  --muted:#6b6f76;
  --accent:#0078d7;
  --accent-2: rgba(0,120,215,0.12);
  --radius:14px;
  --glass-blur:10px;
  --shadow: 0 8px 30px rgba(16,24,40,0.06);
  --glass-border: rgba(255,255,255,0.6);
  --text: #0f1724;
  font-synthesis: none;
}

/* base */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial;
  background: linear-gradient(180deg, #f3f6fa 0%, var(--bg) 100%);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  padding:18px;
}

/* app container */
.page-bg{display:flex; align-items:center; justify-content:center; min-height:calc(100vh - 36px);}
.app{ width:100%; max-width:1200px; margin:0 auto; }

/* top header */
.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:18px;
}

.logo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;   /* <-- centers horizontally */
  justify-content: center;
}

.logo-img {
  height: 48px;
  object-fit: contain;
}

.logo-tagline {
  font-size: 13px;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 500;
  text-align: center;    /* <-- ensures perfect centering */
  width: 100%;
}

/* modes */
.modes{
  display:flex;
  gap:8px;
  align-items:center;
}

.mode{
  padding:8px 14px;
  border-radius:12px;
  border:1px solid transparent;
  background:transparent;
  cursor:pointer;
  color:var(--muted);
  font-weight:600;
  transition:all .18s ease;
}

.mode.active{
  background:linear-gradient(180deg, #e9f2ff, #d8ebff);
  box-shadow: 0 6px 18px rgba(2,6,23,0.03);
  color:var(--accent);
  border:1px solid var(--glass-border);
  transform:translateY(-1px);
}

/* main card */
.card.main-card{
  display:grid;
  grid-template-columns: 1fr 520px;
  gap:20px;
  padding:22px;
  border-radius:var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.6));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.6);
  backdrop-filter: blur(var(--glass-blur));
}

/* left controls */
.controls{ padding:6px 6px 6px 2px; }
.headline{ margin:6px 0 10px; font-size:20px; font-weight:700; }
.subhead{ margin:0 0 12px; color:var(--muted); font-size:13px; }

/* search blocks */
.search-block{ margin-top:6px; }
.label{ display:block; font-size:13px; font-weight:600; margin-bottom:8px; color:#1f2937; }
.input-row{ display:flex; gap:12px; align-items:center; width:100%; }
.input-row input[type="text"]{
  flex:1;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid rgba(15,23,36,0.06);
  background:linear-gradient(180deg, rgba(250,250,250,0.9), rgba(255,255,255,0.85));
  font-size:15px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.6);
  transition:box-shadow .12s ease, transform .08s ease;
}
.input-row input[type="text"]:focus{
  outline:none;
  box-shadow:0 6px 22px rgba(2,6,23,0.04);
  transform:translateY(-1px);
}

/* two tiles layout */
.two-tiles{
  display:flex;
  gap:14px;
  margin-bottom:12px;
}

/* each image tile */
.image-tile{
  flex:1;
  min-width:0;
  border-radius:12px;
  background:linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.94));
  border:1px solid rgba(15,23,36,0.03);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:14px;
  position:relative;
  cursor:pointer;
  transition:transform .12s ease, box-shadow .12s ease;
  height:120px;
  overflow:hidden;
}
.image-tile:focus,
.image-tile:hover{
  transform:translateY(-4px);
  box-shadow: 0 14px 30px rgba(16,24,40,0.04);
}

.tile-inner{
  display:flex;
  align-items:center;
  gap:12px;
  z-index:2;
}
.tile-icon{ color:var(--accent); opacity:0.95; }
.tile-label { color:var(--text); font-size:14px; text-align:left; }
.tile-sub { font-size:12px; color:var(--muted); margin-top:4px; }

/* preview image inside tile */
.tile-preview{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  border-radius:12px;
  z-index:1;
}

/* tile-actions (search button below tiles) */
.tile-actions{
  margin-top:6px;
  display:flex;
  gap:8px;
  justify-content:center;
}

/* actions */
.btn{
  padding:10px 14px;
  border-radius:10px;
  border:none;
  cursor:pointer;
  font-weight:700;
  font-size:14px;
}
.btn.primary{
  background:linear-gradient(180deg,var(--accent), #005fbd);
  color:white;
}
.btn.primary-outline{ 
  background:#005fbd; 
  color:white; 
  border:1px solid var(--accent-2); 
}

/* results pane */
.results-pane{ padding:6px; display:flex; flex-direction:column; gap:12px; }
.results-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
}

/* results grid */
.results-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(200px, 1fr));
  gap:18px;
}

.card-result{
  padding:10px;
  border-radius:12px;
  background:linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.86));
  border:1px solid rgba(15,23,36,0.03);
  transition:.14s ease;
}
.card-result:hover{
  transform:translateY(-6px);
  box-shadow:0 18px 40px rgba(16,24,40,0.06);
}

.result-thumb{
  width:100%;
  height:140px;
  border-radius:10px;
  overflow:hidden;
  background:#f7f8fb;
  display:flex;
  align-items:center;
  justify-content:center;
}
.result-thumb img{
  width:100%;
  height:100%;
  object-fit:contain;
}

.result-meta{ padding-top:6px; }
.result-title{ font-weight:700; font-size:14px; }
.result-sub{ font-size:12px; color:var(--muted); }

/* empty state */
.empty-state{
  display:flex;
  flex-direction:column;
  align-items:center;
  margin-top:18px;
  color:var(--muted);
}

/* small screens */
@media(max-width:900px){
  .card.main-card{ grid-template-columns:1fr; }
  .results-grid{ grid-template-columns:1fr; }
  .two-tiles{ flex-direction:column; }
  .image-tile{ height:120px; }
}

/* ---------------------------
   ADDED STYLES FOR NEW UI
   --------------------------- */
.result-actions{
  margin-top:8px;
  display:flex;
  gap:8px;
  align-items:center;
}

/* small button variant */
.btn.small{
  padding:6px 10px;
  border-radius:8px;
  font-size:13px;
  font-weight:700;
}

/* ghost style (for Price button) */
.btn.ghost{
  background:transparent;
  border:1px solid rgba(15,23,36,0.06);
  color:var(--muted);
}

/* primary-outline small */
.btn.primary-outline{
  background:transparent;
  color:var(--accent);
  border:1px solid var(--accent-2);
}

/* price badge style when price is shown */
.btn.small[disabled]{
  opacity:0.85;
  cursor:default;
}
.price-text {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-top: 6px;
}

.cart-btn {
  margin-top: 10px;
  padding: 6px 10px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.2s;
}

.cart-btn:hover {
  opacity: 0.8;
}
