/* static/css/shop.css - Styles for FOX SHOP */

body {
  background: #ffffff; /* White, как фон логотипа */
  color: #14181f; /* Dark navy text color */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  min-height: 100vh;
  background-attachment: fixed;
}

.card {
  background-color: #fff;
  border: none;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(20, 24, 31, 0.08);
  border: 1px solid #e3e6eb;
  color: #14181f;
}

.card-title {
  color: #e8601c; /* Fox orange */
}

.btn-primary {
  background: #e8601c; /* Fox orange */
  border: none;
}

.btn-success {
  background: #e8601c; /* Fox orange */
  border: none;
}

.btn-category {
  background: #14181f; /* Fox navy */
  border: none;
  color: white;
  border-radius: 12px;
  padding: 20px 30px;
  font-weight: 600;
  font-size: 18px;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  width: calc(100% - 40px);
  margin: 0 20px 20px 20px;
}

.btn-category:hover {
  transform: scale(1.05);
  background: #e8601c;
  box-shadow: 0 0 20px rgba(232, 96, 28, 0.4);
  color: white;
}

.btn-category:last-child {
  margin-bottom: 0;
}

.cart-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  border-radius: 50px;
  padding: 15px 25px;
}

.cart-counter {
  background: #e8601c;
  color: white;
  border-radius: 50%;
  padding: 4px 8px;
  font-size: 12px;
  margin-left: 8px;
  position: absolute;
  top: -8px;
  right: -8px;
}

h2, h4 {
  color: #e8601c;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
}

.form-select {
  background-color: #ffffff;
  color: #14181f;
  border: 1px solid #b84a10;
}

.shadow-hover:hover {
  box-shadow: 0 0 30px rgba(232, 96, 28, 0.3), 0 0 10px rgba(20, 24, 31, 0.4);
  transform: scale(1.02);
  transition: all 0.3s ease;
}

.cart-item {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 10px;
  border: 1px solid #b84a10;
}

.remove-btn {
  background: #e8601c;
  border: none;
  color: white;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
}

#cartModal .modal-content,
#confirmOrderModal .modal-content {
  background-color: #ffffff;
  border: none;
  color: #14181f;
}

#cartModal .modal-header,
#confirmOrderModal .modal-header {
  border-bottom: 1px solid #b84a10;
}

#cartModal .modal-footer,
#confirmOrderModal .modal-footer {
  border-top: 1px solid #b84a10;
}

/* Окно подтверждения: коричневая рамка + чуть уже, с отступами по бокам */
#confirmOrderModal .modal-content {
  border: 2px solid #b84a10;
  border-radius: 16px;
}

#confirmOrderModal .modal-dialog {
  max-width: 340px;
  width: calc(100% - 48px);
  margin-left: auto;
  margin-right: auto;
}

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

.loading::after {
  content: '';
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #e8601c;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.logo-glow {
  filter: drop-shadow(0 0 10px #e8601c);
  animation: glow 2s ease-in-out infinite alternate;
}

.back-btn {
  background: #14181f;
  border: none;
  color: white;
  border-radius: 8px;
  padding: 8px 16px;
  transition: all 0.3s ease;
}

@keyframes glow {
  from {
    filter: drop-shadow(0 0 10px #e8601c);
  }
  to {
    filter: drop-shadow(0 0 20px #e8601c) drop-shadow(0 0 30px #e8601c);
  }
}

/* Custom notification */
.custom-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #14181f;
  color: white;
  padding: 20px 30px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(232, 96, 28, 0.4);
  z-index: 9999;
  text-align: center;
  font-weight: bold;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  transition: all 0.3s ease;
}

.custom-notification.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* PRODUCT GRID STYLES */
.product-grid-card {
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}

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

.product-image-container {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #e3e6eb;
  transition: all 0.3s ease;
  background: white;
}

.product-grid-card:hover .product-image-container {
  border-color: #e8601c;
  box-shadow: 0 8px 25px rgba(232, 96, 28, 0.4);
}

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

#productModal .modal-title, #cartModal .modal-title, #confirmOrderModal .modal-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: #14181f;
}

.product-grid-title {
  color: #14181f;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  text-align: center;
  margin-top: 8px;
  line-height: 1.2;
}

.product-grid-price {
  color: #b84a10;
  font-weight: bold;
  font-size: 13px;
  text-align: center;
  margin-top: 4px;
}

/* CASHBACK CORNER STYLES */
.cashback-corner {
  position: fixed;
  top: 20px;
  left: 20px;
  background: #e8601c;
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  z-index: 998;
  box-shadow: 0 4px 15px rgba(232, 96, 28, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
}

.cashback-corner:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(232, 96, 28, 0.6);
}

/* Popup info panel */
.cashback-popup {
  position: fixed;
  top: 70px;
  left: 20px;
  background: #ffffff;
  color: #14181f;
  padding: 15px;
  border-radius: 12px;
  font-size: 13px;
  z-index: 999;
  box-shadow: 0 8px 25px rgba(232, 96, 28, 0.4);
  border: 1px solid #e3e6eb;
  min-width: 200px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.cashback-popup.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cashback-popup::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 20px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #ffffff;
}

/* Updated styles for cashback section */
.cashback-section {
  background: #ffffff;
  border: 2px solid rgba(232, 96, 28, 0.3);
  border-radius: 16px;
  padding: 20px;
  margin-top: 20px;
  position: relative;
  overflow: hidden;
}

.cashback-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #e8601c;
  opacity: 0.8;
}

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

.cashback-title {
  color: #e8601c;
  font-weight: bold;
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cashback-available {
  color: #14181f;
  font-size: 14px;
  font-weight: 600;
}

.cashback-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.cashback-input-field {
  flex: 1;
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid rgba(232, 96, 28, 0.5);
  border-radius: 12px;
  color: #14181f;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  min-width: 0; /* Allows compression */
}

.cashback-input-field:focus {
  outline: none;
  border-color: #e8601c;
  box-shadow: 0 0 15px rgba(232, 96, 28, 0.3);
  background: rgba(255, 255, 255, 0.8);
}

.cashback-input-field::placeholder {
  color: rgba(20, 24, 31, 0.6);
  font-weight: normal;
}

.cashback-apply-btn {
  background: #e8601c;
  border: none;
  border-radius: 10px;
  padding: 12px 14px;
  color: white;
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.cashback-apply-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(232, 96, 28, 0.4);
  background: #b84a10;
}

.cashback-hint {
  background: rgba(232, 96, 28, 0.1);
  border: 1px solid rgba(232, 96, 28, 0.3);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: rgba(20, 24, 31, 0.8);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Styles for used cashback info */
.cashback-used-info {
  background: rgba(232, 96, 28, 0.08);
  border: 1px solid rgba(232, 96, 28, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  margin-top: 15px;
  text-align: center;
}

.cashback-used-amount {
  color: #e8601c;
  font-weight: bold;
  font-size: 14px;
}

.final-total-display {
  background: #f4f5f7;
  border: 2px solid rgba(20, 24, 31, 0.3);
  border-radius: 12px;
  padding: 15px;
  margin-top: 15px;
  text-align: center;
}

.final-total-text {
  color: #14181f;
  font-weight: bold;
  font-size: 18px;
  margin: 0;
}

/* Animation for cashback section */
.cashback-section {
  animation: cashbackGlow 3s ease-in-out infinite alternate;
}

@keyframes cashbackGlow {
  from {
    box-shadow: 0 0 20px rgba(232, 96, 28, 0.2);
  }
  to {
    box-shadow: 0 0 30px rgba(232, 96, 28, 0.4), 0 0 40px rgba(20, 24, 31, 0.2);
  }
}

#productModal .modal-content {
  background: #f4f5f7;
  border: 1px solid #e3e6eb; 
  border-radius: 15px;
}

#productModalTitle, #productModalDescription {
  color: #14181f;
}

#productModalPrice {
  color: #e8601c;
}

/* Сгенерированные иконки вместо эмодзи (static/icons) */
.ic {
  height: 1.4em;
  width: 1.4em;
  vertical-align: -0.3em;
  margin-right: 0.35em;
  object-fit: contain;
}
/* Белый силуэт иконки — для тёмных и оранжевых кнопок */
.ic-w {
  filter: brightness(0) invert(1);
}

/* Магазин открывается только внутри Telegram: до проверки всё скрыто */
body.tg-locked > *:not(#tgGate):not(script) { display: none !important; }
#tgGate { display: none; }
body.tg-locked #tgGate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
}
.tg-gate-text { font-size: 18px; font-weight: 600; color: #14181f; max-width: 320px; }
