.category-modal {
  display: flex;
  position: fixed;
  top: 100px;
  left: 0;
  width: 100vw;
  height: 800px;
  z-index: 9999;
  background: transparent;
  justify-content: center;
  align-items: flex-start;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: scroll;
}

.category-modal.active {
  opacity: 1;
  visibility: visible;
}

.category-modal__content {
  width: 100vw;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 25px;
  box-sizing: border-box;
  overflow: hidden;
  background: #A31C38;
  transform: translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-modal.active .category-modal__content {
  transform: translateY(0);
}

.category-modal__header {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 24px 32px 0 0;
  position: sticky;
  top: 0;
  background: transparent;
  z-index: 1;
}

.category-modal__itemWrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
  box-sizing: border-box;
  flex: 1;
}

.category-modal__categories {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 20px;
  max-width: 1200px;
  width: 100%;
  margin-top: 20px;
}

.category-modal__main-categories {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1px;
  margin-bottom: 0;
  margin-top: 0;
  flex-wrap: wrap;
  max-width: 100%;
}

.category-modal__main-buttons {
  width: 1200px;
  padding-left: 95px;
}

.category-modal__main-category {
  background: #861A32;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100px;
  min-width: 100px;
  height: 140px;
  cursor: pointer;
  padding: 18px 0 8px 0;
  border-bottom: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 0;
  flex-shrink: 0;
}

.category-modal__main-category:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.category-modal__main-category.is-active {
  background: #6D1423;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.category-modal__main-category-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.category-modal__main-category-icon,
.category-modal__subcategory-icon {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  display: block;
  background: #fff;
}

.category-modal__main-category-label {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  margin-top: 4px;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.category-modal__products-list {
  display: flex;
  flex-direction: column;
  min-height: 260px;
  width: 1009px;
  background: #6D1423;
  box-sizing: border-box;
  position: relative;
  justify-content: flex-start;
  padding: 20px;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-modal__products-list[style*="display: none"] {
  opacity: 0;
  transform: translateX(10px);
}

.category-modal__all-link-wrap {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  margin-top: auto;
  margin-bottom: 0;
  position: absolute;
  bottom: 32px;
  right: 0;
  left: 0;
  padding-right: 32px;
  background: transparent;
  box-sizing: border-box;
}

.category-modal__all-link {
  color: #fff;
  font-size: 1.0rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 16px;
  padding: 4px 16px;
}

.category-modal__all-link:hover {
  background: #fff;
  color: #8B0024;
}

.category-modal__products-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
  width: 100%;
}

.category-modal__subcategory {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 65px;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  padding: 0 8px;
  box-sizing: border-box;
  gap: 15px;
}

.category-modal__subcategory-label {
  color: #1F272F;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  margin-right: auto;
}

.category-modal__bottom-buttons {
  width: 1250px;
  max-width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  margin-bottom: 0;
  padding-left: 0;
}

.category-modal__bottom-btn {
  display: inline-block;
  text-align: center;
  width: 200px;
  height: 60px;
  background: #A31C38;
  color: #fff;
  border: 1px solid #fff;
  font-size: 16px;
  font-weight: bold;
  border-radius: 0;
  outline: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.05em;
  line-height: 60px;
}

.category-modal__bottom-btn:hover {
  background: #fff;
  color: #A31C38;
}

.category-modal__close {
  position: absolute;
  top: 24px;
  right: 32px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

.category-modal__close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

.category-modal__close:active {
  transform: scale(0.95);
}

/* Search Section Styles */
.category-modal__search-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px;
  margin-bottom: 40px;
  padding: 0 20px;
  box-sizing: border-box;
  flex-shrink: 0;
  max-width: 1060px;
}

.category-modal__search-label {
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 16px;
  font-style: italic;
  letter-spacing: 0.1em;
  align-self: flex-start;
  margin-left: 0;
}

.category-modal__form {
  display: flex;
  width: 100%;
  height: 62px;
  align-items: center;
  gap: 20px;
  max-width: 100%;
  margin: 0;
}

.category-modal__input {
  flex: 1;
  padding: 18px 24px;
  border-radius: 32px !important;
  border: none;
  font-size: 1.3rem;
  outline: none;
  background: #fff;
}

.category-modal__button {
  background: transparent;
  border: 2px solid #fff;
  border-radius: 50% !important;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
  margin-left: 0 !important;
}

.category-modal__button:hover {
  background: rgba(255,255,255,0.1);
}

.category-modal__icon {
  width: 24px;
  height: 24px;
  display: block;
}

/* Hide category modal on screens smaller than 1060px */
@media screen and (max-width: 1059px) {
  .category-modal {
    display: none !important;
  }
}
