/* WEDDI Shopping Mode (split view) */
.aive-shopping-mount{
  width: 100%;
}

.aive-shopping-layout{
  display: flex;
  gap: 16px;
  align-items: stretch;
  width: 100%;
  min-height: 70vh;
}

.aive-shopping-chat{
  flex: 0 0 40%;
  min-width: 320px;
}

/* Make chat feel natural: messages should sit at the bottom, not at the top with a big empty gap. */
.aive-shopping-chat .aive-messages{
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.aive-shopping-products{
  flex: 1 1 60%;
  min-width: 320px;
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  padding: 14px;
}

.aive-shopping-products h3{
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 700;
}

/* Product grid in right panel */
.aive-shopping-products .aive-cards{
  /* force grid in the right panel even if theme CSS resets things */
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

/* Right panel card visuals (JS renders .aive-card / .aive-card-img / .aive-card-name) */
.aive-shopping-products .aive-card{
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  text-decoration: none;
}
.aive-shopping-products .aive-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0,0,0,.10);
}
.aive-shopping-products .aive-card-img{
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f3f3f3;
  overflow: hidden;
}
.aive-shopping-products .aive-card-img img{
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block !important;
}
.aive-shopping-products .aive-card-name{
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
  color: #1f2937;
}

@media (max-width: 1200px){
  .aive-shopping-products .aive-cards{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px){
  .aive-shopping-products .aive-cards{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px){
  .aive-shopping-layout{
    flex-direction: column;
  }
  .aive-shopping-chat, .aive-shopping-products{
    flex: 1 1 auto;
    min-width: 0;
  }
}

@media (max-width: 560px){
  .aive-shopping-products .aive-cards{
    grid-template-columns: 1fr;
  }
}

/* Override floating widget positioning when in shopping mode */
#aive-root.aive-root.aive-mode-shopping{
  position: static;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  z-index: 1;
}

#aive-root.aive-root.aive-mode-shopping .aive-toggle{
  display: none !important;
}

#aive-root.aive-root.aive-mode-shopping .aive-panel{
  position: static;
  width: 100% !important;
  max-height: none !important;
  min-height: 70vh;
}

/* --- Shopping mode: make chat behave like real chat (messages stick to bottom) --- */
.aive-shopping-mount .aive-panel{
  height: 70vh;
  display: flex;
  flex-direction: column;
}
.aive-shopping-mount .aive-messages{
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.aive-shopping-mount .aive-input{
  margin-top: auto;
}

/* --- Shopping mode: card styles (scoped to shopping root) --- */
.aive-shopping-mount .aive-cards{
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
}
.aive-shopping-mount .aive-card{
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.aive-shopping-mount .aive-card img{
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  background: #f3f3f3;
}
.aive-shopping-mount .aive-card-body{
  padding: 10px 12px;
}
.aive-shopping-mount .aive-card-title{
  font-size: 12px;
  line-height: 1.25;
  font-weight: 600;
  margin: 0 0 6px 0;
}
.aive-shopping-mount .aive-card-price{
  font-size: 13px;
  opacity: .85;
  margin: 0 0 10px 0;
}
.aive-shopping-mount .aive-card-actions{
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
}

/* Products header actions */
.aive-products-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.aive-products-head h3{
  margin: 0;
}
.aive-products-actions{
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Smaller button variant */
.aive-btn.aive-btn-xs{
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1;
  border-radius: 999px;
}
.aive-shopping-mount .aive-card-btn{
  flex: 1;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}
.aive-shopping-mount .aive-card-btn:hover{
  background: rgba(0,0,0,.03);
}

/* Responsive cards in shopping mode */
@media (max-width: 1200px){
  .aive-shopping-mount .aive-cards{grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media (max-width: 900px){
  .aive-shopping-mount .aive-cards{grid-template-columns:repeat(2,minmax(0,1fr));}
  .aive-shopping-mount .aive-card img{height:180px;}
}
@media (max-width: 560px){
  .aive-shopping-mount .aive-cards{grid-template-columns:1fr;}
  .aive-shopping-mount .aive-card img{height:220px;}
}


/* --- Selection panel (Mano pasirinkimas) --- */
.aive-shopping-selection{
  margin-top: 18px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.aive-selection-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 12px;
}
.aive-selection-title{
  font-weight: 700;
  font-size: 16px;
  color:#0b3550;
}
.aive-selection-head-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.aive-selection-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}
@media (max-width: 980px){
  .aive-selection-grid{ grid-template-columns: 1fr; }
}
.aive-selection-empty{
  padding: 12px;
  color:#4a5568;
}
.aive-selection-item{
  background:#fff;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.06);
  padding: 10px;
  display:flex;
  gap:10px;
}
.aive-selection-thumb{
  width:64px;
  height:64px;
  flex: 0 0 64px;
  border-radius: 12px;
  background: rgba(0,0,0,0.03);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.aive-selection-thumb img{
  width:100%;
  height:100%;
  object-fit: contain;
}
.aive-selection-meta{
  flex:1;
  min-width:0;
}
\.aive-selection-item-title{
  font-weight:600;
  font-size: 14px;
  line-height: 1.2;
  margin-bottom:6px;
}
.aive-selection-item-title a{ color:inherit; text-decoration:none; }
.aive-selection-price{
  margin-bottom:8px;
  font-size: 13px;
  color:#0b3550;
}
.aive-selection-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.aive-btn-ghost{
  border: 0 !important;
  background: transparent !important;
  padding: 8px 10px !important;
  color:#0b3550 !important;
  opacity: .85;
}
.aive-btn-ghost:hover{ opacity: 1; }


/* Shared button styles (Cards + Selection) */
:root{
  --aive-blue: #0b3d5c;
  --aive-blue-hover: #08324b;
}

.aive-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 9px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  text-decoration:none !important;
  cursor:pointer;
  user-select:none;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}
.aive-btn:active{ transform: translateY(1px); }

.aive-btn-primary{
  background: var(--aive-blue);
  border: 1px solid var(--aive-blue);
  color:#fff !important;
}
.aive-btn-primary:hover{
  background: var(--aive-blue-hover);
  border-color: var(--aive-blue-hover);
}

.aive-btn-outline{
  background: #fff;
  border: 1px solid var(--aive-blue);
  color: var(--aive-blue) !important;
}
.aive-btn-outline:hover{
  background: rgba(11, 61, 92, 0.06);
}

.aive-selection-actions{
  gap: 10px;
}
.aive-selection-item{
  box-shadow: 0 10px 26px rgba(0,0,0,0.06);
}


.aive-card-actions .aive-btn{ flex: 0 0 auto; white-space: nowrap; padding: 7px 10px; font-size: 12px; }


/* Stronger primary button (theme-safe) */
.aive-shopping-mount .aive-btn-primary,
.aive-shopping-selection .aive-btn-primary,
.aive-selection-grid .aive-btn-primary,
.aive-shopping-mount button.aive-btn-primary{
  background: #0b3550 !important;
  border-color: #0b3550 !important;
  color: #fff !important;
}
.aive-shopping-mount .aive-btn-primary:hover,
.aive-shopping-selection .aive-btn-primary:hover,
.aive-selection-grid .aive-btn-primary:hover,
.aive-shopping-mount button.aive-btn-primary:hover{
  background: #0a2f45 !important;
  border-color: #0a2f45 !important;
}
