/* ===== Body & Layout ===== */
body {
  background:#f5f5f5;
  font-family:'Poppins',sans-serif;
  margin-left:250px;
  padding-top:70px;
  color:#333;
}
@media(max-width:991px){ body { margin-left:0; padding:70px 15px; } }

/* ===== Modal Fixes ===== */
.modal {
  z-index: 1060 !important;
}

.modal-backdrop {
  z-index: 1050 !important;
}

.modal-dialog {
  margin-top: 80px;
}

@media (max-width: 768px) {
  .modal-dialog {
    margin-top: 60px;
  }
}

/* Ensure navbar doesn't interfere */
.navbar {
  z-index: 1040;
  position: fixed;
  top: 0;
  width: 100%;
}

/* ===== Buttons ===== */
.btn-gold {
  background:var(--primary-color); color:#092845; border:none;
  border-radius:8px; padding:6px 14px; font-weight:500;
  transition:0.3s;
}
.btn-gold:hover { background:#092845; color:#fff; }
.btn-gold.active { background: var(--primary-color) !important; color: #fff !important; box-shadow:0 4px 12px rgba(0,0,0,0.15) ; }
.btn-primary { background: var(--primary-color) !important; border-radius:8px!; transition: 0.3s !important; border: #fff!important;}
.btn-primary:hover { background: #092845; color: #fff; transform: scale(1.05); box-shadow: 0 6px 18px rgba(243,167,44,0.4); }

/* ===== Product Cards ===== */
.product-card {
  border:1px solid var(--primary-color);
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 2px 6px rgba(0,0,0,0.05);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor:pointer;
  background:#fff;
  display:flex;
  flex-direction:column;
  margin-bottom:20px;
}
.row > .col {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.product-card:hover {
  transform:translateY(-5px);
  box-shadow:0 6px 18px rgba(243,167,44,0.25);
}

/* ===== Image Slider ===== */
.image-slider { 
  position:relative; 
  overflow:hidden; 
  height:180px; 
  background: #f8f9fa;
}
.image-slider img { 
  display:block; 
  width:100%; 
  height:100%; 
  object-fit:cover; 
  z-index: 1; 
  position: relative;
  transition: opacity 0.3s ease;
}

.slider-arrow {
  position:absolute; 
  top:50%; 
  transform:translateY(-50%);
  background:rgba(0,0,0,0.6); 
  color:#fff; 
  border:none;
  width: 32px;
  height: 32px;
  border-radius:50%; 
  cursor:pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition:0.2s;
  font-weight: bold;
}
.slider-arrow:hover { 
  background:rgba(0,0,0,0.8); 
  transform: translateY(-50%) scale(1.1);
}
.slider-arrow.left{left:8px;} 
.slider-arrow.right{right:8px;}

/* ===== Card Body Link ===== */
.card-body-link { 
  text-decoration:none; 
  flex:1; 
  display:flex; 
  flex-direction:column; 
  padding:12px;
}
.card-title { 
  font-size:16px; 
  font-weight:600; 
  margin-bottom: 8px;
  color: #333;
}
.price { 
  color:#092845; 
  font-weight:600; 
  font-size:15px; 
  margin-top:auto; 
}
.timestamp { 
  font-size:12px; 
  color:#888; 
  margin-bottom: 4px;
}
.location {
  font-size: 14px;
  color: #666;
  margin-bottom: 4px;
}

/* ===== Category Cards ===== */
.category-card {
  border:2px solid var(--primary-color);
  border-radius:12px;
  background:#fffbea;
  cursor:pointer;
  transition:.3s;
  box-shadow:0 2px 6px rgba(0,0,0,0.05);
  height: 100%;
}
.category-card:hover {
  background:var(--primary-color); 
  color:#fff;
  transform:translateY(-5px);
  box-shadow:0 6px 18px rgba(243,167,44,0.3);
}
.cat-img { 
  width:100%; 
  height:120px; 
  object-fit:cover; 
  border-radius:8px; 
}

/* ===== Image Preview in Modal ===== */
#imagePreview { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 8px; 
  margin-top: 8px;
}
.preview-box { 
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #dee2e6;
}
.preview-box img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
}
.preview-box .btn-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(220, 53, 69, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ===== Form Validation ===== */
.is-invalid {
  border-color: #dc3545 !important;
}
.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #dc3545;
}

/* ===== Responsive ===== */
@media(max-width:767px){
  .store-buttons { width:100%; justify-content:flex-start; margin-bottom:10px; }
  #searchInput, #categoryFilter { width:100% !important; margin-bottom:8px; }
  .image-slider { height:150px; }
  .slider-arrow {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
}

.status-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  z-index: 5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-approved { background:#28a745; }
.status-pending { background:#ffc107; color:#092845; }
.status-rejected { background:#dc3545; }

/* Preview boxes used by JS */
.existing-preview[data-removed="1"] { 
  opacity:0.5; 
  filter:grayscale(100%);
}
.existing-remove-btn { 
  background:rgba(220, 53, 69, 0.9); 
  color:white; 
  border-radius:4px; 
  border:none; 
  padding:2px 6px; 
  cursor:pointer;
  font-size: 10px;
}