/* Общие стили и сброс */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

a {
  text-decoration: none;
  transition: color 0.3s ease;
}

button {
  cursor: pointer;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 1rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Стили для общей шапки страницы --- */
.page-header-section {
  padding: 40px 20px 20px;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.page-header-content {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.back-to-shop-btn {
  background: none;
  font-size: 1.1rem;
  /* padding: 0; */
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s ease;
  align-self: flex-start;
  border: 1px solid #ccc;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.back-to-shop-btn i {
  font-size: 1.2rem;
}

.back-to-shop-btn:hover {}

.page-title {
  font-size: 3rem;
  text-align: center;
  width: 100%;
}

/* --- Стили для страницы Каталог --- */
.catalog-section {
  padding: 40px 20px;
  display: flex;
  gap: 30px;
  min-height: calc(100vh - var(--header-height, 70px) - var(--footer-height, 250px));
}

.sidebar-filters {
  flex: 0 0 280px;
  padding: 25px;
  border-radius: 8px;
  align-self: flex-start;
  position: sticky;
  top: 120px;
}

.sidebar-filters h3 {
  font-size: 1.8rem;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-filters h4 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  border-bottom: 1px solid;
  padding-bottom: 8px;
}

.filter-group {
  margin-bottom: 30px;
}

.filter-group label {
  display: block;
  font-size: 1rem;
  margin-bottom: 10px;
}

.search-box {
  display: flex;
  border: 1px solid;
  border-radius: 5px;
  overflow: hidden;
}

.search-box input {
  flex: 1;
  border: none;
  padding: 10px 15px;
  background-color: transparent;
  font-size: 1rem;
  outline: none;
}

.search-box button {
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.checkbox-list label {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  cursor: pointer;
}

.checkbox-list input[type="checkbox"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid;
  border-radius: 4px;
  margin-right: 10px;
  position: relative;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.checkbox-list input[type="checkbox"]:checked::after {
  content: "\2713";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: bold;
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.range-inputs input[type="number"] {
  width: 80px;
  padding: 8px 10px;
  border: 1px solid;
  border-radius: 5px;
  font-size: 1rem;
  text-align: center;
  -moz-appearance: textfield;
}

.range-inputs input[type="number"]::-webkit-outer-spin-button,
.range-inputs input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.range-inputs span {
  font-size: 1.2rem;
}

.price-range-display {
  text-align: center;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.price-range-display span {
  font-weight: bold;
}

.apply-filters-btn {
  width: 100%;
  margin-bottom: 15px;
}

.clear-filters-btn {
  font-weight: bold;
  padding: 12px 25px;
  width: 100%;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 0.3s ease;
}

.products-grid-container-index {
  flex: 1;
}

.products-grid-container {
  width: 100%;
}

.products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  border-radius: 8px;
  margin-bottom: 25px;
}

#product-count {
  font-size: 1.1rem;
  font-weight: bold;
}

.sort-controls label {
  margin-right: 10px;
}

.sort-controls select {
  border: 1px solid;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.3s ease;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

.catalog-products-grid-container {
  flex: 1;
}

.catalog-products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  border-radius: 8px;
  margin-bottom: 25px;
}

.catalog-category-section {
  margin-bottom: 40px;
}

.catalog-category-title {
  font-size: 1.8rem;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid;
  display: inline-block;
}

.catalog-products-scroll-container {
  width: 100%;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 25px;
}

.catalog-product-card {
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.catalog-product-card:hover {
  transform: translateY(-5px);
}

.catalog-product-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.catalog-product-image-wrapper {
  width: 100%;
  height: 220px;
  overflow: hidden;
}

.catalog-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.catalog-product-card:hover .catalog-product-image {
  transform: scale(1.05);
}

.catalog-product-info {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.catalog-product-title {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.catalog-product-category {
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.catalog-product-price {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 15px;
}

.catalog-add-to-cart-btn {
  padding: 12px 20px;
  border-radius: 0 0 8px 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 100%;
  border: none;
}

.products-scroll-container {
  width: 100%;
}

.product-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card {
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-card:hover {
  transform: translateY(-5px);
}

.product-image-wrapper {
  width: 100%;
  height: 250px;
  overflow: hidden;
  position: relative;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-title {
  font-size: 1.4rem;
  margin-bottom: 10px;
  min-height: 3.2em;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-category {
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.product-price {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 20px;
}

.add-to-cart-btn {
  padding: 12px 25px;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.no-products-message {
  text-align: center;
  font-size: 1.2rem;
  padding: 50px 20px;
  grid-column: 1 / -1;
}

.load-more-btn {
  display: block;
  margin: 40px auto 20px auto;
  padding: 15px 30px;
  font-weight: bold;
  font-size: 1.1rem;
}

/* --- Адаптивность для страницы Каталог --- */
@media (max-width: 992px) {
  .catalog-section {
    flex-direction: column;
    padding: 30px 15px;
  }

  .sidebar-filters {
    flex: none;
    width: 100%;
    position: static;
    top: auto;
    padding: 20px;
    margin-bottom: 30px;
  }

  .products-header,
  .catalog-products-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    margin-bottom: 20px;
  }

  .products-grid,
  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {

  .products-scroll-container,
  .catalog-products-scroll-container {
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .products-grid,
  .category-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
  }

  .product-card,
  .catalog-product-card {
    flex: 0 0 250px;
  }
}

@media (max-width: 600px) {
  .sidebar-filters h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }

  .sidebar-filters h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
  }

  .range-inputs {
    flex-wrap: wrap;
    justify-content: center;
  }

  .range-inputs input {
    width: 100px;
  }

  .search-box input,
  .sort-controls select {
    font-size: 0.95rem;
    padding: 8px 12px;
  }

  .product-card,
  .catalog-product-card {
    flex: 0 0 200px;
  }

  .product-card .product-title,
  .catalog-product-title {
    font-size: 1.1rem;
  }

  .product-card .product-price,
  .catalog-product-price {
    font-size: 1.3rem;
  }

  .add-to-cart-btn,
  .catalog-add-to-cart-btn {
    padding: 10px 15px;
    font-size: 0.9rem;
  }
}

/* --- Стили для страницы одного товара --- */
.product-detail-section {
  padding: 40px 20px;
  min-height: calc(100vh - var(--header-height, 70px) - var(--footer-height, 250px));
}

.product-detail-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 40px;
  border-radius: 8px;
  padding: 30px;
}

.product-image-gallery {
  flex: 0 0 500px;
  height: 500px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.main-product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.thumbnail-gallery {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  justify-content: center;
}

.thumbnail-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 2px solid;
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.thumbnail-image:hover,
.thumbnail-image.active {
  transform: translateY(-2px);
}

.product-info-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-info-panel h2 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  line-height: 1.1;
}

.product-category-detail {
  font-size: 1.1rem;
  margin-bottom: 15px;
}

.product-price-detail {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 30px;
}

.product-description-container {
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
}

.product-description-container h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-description-container p {
  font-size: 1rem;
  line-height: 1.6;
}

.quantity-selector {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  gap: 15px;
}

.quantity-selector label {
  font-size: 1.1rem;
  font-weight: bold;
}

.quantity-controls {
  display: flex;
  align-items: center;
  border: 1px solid;
  border-radius: 5px;
  overflow: hidden;
}

.quantity-controls button {
  border: none;
  padding: 10px 15px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.quantity-controls input {
  width: 60px;
  text-align: center;
  border: none;
  background-color: transparent;
  font-size: 1.1rem;
  outline: none;
  -moz-appearance: textfield;
}

.quantity-controls input::-webkit-outer-spin-button,
.quantity-controls input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.add-to-cart-detail-btn {
  font-weight: bold;
  padding: 15px 30px;
  font-size: 1.2rem;
  border-radius: 8px;
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
}

.product-delivery-info {
  padding: 20px;
  border-radius: 8px;
}

.product-delivery-info h4 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-delivery-info ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.product-delivery-info ul li {
  font-size: 0.95rem;
  margin-bottom: 5px;
}

.product-delivery-info ul li:last-child {
  margin-bottom: 0;
}

.recommended-products-section {
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.recommended-products-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.recommended-products-section .section-header h2 {
  font-size: 2.5rem;
}

.recommended-products-section .view-all-btn {
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.recommended-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 25px;
}

.no-recommendations-message {
  text-align: center;
  font-size: 1.2rem;
  padding: 50px 20px;
  grid-column: 1 / -1;
}

/* --- Адаптивность для страницы одного товара --- */
@media (max-width: 992px) {
  .product-detail-container {
    flex-direction: column;
    gap: 30px;
    padding: 20px;
  }

  .product-image-gallery {
    flex: none;
    width: 100%;
    height: 400px;
  }

  .product-info-panel {
    padding: 0;
  }

  .product-info-panel h2 {
    font-size: 2rem;
  }

  .product-price-detail {
    font-size: 2.5rem;
  }

  .quantity-selector {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .quantity-controls {
    width: 100%;
    justify-content: center;
  }

  .quantity-controls input {
    flex-grow: 1;
  }

  .add-to-cart-detail-btn {
    width: 100%;
    justify-content: center;
  }

  .recommended-products-section {
    padding: 40px 15px;
  }

  .recommended-products-section .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 30px;
  }

  .recommended-products-section .section-header h2 {
    font-size: 2rem;
  }

  .recommended-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 600px) {
  .product-detail-section {
    padding: 20px 10px;
  }

  .product-detail-container {
    padding: 15px;
    gap: 25px;
  }

  .product-image-gallery {
    height: 300px;
  }

  .product-info-panel h2 {
    font-size: 1.8rem;
  }

  .product-price-detail {
    font-size: 2.2rem;
  }

  .product-description-container {
    padding: 15px;
  }

  .product-delivery-info {
    padding: 15px;
  }

  .recommended-products-section {
    padding: 30px 10px;
  }

  .recommended-products-section .section-header h2 {
    font-size: 1.8rem;
  }

  .recommended-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }
}

.profile-section {
  padding: 60px 20px;
  min-height: calc(100vh - var(--header-height, 70px) - var(--footer-height, 250px));
}

.profile-container {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  gap: 30px;
  border-radius: 8px;
  overflow: hidden;
}

.profile-sidebar {
  flex: 0 0 280px;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-right: 1px solid;
}

.profile-avatar {
  text-align: center;
  margin-bottom: 30px;
}

.profile-avatar i {
  font-size: 5rem;
  margin-bottom: 10px;
}

.profile-avatar span {
  display: block;
  font-size: 1.4rem;
  font-weight: bold;
}

.profile-nav {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: auto;
}

.profile-nav-link {
  display: block;
  padding: 15px 20px;
  font-size: 1.1rem;
  text-decoration: none;
  border-bottom: 1px solid;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.profile-nav-link:first-child {
  border-top: 1px solid;
}

.logout-btn {
  font-weight: bold;
  padding: 12px 25px;
  width: 100%;
  border-radius: 5px;
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 0.3s ease;
}

.profile-content {
  flex: 1;
  padding: 30px;
}

.profile-tab-content {
  display: none;
}

.profile-tab-content.active {
  display: block;
}

.profile-content h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.profile-content .section-description {
  font-size: 0.95rem;
  margin-bottom: 30px;
}

.info-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px dashed;
}

.info-group:last-child {
  border-bottom: none;
}

.info-group label {
  flex: 0 0 150px;
  font-weight: bold;
  font-size: 1.05rem;
  margin-right: 20px;
}

.info-value {
  flex: 1;
  font-size: 1.05rem;
  min-width: 200px;
  padding: 5px 0;
}

.info-value.editable {
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.2s ease;
}

.info-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid;
  border-radius: 5px;
  font-size: 1.05rem;
  min-width: 200px;
}

.save-profile-btn,
.cancel-profile-btn {
  margin-top: 20px;
  padding: 12px 25px;
  border-radius: 5px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.3s ease;
}

.save-profile-btn {
  margin-right: 15px;
}

.order-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.empty-message {
  text-align: center;
  font-size: 1.1rem;
  padding: 50px 0;
}

.order-item {
  padding: 20px;
  border-radius: 8px;
}

.order-item h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-item h3 span {
  font-size: 1rem;
}

.order-item ul {
  list-style: none;
  padding: 0;
  margin: 10px 0;
  border-top: 1px dashed;
  padding-top: 10px;
}

.order-item ul li {
  padding: 5px 0;
  display: flex;
  justify-content: space-between;
}

.order-item .order-total {
  font-weight: bold;
  font-size: 1.1rem;
  margin-top: 15px;
  border-top: 1px solid;
  padding-top: 10px;
  text-align: right;
}

/* --- Адаптивность для страницы профиля --- */
@media (max-width: 992px) {
  .profile-container {
    flex-direction: column;
    gap: 20px;
    padding: 20px;
  }

  .profile-sidebar {
    flex: none;
    width: 100%;
    padding: 20px;
    border-right: none;
    border-bottom: 1px solid;
  }

  .profile-nav {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
  }

  .profile-nav-link {
    border-bottom: none;
    border-radius: 5px;
    border: 1px solid;
    padding: 10px 15px;
  }

  .profile-nav-link:first-child {
    border-top: 1px solid;
  }

  .logout-btn {
    width: auto;
    max-width: 250px;
  }

  .profile-content {
    padding: 20px 10px;
  }

  .info-group {
    flex-direction: column;
    align-items: flex-start;
  }

  .info-group label {
    flex: none;
    width: 100%;
    margin-right: 0;
    margin-bottom: 5px;
  }

  .info-value,
  .info-input {
    width: 100%;
    min-width: unset;
  }

  .save-profile-btn,
  .cancel-profile-btn {
    width: 100%;
    margin-right: 0;
    margin-bottom: 10px;
  }
}

@media (max-width: 600px) {
  .profile-content h2 {
    font-size: 1.7rem;
  }

  .order-item h3 {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .order-item h3 span {
    font-size: 0.9rem;
  }

  .order-item ul li {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
}

.header {
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  height: 50px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  position: relative;
  text-decoration: none;
}

.nav-left .nav-link::after {
  display: block;
  position: absolute;
  left: 0;
  width: 0;
  height: 2px;
  content: "";
  transition: width 0.3s ease-out;
  bottom: -2px;
}

.nav-left .nav-link:hover::after,
.nav-left .nav-link:focus::after {
  width: 100%;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 25px;
}

.cart-info,
.cart-icon,
.user-icon .user-info {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  line-height: 1;
  position: relative;
  text-decoration: none;
}

.cart-icon:hover::after,
.user-icon:hover::after {
  width: 100%;
}

.cart-icon,
.user-icon {
  font-size: 1.2rem;
}

.burger-menu-btn {
  display: none;
  background: none;
  font-size: 1.5rem;
  padding: 5px;
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1100;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 80px 20px 20px;
  text-align: center;
  overflow-y: auto;
  z-index: 999;
  background-color: var(--mobile-menu-bg-color, #fff);
}

.mobile-menu.active {
  display: flex;
}

.mobile-nav-link {
  padding: 15px 0;
  display: block;
  font-weight: bold;
  border-bottom: 1px solid;
}

.mobile-nav-link:last-of-type {
  border-bottom: none;
}

.mobile-cart-info,
.mobile-user-info,
.mobile-social-address {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 0;
  border-bottom: 1px solid;
  font-weight: bold;
}

.mobile-social-address {
  flex-direction: column;
  border-bottom: none;
}

.mobile-social-address .address {
  margin-bottom: 10px;
}

.mobile-social-address .social-links a {
  margin: 0 10px;
  font-size: 1.5rem;
}

.hero-section {
  height: 20vh;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px 40px;
  overflow: hidden;
  position: relative;
}

.hero-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1120px;
  position: relative;
}

.shop-name {
  font-family: "Georgia", serif;
  font-size: 3rem;
  flex-grow: 1;
  text-align: left;
}

.social-address {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 15px;
}

.social-links {
  display: flex;
  gap: 10px;
}

.social-links a {
  font-size: 1.5rem;
}

.address {
  font-size: 0.9rem;
}

.categories-section {
  padding: 40px 20px;
  text-align: center;
}

.section-title {
  margin-bottom: 30px;
  font-size: 2rem;
}

.categories-wrapper {
  max-width: 1120px;
  margin: 0 auto;
  position: relative;
  display: flex;
  justify-content: center;
}

.categories-container {
  display: flex;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 20px;
  padding-bottom: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
}

.categories-container::-webkit-scrollbar {
  height: 8px;
  -webkit-appearance: none;
}

.categories-container::-webkit-scrollbar-track {
  border-radius: 10px;
}

.categories-container::-webkit-scrollbar-thumb {
  border-radius: 10px;
  border: 2px solid;
}

.category-card {
  width: 100px;
  height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 5px;
  text-align: center;
  flex-shrink: 0;
}

.category-card:hover {
  transform: translateY(-5px);
}

.category-card img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 5px;
  border: 2px solid;
}

.category-card p {
  font-size: 0.9rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  width: 100%;
  text-align: center;
}

.ad-section {
  padding: 50px 20px;
  text-align: center;
  margin: 40px auto;
  max-width: 1120px;
  border-radius: 15px;
}

.ad-section h2 {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.ad-section p {
  font-size: 1.1rem;
}

.bestsellers-section {
  padding: 40px 20px;
  text-align: center;
}

.products-grid-index {
  max-width: 1120px;
  margin: 0 auto 50px auto;
}

.products-flex-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

@media (max-width: 1120px) and (min-width: 769px) {
  .products-flex-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

.product-card {
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.product-card:hover {
  transform: translateY(-5px);
}

.product-card img {
  max-width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 15px;
  border: 2px solid;
}

.product-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  width: 100%;
  text-align: center;
}

.product-card .product-description {
  font-size: 0.9rem;
  margin-bottom: 15px;
  flex-grow: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  width: 100%;
  text-align: center;
}

.product-card .product-price {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 15px;
}

.view-all-btn {
  margin-top: 20px;
  font-weight: bold;
  display: inline-block;
  padding: 12px 25px;
  text-decoration: none;
  border-radius: 5px;
}

.map-section {
  padding: 40px 20px;
  text-align: center;
}

.yandex-map {
  width: 100%;
  max-width: 1120px;
  /* Ограничьте ширину, как и для других секций */
  height: 400px;
  /* Высота карты */
  margin: 30px auto 0 auto;
  /* Центрируем и добавляем отступ */
  border-radius: 8px;
  /* Немного закруглим углы */
  overflow: hidden;
  /* Обрезаем, если что-то выходит за границы */
}

/* --- Стили для страницы профиля --- */
.profile-section {
  padding: 60px 20px;
}

.profile-container {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  gap: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.profile-sidebar {
  flex: 0 0 280px;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-right: 1px solid;
}

.profile-avatar {
  text-align: center;
  margin-bottom: 30px;
}

.profile-avatar i {
  font-size: 5rem;
  margin-bottom: 10px;
}

.profile-avatar span {
  display: block;
  font-size: 1.4rem;
  font-weight: bold;
}

.profile-nav {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: auto;
}

.profile-nav-link {
  display: block;
  padding: 15px 20px;
  font-size: 1.1rem;
  text-decoration: none;
  border-bottom: 1px solid;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.profile-nav-link:first-child {
  border-top: 1px solid;
}

.logout-btn {
  font-weight: bold;
  padding: 12px 25px;
  width: 100%;
  border-radius: 5px;
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 0.3s ease;
}

.profile-content {
  flex: 1;
  padding: 30px;
}

.profile-tab-content {
  display: none;
}

.profile-tab-content.active {
  display: block;
}

.profile-content h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.profile-content .section-description {
  font-size: 0.95rem;
  margin-bottom: 30px;
}

.info-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px dashed;
}

.info-group:last-child {
  border-bottom: none;
}

.info-group label {
  flex: 0 0 150px;
  font-weight: bold;
  font-size: 1.05rem;
  margin-right: 20px;
}

.info-value {
  flex: 1;
  font-size: 1.05rem;
  min-width: 200px;
  padding: 5px 0;
}

.info-value.editable {
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.2s ease;
}

.info-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid;
  border-radius: 5px;
  font-size: 1.05rem;
  min-width: 200px;
}

.save-profile-btn,
.cancel-profile-btn {
  margin-top: 20px;
  padding: 12px 25px;
  border-radius: 5px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.3s ease;
}

.save-profile-btn {
  margin-right: 15px;
}

.order-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.empty-message {
  text-align: center;
  font-size: 1.1rem;
  padding: 50px 0;
}

.order-item {
  padding: 20px;
  border-radius: 8px;
}

.order-item h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-item h3 span {
  font-size: 1rem;
}

.order-item ul {
  list-style: none;
  padding: 0;
  margin: 10px 0;
  border-top: 1px dashed;
  padding-top: 10px;
}

.order-item ul li {
  padding: 5px 0;
  display: flex;
  justify-content: space-between;
}

.order-item .order-total {
  font-weight: bold;
  font-size: 1.1rem;
  margin-top: 15px;
  border-top: 1px solid;
  padding-top: 10px;
  text-align: right;
}

@media (max-width: 992px) {
  .profile-container {
    flex-direction: column;
    gap: 20px;
    padding: 20px;
  }

  .profile-sidebar {
    flex: none;
    width: 100%;
    padding: 20px;
    border-right: none;
    border-bottom: 1px solid;
  }

  .profile-nav {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
  }

  .profile-nav-link {
    border-bottom: none;
    border-radius: 5px;
    border: 1px solid;
    padding: 10px 15px;
  }

  .profile-nav-link:first-child {
    border-top: 1px solid;
  }

  .logout-btn {
    width: auto;
    max-width: 250px;
  }

  .profile-content {
    padding: 20px 10px;
  }

  .info-group {
    flex-direction: column;
    align-items: flex-start;
  }

  .info-group label {
    flex: none;
    width: 100%;
    margin-right: 0;
    margin-bottom: 5px;
  }

  .info-value,
  .info-input {
    width: 100%;
    min-width: unset;
  }

  .save-profile-btn,
  .cancel-profile-btn {
    width: 100%;
    margin-right: 0;
    margin-bottom: 10px;
  }
}

@media (max-width: 600px) {
  .profile-content h2 {
    font-size: 1.7rem;
  }

  .order-item h3 {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .order-item h3 span {
    font-size: 0.9rem;
  }

  .order-item ul li {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
}


/* --- Стили для страниц аутентификации --- */
.auth-section {
  padding: 60px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.auth-container {
  width: 100%;
  max-width: 450px;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.auth-container .page-title {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 15px;
}

.auth-container .form-description {
  text-align: center;
  margin-bottom: 30px;
  font-size: 1rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  font-size: 0.95rem;
}

.form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid;
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--secondary-color);
}

.submit-btn {
  width: 100%;
  padding: 15px;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 5px;
  margin-top: 10px;
}

.form-switch-text,
.forgot-password-text {
  text-align: center;
  margin-top: 20px;
}

.error-messages,
.error-message {
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.form-group.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-group.checkbox-group input[type="checkbox"] {
  width: auto;
}

.form-group.checkbox-group label {
  margin-bottom: 0;
  font-weight: normal;
}



.footer {
  padding: 40px 20px 20px;
  text-align: center;
}

.footer-content {
  max-width: 1120px;
  margin: 0 auto 30px auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 30px;
}

.footer-section {
  flex: 1;
  min-width: 250px;
  text-align: left;
}

.footer-section h3 {
  margin-bottom: 15px;
  font-size: 1.1rem;
}

/* Styles for discount badge and prices */
.product-card {
  position: relative;
  /* Добавляем для корректного позиционирования discount-badge */
}

.discount-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: #ff4d4d;
  /* Красный цвет для скидки */
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: bold;
  font-size: 0.8em;
  z-index: 10;
  /* Убедимся, что значок поверх изображения */
}

.product-old-price {
  text-decoration: line-through;
  color: #888;
  /* Серый цвет для старой цены */
  font-size: 0.9em;
  margin-bottom: 0;
  /* Убираем лишний отступ */
}

.product-price {
  color: #e60000;
  /* Яркий цвет для новой цены со скидкой */
  font-weight: bold;
}
}

.footer-section p {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.social-icons {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.social-icons a {
  font-size: 1.5rem;
}

.footer-bottom {
  margin-top: 20px;
  border-top: 1px solid;
  padding-top: 15px;
  font-size: 0.85rem;
}

/* --- Стили для плавающей кнопки корзины --- */
.floating-cart-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: var(--floating-cart-bg-color);
  color: var(--button-text-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 998;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.floating-cart-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.floating-cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--cart-remove-btn-hover-color, #e53935);
  color: var(--button-text-color);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 0.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--card-bg-color, #fff);
}

.floating-cart-count.updated {
  animation: bounce 0.3s ease-out;
}

@keyframes bounce {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }
}

/* --- Стили для страницы корзины --- */
.cart-page-section {
  padding: 40px 20px;
  min-height: calc(100vh - var(--header-height, 70px) - var(--footer-height, 250px));
}

.cart-page-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  align-items: flex-start;
}

.cart-items-list {
  border-radius: 8px;
  padding: 20px;
  background-color: var(--card-bg-color);
}

.cart-item {
  display: grid;
  grid-template-columns: 100px 1fr auto auto auto;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--card-border-color);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item-details h4 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--cart-item-text-color);
}

.cart-item-details p {
  margin: 5px 0 0;
  font-size: 1rem;
  color: var(--cart-item-secondary-text-color);
}

.cart-item-quantity-controls {
  display: flex;
  align-items: center;
}

.cart-item-quantity-controls form {
  display: flex;
  align-items: center;
}

.cart-item-quantity-controls .quantity-btn {
  background-color: var(--cart-quantity-btn-bg-color);
  border: 1px solid var(--cart-quantity-input-border-color);
  color: var(--cart-item-text-color);
  width: 35px;
  height: 35px;
  font-size: 1.2rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.cart-item-quantity-controls .quantity-btn:hover {
  background-color: var(--secondary-color);
  color: var(--button-text-color);
}

.cart-item-quantity-controls .quantity-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cart-item-quantity-controls .item-quantity {
  width: 50px;
  text-align: center;
  border: 1px solid var(--cart-quantity-input-border-color);
  margin: 0 5px;
  padding: 8px 5px;
  border-radius: 5px;
  background-color: transparent;
  color: var(--cart-item-text-color);
  -moz-appearance: textfield;
}


.cart-item-price {
  font-size: 1.2rem;
  font-weight: bold;
  min-width: 100px;
  text-align: right;
  color: var(--cart-item-text-color);
}

.remove-item-btn {
  background: none;
  border: none;
  color: var(--cart-remove-btn-color);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.remove-item-btn:hover {
  color: var(--cart-remove-btn-hover-color);
}

.empty-cart-message-page {
  text-align: center;
  font-size: 1.2rem;
  padding: 60px 20px;
  color: var(--cart-item-secondary-text-color);
}

.cart-page-summary {
  border-radius: 8px;
  padding: 25px;
  background-color: var(--card-bg-color);
  position: sticky;
  top: 120px;
}

.cart-page-summary h3 {
  margin-top: 0;
  font-size: 1.5rem;
  border-bottom: 1px solid var(--card-border-color);
  padding-bottom: 15px;
  margin-bottom: 20px;
  color: var(--cart-summary-text-color);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-size: 1rem;
  color: var(--cart-summary-text-color);
}

.total-row {
  font-weight: bold;
  font-size: 1.2rem;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--card-border-color);
}

.checkout-btn-page,
.clear-cart-btn-page {
  /* width: 150px; */
  width: 100%;
  display: block;
  text-align: center;
  padding: 15px;
  border: none;
  border-radius: 5px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
  transition: background-color 0.3s ease;
  background-color: var(--secondary-color);
  color: var(--button-text-color);
  background-color: var(--button-hover-color);
}

.checkout-btn-page {}

.checkout-btn-page:hover {}

.clear-cart-btn-page {
  background-color: transparent;
  color: var(--cart-remove-btn-color);
  border: 1px solid var(--cart-remove-btn-color);
}

.clear-cart-btn-page:hover {
  background-color: var(--cart-clear-btn-hover-bg-color);
  color: var(--cart-remove-btn-hover-color);
  border-color: var(--cart-remove-btn-hover-color);
}

/* --- Адаптивность для страницы корзины --- */
@media (max-width: 992px) {
  .cart-page-container {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .cart-page-summary {
    position: static;
    top: auto;
  }
}

@media (max-width: 768px) {
  .cart-item {
    grid-template-columns: 80px 1fr auto;
    grid-template-areas:
      "img details remove"
      "img quantity price";
    gap: 10px 15px;
    padding: 15px 0;
  }

  .cart-item-image {
    grid-area: img;
    width: 80px;
    height: 80px;
  }

  .cart-item-details {
    grid-area: details;
  }

  .cart-item-quantity-controls {
    grid-area: quantity;
    justify-self: start;
  }

  .cart-item-price {
    grid-area: price;
    text-align: right;
    font-size: 1.1rem;
  }

  .remove-item-btn {
    grid-area: remove;
    justify-self: end;
    padding: 5px;
  }
}

@media (max-width: 480px) {
  .cart-page-section {
    padding: 20px 15px;
  }

  .cart-items-list,
  .cart-page-summary {
    padding: 15px;
  }

  .cart-item {
    grid-template-columns: 60px 1fr;
    grid-template-areas:
      "img details"
      "img remove"
      "quantity price";
    row-gap: 15px;
  }

  .cart-item-image {
    width: 60px;
    height: 60px;
    align-self: start;
  }

  .cart-item-details {
    align-self: start;
  }

  .cart-item-details h4 {
    font-size: 1rem;
  }

  .cart-item-details p {
    font-size: 0.9rem;
  }

  .remove-item-btn {
    align-self: end;
  }

  .cart-item-quantity-controls {
    justify-self: start;
  }

  .cart-item-price {
    justify-self: end;
  }
}


width: 60px;
height: 60px;
display: flex;
justify-content: center;
align-items: center;
font-size: 1.6rem;
z-index: 1000;
transition: background-color 0.3s ease,
transform 0.2s ease;
}

.floating-cart-btn:hover {
  transform: translateY(-2px);
}

.floating-cart-btn .floating-cart-count {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: 50%;
  padding: 2px 6px;
  min-width: 20px;
  text-align: center;
  line-height: 1.2;
  display: none;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s ease;
}

.floating-cart-btn .floating-cart-count.updated {
  transform: scale(1.2);
}

@media (max-width: 768px) {
  .header.desktop-only-header {
    display: none;
  }

  .burger-menu-btn {
    display: block;
  }

  .hero-section {
    padding: 20px;
    height: 10vh;
  }

  .hero-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0;
  }

  .shop-name {
    font-size: 2.5rem;
    text-align: center;
    flex-grow: 1;
  }

  .social-address {
    display: none;
  }

  .categories-wrapper {
    padding-bottom: 0;
  }

  .categories-container {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .category-card {
    width: 90px;
    height: 120px;
    margin-right: 0;
  }

  .category-card img {
    width: 70px;
    height: 70px;
  }

  .products-grid-index {
    padding-bottom: 10px;
  }

  .products-flex-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 20px;
    justify-content: flex-start;
  }

  .products-flex-container::-webkit-scrollbar {
    height: 8px;
    -webkit-appearance: none;
  }

  .products-flex-container::-webkit-scrollbar-track {
    border-radius: 10px;
  }

  .products-flex-container::-webkit-scrollbar-thumb {
    border-radius: 10px;
    border: 2px solid;
  }

  .product-card {
    min-width: 280px;
    width: 280px;
  }

  .ad-section {
    padding: 30px 15px;
    margin: 30px auto;
  }

  .ad-section h2 {
    font-size: 1.8rem;
  }

  .ad-section p {
    font-size: 1rem;
  }

  .floating-cart-btn {
    display: flex;
  }
}

@media (max-width: 480px) {

  .header,
  .hero-section,
  .categories-section,
  .ad-section,
  .bestsellers-section,
  .footer,
  .map-section {
    padding-left: 15px;
    padding-right: 15px;
  }

  .shop-name {
    font-size: 2rem;
  }

  .ad-section h2 {
    font-size: 1.5rem;
  }

  .ad-section p {
    font-size: 1rem;
  }

  .yandex-map {
    height: 300px;
  }
}