/* ============================================
   CATEGORY PAGES - SHARED STYLES
   ============================================ */

.category-main {
  background-color: #f9fafb;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   HERO SECTIONS - CATEGORY SPECIFIC
   ============================================ */

.category-hero {
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-family: var(--body);
  font-size: 3rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-family: var(--body);
  font-size: 1.125rem;
  font-weight: 400;
  color: #667085;
  margin: 0;
  max-width: 600px;
}

.hero-decorative {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.deco-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
  animation: float 6s ease-in-out infinite;
}

.deco-1 {
  width: 300px;
  height: 300px;
  top: -100px;
  right: -100px;
}

.deco-2 {
  width: 200px;
  height: 200px;
  bottom: -50px;
  right: 10%;
  animation-delay: 2s;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(20px); }
}

/* ============================================
   CATEGORY: ART & DESIGN
   ============================================ */

.category-art-design .category-hero {
  background: linear-gradient(135deg, #fafbff 0%, #f0e6ff 100%);
}

.category-art-design .hero-title {
  color: #2d1b4e;
}

.category-art-design .hero-subtitle {
  color: #6b5a7a;
}

.category-art-design .deco-circle {
  background: linear-gradient(135deg, #9f7aea 0%, #d6bcfa 100%);
}

.category-art-design .item-card {
  border: 2px solid #f0e6ff;
  background: linear-gradient(135deg, #ffffff 0%, #faf8ff 100%);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-art-design .item-card:hover {
  border-color: #9f7aea;
  box-shadow: 0 20px 40px rgba(159, 122, 234, 0.2);
  transform: translateY(-8px) rotate(1deg);
}

.category-art-design .item-type-badge {
  background: linear-gradient(135deg, #9f7aea 0%, #d6bcfa 100%);
  color: white;
}

.category-art-design .search-button {
  background: linear-gradient(135deg, #9f7aea 0%, #d6bcfa 100%);
  border: none;
}

.category-art-design .search-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(159, 122, 234, 0.3);
}

.category-art-design .filter-select:focus {
  border-color: #9f7aea;
  box-shadow: 0 0 0 3px rgba(159, 122, 234, 0.1);
}

.category-art-design .button {
  background: linear-gradient(135deg, #9f7aea 0%, #d6bcfa 100%);
  border: none;
  color: white;
}

.category-art-design .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(159, 122, 234, 0.3);
}

/* ============================================
   CATEGORY: AUTOMOBILES
   ============================================ */

.category-automobiles .category-hero {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.category-automobiles .hero-title {
  color: #ffffff;
}

.category-automobiles .hero-subtitle {
  color: #b0b0b0;
}

.category-automobiles .deco-circle {
  background: linear-gradient(135deg, #ff6b35 0%, #ffa500 100%);
}

.category-automobiles .item-card {
  border: 2px solid #333333;
  background: linear-gradient(135deg, #1a1a1a 0%, #262626 100%);
  transition: all 0.3s ease;
}

.category-automobiles .item-card:hover {
  border-color: #ff6b35;
  box-shadow: 0 20px 40px rgba(255, 107, 53, 0.3);
  transform: translateY(-8px);
}

.category-automobiles .item-title,
.category-automobiles .item-price {
  color: #ffffff;
}

.category-automobiles .item-author {
  color: #909090;
}

.category-automobiles .item-type-badge {
  background: linear-gradient(135deg, #ff6b35 0%, #ffa500 100%);
}

.category-automobiles .search-button {
  background: linear-gradient(135deg, #ff6b35 0%, #ffa500 100%);
}

.category-automobiles .search-button:hover {
  box-shadow: 0 8px 16px rgba(255, 107, 53, 0.4);
}

.category-automobiles .filter-select {
  background-color: #262626;
  border: 2px solid #333333;
  color: #ffffff;
  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='%23ffffff' 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");
}

.category-automobiles .filter-select:focus {
  border-color: #ff6b35;
  background-color: #262626;
}

.category-automobiles .button {
  background: linear-gradient(135deg, #ff6b35 0%, #ffa500 100%);
  color: white;
}

/* ============================================
   CATEGORY: WATCHES
   ============================================ */

.category-watches .category-hero {
  background: linear-gradient(135deg, #f5f5f5 0%, #e8d5c4 100%);
}

.category-watches .hero-title {
  color: #3d2817;
}

.category-watches .hero-subtitle {
  color: #8b6f47;
}

.category-watches .deco-circle {
  background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
}

.category-watches .item-card {
  border: 2px solid #e8d5c4;
  background: linear-gradient(135deg, #ffffff 0%, #faf8f3 100%);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.1);
}

.category-watches .item-card:hover {
  border-color: #d4af37;
  box-shadow: 0 20px 40px rgba(212, 175, 55, 0.25);
  transform: translateY(-6px) scale(1.02);
}

.category-watches .item-type-badge {
  background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
  color: #3d2817;
}

.category-watches .search-button {
  background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
  color: #3d2817;
  font-weight: 600;
}

.category-watches .search-button:hover {
  box-shadow: 0 8px 16px rgba(212, 175, 55, 0.3);
}

.category-watches .filter-select:focus {
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.category-watches .button {
  background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
  color: #3d2817;
}

/* ============================================
   CATEGORY: JEWELRY
   ============================================ */

.category-jewelry .category-hero {
  background: linear-gradient(135deg, #fff5f7 0%, #ffe4e6 100%);
}

.category-jewelry .hero-title {
  color: #831843;
}

.category-jewelry .hero-subtitle {
  color: #be185d;
}

.category-jewelry .deco-circle {
  background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
}

.category-jewelry .item-card {
  border: 2px solid #ffe4e6;
  background: linear-gradient(135deg, #ffffff 0%, #fff8fa 100%);
  transition: all 0.3s ease;
}

.category-jewelry .item-card:hover {
  border-color: #ec4899;
  box-shadow: 0 20px 40px rgba(236, 72, 153, 0.2);
  transform: translateY(-8px);
}

.category-jewelry .item-type-badge {
  background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
}

.category-jewelry .search-button {
  background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
}

.category-jewelry .button {
  background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
}

/* ============================================
   CATEGORY: FASHION
   ============================================ */

.category-fashion .category-hero {
  background: linear-gradient(135deg, #fef3f2 0%, #fee2e2 100%);
}

.category-fashion .hero-title {
  color: #7c2d12;
}

.category-fashion .hero-subtitle {
  color: #b45309;
}

.category-fashion .deco-circle {
  background: linear-gradient(135deg, #f97316 0%, #fdba74 100%);
}

.category-fashion .item-card {
  border: 2px solid #fee2e2;
  background: linear-gradient(135deg, #ffffff 0%, #fffbfa 100%);
  transition: all 0.3s ease;
}

.category-fashion .item-card:hover {
  border-color: #f97316;
  box-shadow: 0 20px 40px rgba(249, 115, 22, 0.2);
  transform: translateY(-8px);
}

.category-fashion .item-type-badge {
  background: linear-gradient(135deg, #f97316 0%, #fdba74 100%);
  color: #7c2d12;
}

.category-fashion .search-button {
  background: linear-gradient(135deg, #f97316 0%, #fdba74 100%);
  color: #7c2d12;
}

.category-fashion .button {
  background: linear-gradient(135deg, #f97316 0%, #fdba74 100%);
  color: #7c2d12;
}

/* ============================================
   CATEGORY: REAL ESTATE
   ============================================ */

.category-real-estate .category-hero {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.category-real-estate .hero-title {
  color: #065f46;
}

.category-real-estate .hero-subtitle {
  color: #047857;
}

.category-real-estate .deco-circle {
  background: linear-gradient(135deg, #10b981 0%, #6ee7b7 100%);
}

.category-real-estate .item-card {
  border: 2px solid #d1fae5;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  transition: all 0.3s ease;
}

.category-real-estate .item-card:hover {
  border-color: #10b981;
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.2);
  transform: translateY(-8px);
}

.category-real-estate .item-type-badge {
  background: linear-gradient(135deg, #10b981 0%, #6ee7b7 100%);
  color: white;
}

.category-real-estate .search-button {
  background: linear-gradient(135deg, #10b981 0%, #6ee7b7 100%);
  color: white;
}

.category-real-estate .button {
  background: linear-gradient(135deg, #10b981 0%, #6ee7b7 100%);
  color: white;
}

/* ============================================
   CATEGORY: WATER TRANSPORT
   ============================================ */

.category-water-transport .category-hero {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.category-water-transport .hero-title {
  color: #0c4a6e;
}

.category-water-transport .hero-subtitle {
  color: #0369a1;
}

.category-water-transport .deco-circle {
  background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
}

.category-water-transport .item-card {
  border: 2px solid #e0f2fe;
  background: linear-gradient(135deg, #ffffff 0%, #f8fcfd 100%);
  transition: all 0.3s ease;
}

.category-water-transport .item-card:hover {
  border-color: #0ea5e9;
  box-shadow: 0 20px 40px rgba(14, 165, 233, 0.2);
  transform: translateY(-8px);
}

.category-water-transport .item-type-badge {
  background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
  color: white;
}

.category-water-transport .search-button {
  background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
  color: white;
}

.category-water-transport .button {
  background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
  color: white;
}

/* ============================================
   CATEGORY: APPLIED ARTS
   ============================================ */

.category-applied-arts .category-hero {
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
}

.category-applied-arts .hero-title {
  color: #831843;
}

.category-applied-arts .hero-subtitle {
  color: #be185d;
}

.category-applied-arts .deco-circle {
  background: linear-gradient(135deg, #db2777 0%, #f472b6 100%);
}

.category-applied-arts .item-card {
  border: 2px solid #fce7f3;
  background: linear-gradient(135deg, #ffffff 0%, #fdf8fc 100%);
  transition: all 0.3s ease;
}

.category-applied-arts .item-card:hover {
  border-color: #db2777;
  box-shadow: 0 20px 40px rgba(219, 39, 119, 0.2);
  transform: translateY(-8px);
}

.category-applied-arts .item-type-badge {
  background: linear-gradient(135deg, #db2777 0%, #f472b6 100%);
  color: white;
}

.category-applied-arts .search-button {
  background: linear-gradient(135deg, #db2777 0%, #f472b6 100%);
  color: white;
}

.category-applied-arts .button {
  background: linear-gradient(135deg, #db2777 0%, #f472b6 100%);
  color: white;
}

/* ============================================
   SHARED FILTERS & LAYOUT STYLES
   ============================================ */

.filters-section {
  background: var(--white);
  padding: 2rem 0;
  border-bottom: 1px solid #e4e7ec;
  margin-bottom: 2rem;
}

.filters-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.search-row {
  display: flex;
  gap: 1rem;
}

.filters-wrapper .search-row {
  display: block;
}

.filters-wrapper .search-row .search-input {
  width: 100%;
}

.filters-wrapper .search-row .search-button {
  display: none !important;
}

.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;
}

.filters-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  align-items: flex-end;
}

.gm-filters-toggle {
  display: none;
  width: 100%;
  border: 1px solid #d7e2ec;
  background: #fff;
  color: #011825;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font-family: var(--body);
  font-size: 0.9rem;
  font-weight: 600;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
}

.gm-filters-count {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #f2f4f7;
  border: 1px solid #e4e7ec;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #011825;
}

.gm-filters-toggle.has-active .gm-filters-count {
  background: #011825;
  border-color: #011825;
  color: #fff;
}

.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:focus {
  background-color: var(--white);
  border-color: var(--black);
  outline: none;
}

@media (min-width: 992px) {
  .category-main {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    column-gap: 1.5rem;
    align-items: start;
    max-width: 1480px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }

  .category-main .category-hero {
    grid-column: 1 / -1;
  }

  .category-main .filters-section {
    grid-column: 1;
    grid-row: 2 / span 2;
    background: transparent;
    border-bottom: 0;
    padding: 0;
    margin: 0;
  }

  .category-main .filters-section .container-large,
  .category-main .items-section .container-large,
  .category-main .pagination-section .container-large {
    max-width: none;
    width: 100%;
  }

  .category-main .filters-section .padding-global,
  .category-main .items-section .padding-global,
  .category-main .pagination-section .padding-global {
    padding-left: 8px;
    padding-right: 8px;
  }

  .category-main .filters-wrapper {
    position: sticky;
    top: 88px;
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    padding: 0.75rem;
    box-shadow: 0 10px 24px rgba(1, 24, 37, 0.08);
    gap: 0.75rem;
  }

  .category-main .filters-wrapper,
  .category-main .filters-wrapper * {
    box-sizing: border-box;
  }

  .category-main .filters-wrapper .search-input,
  .category-main .filters-wrapper .filter-select,
  .category-main .filters-wrapper .price-range-container,
  .category-main .filters-wrapper .price-input,
  .category-main .filters-wrapper .button,
  .category-main .filters-wrapper .button-secondary {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .category-main .filters-wrapper .search-input,
  .category-main .filters-wrapper .filter-select,
  .category-main .filters-wrapper .price-input {
    padding-top: 0.68rem;
    padding-bottom: 0.68rem;
    font-size: 0.85rem;
  }

  .category-main .filters-wrapper .price-inputs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.35rem;
  }

  .category-main .filters-wrapper .price-range-container label {
    font-size: 0.68rem;
  }

  .category-main .filters-section.gm-desktop-fixed .filters-wrapper {
    position: static;
    top: auto;
  }

  .category-main .filters-section.gm-desktop-fixed {
    position: fixed !important;
    top: 88px;
    z-index: 220;
  }

  .category-main .filters-row {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .category-main .items-section {
    grid-column: 2;
    grid-row: 2;
    margin-bottom: 1rem;
  }

  .category-main .items-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.1rem;
  }

  .category-main .pagination-section {
    grid-column: 2;
    grid-row: 3;
  }
}

/* ============================================
   ITEMS GRID & CARDS
   ============================================ */

.items-section {
  margin-bottom: 2rem;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2rem;
}

@media (max-width: 991px) {
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 767px) {
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
}

.item-card {
  background-color: var(--white);
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.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.08);
}

.item-type-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  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;
  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;
}

.item-stats {
  font-size: 0.75rem;
  color: #667085;
  padding-top: 0.5rem;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination-section {
  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;
}

/* ============================================
   MODALS
   ============================================ */

.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;
  overflow-x: hidden;
}

.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;
  border: 1px solid #e4e7ec;
  box-shadow: 0 24px 56px rgba(1, 24, 37, 0.18);
}

@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 MODAL
   ============================================ */

.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: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 2rem;
  width: 100%;
  min-width: 0;
}

@media (max-width: 1200px) {
  .item-detail-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.item-detail-image {
  width: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.image-gallery-container {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #f8fafc;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  padding: 12px;
}

.detail-image {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  border-radius: 8px;
  background-color: #f9fafb;
  cursor: zoom-in;
  transition: all 0.3s ease;
}

.detail-image:hover {
  transform: scale(1.02);
}

.detail-image.zoomed {
  cursor: zoom-out;
  max-height: 90vh;
  object-fit: contain;
  transform: scale(1);
}

.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, transform 0.2s ease, box-shadow 0.2s ease;
}

.image-thumbnail:hover {
  border-color: var(--black);
  transform: translateY(-1px);
}

.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;
}

.item-detail-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.gm-item-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.gm-item-meta-entry {
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #f9fafb;
  padding: 0.55rem 0.65rem;
}

.gm-item-meta-entry span {
  display: block;
  font-size: 0.68rem;
  color: #667085;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.gm-item-meta-entry strong {
  display: block;
  font-size: 0.84rem;
  color: var(--black);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.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;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-stats {
  display: flex;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e4e7ec;
  flex-wrap: wrap;
}

.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);
}

.detail-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.detail-actions .button {
  flex: 1;
  min-width: 120px;
  padding: 0.875rem 1.5rem;
}

.gm-item-extra-actions {
  display: flex;
  gap: 0.55rem;
  width: 100%;
}

.gm-item-secondary-btn {
  flex: 1;
  padding: 0.65rem 0.8rem;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
  color: #011825;
  font-family: var(--body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.gm-item-secondary-btn:hover {
  border-color: #011825;
}

.button-secondary {
  background-color: #f2f4f7;
  color: var(--black);
  border: 1px solid #e4e7ec;
}

.button-secondary:hover {
  background-color: #e4e7ec;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .gm-filters-toggle {
    display: inline-flex;
  }

  .filters-row {
    grid-template-columns: 1fr;
    display: none;
    border: 1px solid #e4e7ec;
    background: #fff;
    border-radius: 12px;
    padding: 0.75rem;
  }

  .filters-row.is-open {
    display: grid;
  }

  .filters-row > * {
    min-width: 0;
    max-width: 100%;
  }

  .search-row {
    flex-direction: column;
  }

  .filters-wrapper .search-row {
    display: flex;
  }

  .filters-section.gm-mobile-fixed .search-row {
    display: none !important;
  }

  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
  }

  .item-detail-content {
    padding: 1rem;
  }

  .filters-section {
    position: sticky;
    top: auto;
    bottom: 0;
    z-index: 180;
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 14px rgba(1, 24, 37, 0.08);
    padding: 1rem 0;
    margin-bottom: 1rem;
  }

  .filters-section.gm-mobile-fixed {
    position: fixed !important;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    margin-bottom: 0 !important;
    z-index: 220;
  }

  .gm-filters-spacer {
    display: block;
    width: 100%;
    height: 0;
    pointer-events: none;
  }

  .filters-wrapper {
    gap: 0.75rem;
  }

  .search-button,
  .filters-row .button,
  .filters-row .button-secondary {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    white-space: normal;
  }

  #clearFiltersBtn {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .price-inputs {
    gap: 0.35rem;
  }

  .price-input {
    min-width: 0;
  }

  .items-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .item-card {
    border-radius: 12px;
  }

  .item-image-container {
    aspect-ratio: 1 / 1;
  }

  .item-info {
    padding: 0.7rem;
  }

  .item-title {
    font-size: 0.82rem;
  }

  .item-price {
    font-size: 0.92rem;
  }

  .item-actions {
    gap: 0.35rem;
  }

  .item-action-btn {
    width: 28px;
    height: 28px;
  }

  .modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-footer .button {
    width: 100%;
  }

  .cart-item {
    flex-direction: column;
  }

  .cart-item-image {
    width: 100%;
    height: 170px;
  }

  .item-detail-content {
    gap: 1rem;
  }

  .detail-image {
    max-height: 62vh;
    border-radius: 10px;
  }

  #itemModal.modal {
    padding: 0;
    align-items: flex-end;
  }

  #itemModal .item-detail-modal {
    width: 100%;
    max-width: none;
    height: min(92dvh, 92vh);
    max-height: none;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
  }

  #itemModal .modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--white);
    padding: 0.85rem 1rem;
  }

  #itemModal .modal-close {
    width: 36px;
    height: 36px;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    background: #fff;
  }

  #itemModal .item-detail-content {
    height: calc(100% - 58px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.9rem 1rem 1rem;
    gap: 0.85rem;
  }

  #itemModal .detail-image {
    max-height: 42dvh;
  }

  #itemModal .detail-image:hover {
    transform: none;
  }

  #itemModal .image-gallery-thumbnails {
    gap: 0.4rem;
    padding: 0.3rem 0 0.1rem;
    overflow-x: visible;
    flex-wrap: wrap;
  }

  #itemModal .detail-title {
    font-size: 1.25rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  #itemModal .detail-price {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  #itemModal .price-value {
    font-size: 1.9rem;
    line-height: 1;
  }

  #itemModal .detail-actions .button {
    width: 100%;
    min-width: 0;
  }

  .gm-item-meta {
    grid-template-columns: 1fr;
  }

  .gm-item-extra-actions {
    flex-direction: column;
  }

  .image-thumbnail {
    width: 72px;
    height: 72px;
  }
}

@media (max-width: 520px) {
  .filters-section {
    top: auto;
    bottom: 0;
  }

  .filters-section.gm-mobile-fixed {
    top: auto;
    bottom: 0;
  }

  .hero-title {
    font-size: 1.55rem;
  }

  .hero-subtitle {
    font-size: 0.92rem;
  }

  .items-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .item-card {
    max-width: 420px;
    margin: 0 auto;
  }

  .item-image-container {
    aspect-ratio: 4 / 3;
  }

  .item-info {
    padding: 0.85rem;
  }

  .item-title {
    font-size: 0.9rem;
  }

  .item-price {
    font-size: 1rem;
  }

  .detail-image {
    max-height: 56vh;
  }

  #itemModal .item-detail-modal {
    height: 100dvh;
    border-radius: 0;
  }

  #itemModal .item-detail-content {
    padding: 0.75rem 0.85rem 0.95rem;
  }

  #itemModal .item-detail-info,
  #itemModal .detail-description,
  #itemModal .detail-stats,
  #itemModal .detail-actions {
    min-width: 0;
    width: 100%;
  }

  #itemModal .detail-image {
    max-height: 38dvh;
  }

  #itemModal .image-gallery-thumbnails {
    padding-top: 0.2rem;
  }

  #itemModal .detail-title {
    font-size: 1.1rem;
  }

  #itemModal .price-value {
    font-size: 1.7rem;
  }

  .image-thumbnail {
    width: 64px;
    height: 64px;
  }

  .pagination-controls {
    flex-direction: column;
    gap: 0.75rem;
  }

  .pagination-button {
    width: 100%;
  }
}
