/* Marketplace Page Styles */

.marketplace-main {
  background-color: #f9fafb;
  min-height: 100vh;
  padding: 2rem 0;
}

/* Marketplace Header */
.marketplace-header {
  background: var(--white);
  padding: 3rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid #e4e7ec;
}

.marketplace-title {
  font-family: var(--body);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--black);
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.marketplace-subtitle {
  font-family: var(--body);
  font-size: 1.125rem;
  font-weight: 400;
  color: #667085;
  margin: 0 0 2rem 0;
}

/* Marketplace Controls */
.marketplace-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.search-container {
  display: flex;
  gap: 1rem;
}

.search-input {
  flex: 1;
  padding: 0.875rem 1rem;
  font-family: var(--body);
  font-size: 1rem;
  background-color: #f2f4f7;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  color: var(--black);
  transition: all 0.2s ease;
}

.search-input::placeholder {
  color: #a3a3a3;
}

.search-input:focus {
  background-color: var(--white);
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(1, 24, 37, 0.05);
  outline: none;
}

.search-button {
  padding: 0.875rem 2rem;
  background-color: var(--black);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-family: var(--body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-button:hover {
  background-color: var(--grey);
  transform: translateY(-2px);
}

.filters-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  align-items: flex-end;
}

.filter-select {
  padding: 0.875rem 1rem;
  background-color: #f2f4f7;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  font-family: var(--body);
  font-size: 0.875rem;
  color: var(--black);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23011825' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1.25em;
  padding-right: 2rem;
  transition: all 0.2s ease;
}

.filter-select:hover {
  border-color: var(--black);
}

.filter-select:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(1, 24, 37, 0.05);
}

.price-range-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.price-range-container label {
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 600;
  color: #667085;
  text-transform: uppercase;
}

.price-inputs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.price-input {
  flex: 1;
  padding: 0.75rem 0.875rem;
  font-family: var(--body);
  font-size: 0.875rem;
  background-color: #f2f4f7;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  color: var(--black);
  transition: all 0.2s ease;
}

.price-input::placeholder {
  color: #a3a3a3;
}

.price-input:focus {
  background-color: var(--white);
  border-color: var(--black);
  outline: none;
}

.price-inputs span {
  color: #a3a3a3;
}

.filters-apply-btn {
  width: 100%;
  padding: 0.875rem;
}

.filters-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

/* Items Grid */
.marketplace-items {
  margin-bottom: 2rem;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 991px) {
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 767px) {
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.875rem;
  }
}

.loading-message,
.error-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: #667085;
  font-size: 0.875rem;
}

.error-message {
  color: #d32f2f;
}

/* Item Card */
.item-card {
  background-color: var(--white);
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.item-card:hover {
  border-color: var(--black);
  box-shadow: 0 8px 24px rgba(1, 24, 37, 0.12);
  transform: translateY(-4px);
}

.item-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background-color: #f2f4f7;
}

.item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.item-card:hover .item-image {
  transform: scale(1.05);
}

.item-type-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background-color: var(--black);
  color: var(--white);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-family: var(--body);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.item-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.item-title {
  font-family: var(--body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--black);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.item-author {
  font-family: var(--body);
  font-size: 0.75rem;
  color: #667085;
  margin: 0;
}

.item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid #e4e7ec;
}

.item-price {
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--black);
}

.item-actions {
  display: flex;
  gap: 0.5rem;
}

.item-action-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  background: none;
  border: 1px solid #e4e7ec;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-action-btn:hover {
  border-color: var(--black);
  background-color: #f2f4f7;
}

/* Pagination */
.marketplace-pagination {
  background: var(--white);
  padding: 2rem 0;
  border-top: 1px solid #e4e7ec;
}

.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

.pagination-button {
  padding: 0.75rem 1.5rem;
  background-color: var(--white);
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  font-family: var(--body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--black);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-button:hover:not(:disabled) {
  border-color: var(--black);
  background-color: #f2f4f7;
}

.pagination-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  font-family: var(--body);
  font-size: 0.875rem;
  color: #667085;
  font-weight: 500;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(1, 24, 37, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.modal-content {
  background-color: var(--white);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(1, 24, 37, 0.15);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.item-detail-modal {
  max-width: 1000px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e4e7ec;
}

.modal-title {
  font-family: var(--body);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--black);
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  background-color: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--black);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background-color: #f2f4f7;
  border-radius: 6px;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid #e4e7ec;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* Cart */
.cart-items {
  padding: 1.5rem;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.empty-cart {
  text-align: center;
  color: #667085;
  font-size: 0.875rem;
  padding: 2rem 0;
  margin: 0;
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background-color: #f9fafb;
  border-radius: 6px;
  border: 1px solid #e4e7ec;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  background-color: #f2f4f7;
}

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cart-item-info h4 {
  font-family: var(--body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--black);
  margin: 0;
}

.cart-item-info p {
  font-family: var(--body);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--black);
  margin: 0;
}

.cart-item-remove {
  padding: 0.5rem 1rem;
  background-color: transparent;
  border: 1px solid #e4e7ec;
  border-radius: 4px;
  font-family: var(--body);
  font-size: 0.75rem;
  color: #d32f2f;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cart-item-remove:hover {
  background-color: #ffebee;
  border-color: #d32f2f;
}

.cart-total {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.total-label {
  font-family: var(--body);
  font-size: 0.875rem;
  font-weight: 500;
  color: #667085;
}

.total-price {
  font-family: var(--body);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--black);
}

.modal-footer .button {
  padding: 0.875rem 1.5rem;
  white-space: nowrap;
}

/* Item Detail Modal */
.item-detail-content {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  grid-template-rows: auto auto;
}

@media (max-width: 1200px) {
  .item-detail-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.item-detail-image {
  width: 100%;
  display: flex;
  flex-direction: column;
  grid-column: 1;
  grid-row: 1;
}

.detail-image {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  border-radius: 8px;
  background-color: #f9fafb;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.detail-image:hover {
  transform: scale(1.02);
}

.item-detail-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  grid-column: 1;
  grid-row: 2;
}

.detail-title {
  font-family: var(--body);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--black);
  margin: 0;
}

.detail-author {
  font-family: var(--body);
  font-size: 0.875rem;
  color: #667085;
  margin: 0;
}

.detail-price {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}

.price-value {
  font-family: var(--body);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--black);
}

.price-currency {
  font-family: var(--body);
  font-size: 0.875rem;
  font-weight: 500;
  color: #667085;
}

.detail-description {
  font-family: var(--body);
  font-size: 0.875rem;
  color: #667085;
  line-height: 1.6;
  margin: 0;
}

.auction-info {
  padding: 1rem;
  background-color: #f9fafb;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
}

.auction-info p {
  font-family: var(--body);
  font-size: 0.875rem;
  margin: 0.5rem 0;
}

.auction-info strong {
  font-weight: 600;
  color: var(--black);
}

.detail-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.detail-actions .button {
  flex: 1;
  min-width: 120px;
}

.detail-stats {
  display: flex;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e4e7ec;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-family: var(--body);
  font-size: 0.75rem;
  color: #667085;
  text-transform: uppercase;
  font-weight: 500;
}

.stat-value {
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--black);
}

/* Image Gallery Styles */
.image-gallery-container {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.image-gallery-thumbnails {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0;
}

.image-thumbnail {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid #e4e7ec;
  transition: border-color 0.2s ease;
}

.image-thumbnail:hover {
  border-color: var(--black);
}

.image-thumbnail.active {
  border-color: var(--black);
  box-shadow: 0 0 0 2px white, 0 0 0 4px var(--black);
}

.image-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Zoom Modal */
.zoom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.98);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.zoom-modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.zoom-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 2rem;
  color: white;
  cursor: pointer;
  z-index: 10001;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.zoom-close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.zoom-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  position: relative;
}

.zoom-image {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  cursor: grab;
  transition: transform 0.1s linear;
}

.zoom-image:active {
  cursor: grabbing;
}

.zoom-info {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 2rem;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50px;
  backdrop-filter: blur(10px);
  z-index: 10002;
}

.image-counter {
  color: white;
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
}

.zoom-hint {
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--body);
  font-size: 0.875rem;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .zoom-info {
    bottom: 15px;
    padding: 0.75rem 1.5rem;
    gap: 1rem;
  }

  .zoom-hint {
    display: none;
  }

  .zoom-close {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
}
