/* Custom Styles for Authentication System */
/* Ensures profile button has correct cursor behavior across all pages */

.header-profile-button {
    cursor: pointer !important;
}

/* Cart Interactive Elements - Cursor Pointer */
/* Improves UX by showing pointer cursor on clickable cart elements */

.add-to-cart,
.cross-cart {
    cursor: pointer;
}

/* Wishlist cross icon should show pointer cursor */
.wishlist-card-cross {
    cursor: pointer;
}

.register {
    z-index: 11111 !important;
}

/* Финальные стили для скелетной загрузки с белым фоном */

/* Базовые стили для элементов, которые будут загружаться */
.h-product-name,
.h-product-price {
  transition: color 0.3s ease-in, background-color 0.3s ease-out;
  min-height: 1.2em;
}

/* Класс для активного состояния скелета */
.skeleton-loading {
  color: transparent !important;
  background-color: #FFFFFF;    /* Белый фон, как вы просили */
  border-radius: 4px;
  user-select: none;
  animation: pulse-white 1.5s infinite ease-in-out; /* Легкая анимация пульсации */
}

/* Анимация пульсации: от белого к едва заметному серому */
@keyframes pulse-white {
  0% {
    background-color: #FFFFFF; /* Стартовый цвет - белый */
  }
  50% {
    background-color: #f5f5f5; /* Пульсация до очень светлого серого */
  }
  100% {
    background-color: #FFFFFF; /* Возврат к белому */
  }
}

/* Финальный стиль для активной кнопки (без отступа) */
.color.is-active {
  /* Обводка толщиной 2px, прилегающая к краю элемента */
  outline: 2px solid #f55266;
}

/* ===== ИСПРАВЛЕНИЕ ВЫСОТЫ КАРТОЧЕК ТОВАРОВ ===== */
/* Переиспользование рабочего решения из catalog.html */

/* Применяем те же настройки, что работают в .catalog-card-grid */
.main-catalog-card-grid-1,
.main-catalog-card-grid-2 {
  overflow: hidden; /* Добавляем недостающее свойство из .catalog-card-grid */
}

/* КЛЮЧЕВОЕ ИСПРАВЛЕНИЕ: JS создает дополнительные обертки <a> */
/* В catalog.html карточки - прямые дети grid-контейнера */
/* В динамических контейнерах карточки обернуты в <a> теги */
.main-catalog-card-grid-1 > a,
.main-catalog-card-grid-2 > a {
  display: flex; /* Ссылка-обертка должна быть flex */
  height: 100%; /* Растягивается на всю высоту grid-ячейки */
}

/* Карточка внутри ссылки занимает всё пространство */
.main-catalog-card-grid-1 > a > .catalog-card-forgrid,
.main-catalog-card-grid-2 > a > .catalog-card-forgrid {
  height: 100%; /* Карточка растягивается на всю высоту ссылки */
  width: 100%; /* И на всю ширину */
}

/* ===== HOVER ЭФФЕКТ ДЛЯ КАРТОЧЕК ПОИСКА ===== */
/* Добавляем такую же тень как у catalog-card-forgrid при hover */
.main-search-card.catalog-hover {
  height: auto;
  box-shadow: 0 1px 10px -3px #0003;
}

/* ===== UNIFORM CARD BODY HEIGHT ===== */
/* Ensures all product card bodies have uniform layout */
.catalog-card-body {
  height: 100%;
}

/* ===== QUANTITY DROPDOWN STYLES ===== */
/* Custom dropdown for quantity selection in cart */

.quantity-input-cart {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.quantity-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-top: 4px;
  z-index: 1000;
  overflow: hidden;
  animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quantity-option {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
  color: #333333;
  transition: background-color 0.2s ease;
}

.quantity-option:hover {
  background-color: #f5f5f5;
}

.quantity-option:active {
  background-color: #e8e8e8;
}

.quantity-option:not(:last-child) {
  border-bottom: 1px solid #f0f0f0;
}

/* ===== MOBILE GALLERY FIX ===== */
/* Ensures gallery active state is visible on mobile devices */

/* Responsive display: visible on mobile (max-width: 479px), hidden on larger screens */
@media (max-width: 479px) {
  .gallery-thumbnails-phone,
  .gallery-thumbnails-phone .gallerythumbnail-1,
  .gallery-thumbnails-phone .gallerythumbnail-2,
  .gallery-thumbnails-phone .gallerythumbnail-3,
  .gallery-thumbnails-phone .gallerythumbnail-4 {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* Force the active state style to be visible on mobile */
  .gallery-thumbnails-phone .gallery-active {
    border: 2px solid #f55266 !important;
  }
}

/* Hide on screens 480px and wider */
@media (min-width: 480px) {
  .gallery-thumbnails-phone {
    display: none !important;
  }
}

/* ===== DELIVERY ICON SPACING ===== */
/* Adds small space above delivery option icons */
.choose-delivery-icon-container {
  margin-top: 3px;
}

/* Change cursor to pointer on hover for delivery options */
.page-notifications-switch-container:hover {
  cursor: pointer;
}

/* ===== POST ADDRESS AUTOCOMPLETE STYLES ===== */
/* Dropdown container for autocomplete suggestions */

.postaddress-autocomplete-dropdown {
  position: absolute;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 10000;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  animation: autocompleteDropdownFadeIn 0.2s ease-out;
  box-sizing: border-box; /* Ensure padding and border are included in width */
  margin: 0; /* Remove any default margins */
}

@keyframes autocompleteDropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Individual autocomplete item */
.autocomplete-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  border-bottom: 1px solid #f5f5f5;
}

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

.autocomplete-item:hover {
  background-color: #f8f9fa;
}

.autocomplete-item:active {
  background-color: #e9ecef;
}

/* Office name (bold, top line) */
.autocomplete-office-name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.4;
  color: #1a1a1a;
  margin-bottom: 4px;
}

/* Full address (regular, bottom line) */
.autocomplete-address {
  font-weight: 400;
  font-size: 13px;
  line-height: 1.4;
  color: #666666;
}

/* Scrollbar styling for the dropdown */
.postaddress-autocomplete-dropdown::-webkit-scrollbar {
  width: 6px;
}

.postaddress-autocomplete-dropdown::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 0 8px 8px 0;
}

.postaddress-autocomplete-dropdown::-webkit-scrollbar-thumb {
  background: #cccccc;
  border-radius: 3px;
}

.postaddress-autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
  background: #999999;
}

/* Responsive adjustments for mobile */
@media (max-width: 767px) {
  .postaddress-autocomplete-dropdown {
    max-height: 280px;
  }
  
  .autocomplete-item {
    padding: 14px 12px;
  }
  
  .autocomplete-office-name {
    font-size: 13px;
  }
  
  .autocomplete-address {
    font-size: 12px;
  }
}

/* ===== CITY AUTOCOMPLETE STYLES ===== */
/* Dropdown container for city autocomplete suggestions */

.city-autocomplete-dropdown {
  position: absolute;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 10000;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  animation: autocompleteDropdownFadeIn 0.2s ease-out;
  box-sizing: border-box;
  margin: 0;
}

/* Scrollbar styling for city dropdown */
.city-autocomplete-dropdown::-webkit-scrollbar {
  width: 6px;
}

.city-autocomplete-dropdown::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 0 8px 8px 0;
}

.city-autocomplete-dropdown::-webkit-scrollbar-thumb {
  background: #cccccc;
  border-radius: 3px;
}

.city-autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
  background: #999999;
}

/* Responsive adjustments for mobile - city dropdown */
@media (max-width: 767px) {
  .city-autocomplete-dropdown {
    max-height: 280px;
  }
}

/* ===== DELIVERY TOGGLE HIDDEN ===== */
/* Hide the delivery toggle element visually */
.order-page-body-delivery {
  display: none !important;
  visibility: hidden !important;
}

/* ===== COUNTRY SELECTION MODAL ===== */
/* Professional modal matching website style */

.country-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.country-modal.show {
  opacity: 1;
  visibility: visible;
}

.country-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.country-modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  max-width: 420px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
  animation: modalSlideIn 0.25s ease-out;
  border: 1px solid #e0e0e0;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(15px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.country-modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid #e0e0e0;
}

.country-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
}

.country-modal-body {
  padding: 24px;
}

.country-modal-question {
  font-size: 16px;
  color: #333333;
  margin: 0 0 24px;
  text-align: center;
  line-height: 1.5;
  font-weight: 400;
  font-family: 'Montserrat', sans-serif;
}

.country-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.country-modal-btn {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Montserrat', sans-serif;
}

.country-modal-btn-primary {
  background: #f55266;
  color: #ffffff;
}

.country-modal-btn-primary:hover {
  background: #e03d52;
}

.country-modal-btn-primary:active {
  background: #d02a40;
}

.country-modal-btn-secondary {
  background: #f5f5f5;
  color: #333333;
  border: 1px solid #e0e0e0;
}

.country-modal-btn-secondary:hover {
  background: #eeeeee;
}

.country-modal-btn-secondary:active {
  background: #e8e8e8;
}

.country-modal-dropdown-container {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.country-modal-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  background: #ffffff;
  color: #1a1a1a;
  margin-bottom: 12px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  font-family: 'Montserrat', sans-serif;
  transition: border-color 0.2s ease;
}

.country-modal-select:focus {
  border-color: #f55266;
  box-shadow: 0 0 0 3px rgba(245, 82, 102, 0.1);
}

/* Responsive adjustments */
@media (max-width: 479px) {
  .country-modal-content {
    width: 95%;
    border-radius: 8px;
  }
  
  .country-modal-header {
    padding: 20px 20px 14px;
  }
  
  .country-modal-title {
    font-size: 18px;
  }
  
  .country-modal-body {
    padding: 20px;
  }
  
  .country-modal-question {
    font-size: 15px;
    margin-bottom: 20px;
  }
  
  .country-modal-btn {
    padding: 12px 20px;
    font-size: 15px;
  }
}