/* Product List Styles */

/* Base product list container */
.product-list {
  display: block;
}

.product-toolbar {
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  align-items: center;
  color: var(--text-color-gray);
  font-size: 0.875rem;
}

.product-toolbar button {
  background: none;
  border: none;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.product-toolbar button svg {
  fill: var(--text-color-gray);
  width: 1.25rem;
  height: 1.25rem;
}

.product-toolbar .btn-zoom-default {
  background: var(--color-bright-gray);
}

.zoom-out .product-toolbar .btn-zoom-default {
  background: none;
}

.zoom-out .product-toolbar .btn-zoom-out {
  background: var(--color-bright-gray);
}

.product-items {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}

/* Desktop: 3 columns */
@media (min-width: 768px) {
  .product-items {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Large desktop: 4 columns */
@media (min-width: 1024px) {
  .product-items {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Extra large desktop: 5 columns */
@media (min-width: 1280px) {
  .product-items {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Condensed layout - shows more columns */
.zoom-out .product-items {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

/* Responsive breakpoints for default layout */
@media (max-width: 767px) {
  .product-list .product-items {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsive breakpoints for condensed layout */
@media (max-width: 1200px) {
  .zoom-out .product-items {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 768px) {
  .zoom-out .product-items {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

.how-to-buy__container {
  border: 2px dashed var(--color-lighter-gray);
  border-width: 2px 0;
  margin: 0 -2rem;
  width: calc(100% + 4rem) !important;
}

.how-to-buy__grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  column-gap: 0.5rem;
  row-gap: 1rem;
}

@media (max-width: 1100px) {
  .how-to-buy__grid {
    grid-template-columns: 1fr;
  }
}

/* Text URL input styling for readonly textboxes */
input.text-url {
  color: #0088cc;
  font-weight: 500;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background-color: #f8f9fa;
  font-size: 1rem;
  line-height: 1.4;
  cursor: text;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

input.text-url:focus {
  outline: none;
  border-color: #0088cc;
  box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.1);
}

input.text-url:hover {
  border-color: #005a8f;
  background-color: #f1f3f4;
}

input.text-url::selection {
  background-color: rgba(0, 136, 204, 0.2);
}

/* Readonly state styling */
input.text-url[readonly] {
  background-color: #f5f5f5;
  /* cursor: not-allowed; */
  opacity: 0.8;
  font-family: "Courier New", Courier, monospace;
}

input.text-url[readonly]:hover {
  border-color: #e1e5e9;
  background-color: #f5f5f5;
}

/* Dark mode support for text URL inputs */
body.dark input.text-url {
  color: #4dabf7;
  border-color: #374151;
  background-color: #1f2937;
}

body.dark input.text-url:focus {
  border-color: #4dabf7;
  box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.1);
}

body.dark input.text-url:hover {
  border-color: #74c0fc;
  background-color: #374151;
}

body.dark input.text-url[readonly] {
  background-color: #111827;
}

body.dark input.text-url[readonly]:hover {
  border-color: #374151;
  background-color: #111827;
}

body.dark input.text-url::selection {
  background-color: rgba(77, 171, 247, 0.3);
}

/* URL input group with copy button */
.url-input-group {
  display: flex;
  gap: 0;
}

.url-input-group .text-url {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
  flex: 1;
}

.copy-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  background: linear-gradient(135deg, #0088cc 0%, #0070a0 100%);
  border: 2px solid #0088cc;
  border-left: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  cursor: pointer;
  color: #ffffff;
  transition: all 0.2s ease;
  min-width: 50px;
}

.copy-button:hover {
  background: linear-gradient(135deg, #0077b6 0%, #005a8f 100%);
  border-color: #005a8f;
  transform: translateY(-1px);
}

.copy-button:active {
  transform: translateY(0);
}

.copy-button.copied {
  background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
  border-color: #27ae60;
}

.copy-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Dark mode support for copy button */
body.dark .copy-button {
  border-color: #4dabf7;
  background: linear-gradient(135deg, #4dabf7 0%, #228be6 100%);
}

body.dark .copy-button:hover {
  background: linear-gradient(135deg, #74c0fc 0%, #4dabf7 100%);
  border-color: #74c0fc;
}

body.dark .copy-button.copied {
  background: linear-gradient(135deg, #40c057 0%, #37b24d 100%);
  border-color: #40c057;
}

@media (max-width: 480px) {
  .zoom-out .product-items {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Individual product item styles */
.product-item {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: var(--border-radius);
  /* border-radius: 5px; */
  border: 1px solid #eeeeee;
  /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); */
  overflow: hidden;
  /* transition: transform 0.3s ease, box-shadow 0.3s ease; */
}

body.dark .product-item {
  background: #333333;
  border-color: #222222;
  /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); */
}

.zoom-out .product-item {
  border: none;
  background: none !important;
}

.zoom-out .product-info {
  padding: 0.35rem 0 0 0;
}

/* Product image */
.product-image {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-item:hover .product-image img {
  transform: scale(1.05);
}

/* Product info */
.product-info {
  padding: 0.5rem;
}

.product-name {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  font-weight: 400;
  color: #333;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.zoom-out .product-name {
  font-size: 0.75rem;
  margin: 0 0 0.125rem 0;
}

body.dark .product-name {
  color: #e2e8f0;
}

/* Product Points */
.product-point {
  display: flex;
  align-items: end;
  gap: 0.5rem;
}

.product-point img {
  width: 32px;
  height: 32px;
}

.product-point__value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #e65100;
  font-family: var(--font-number-family);
}

/* Product pricing */
.product-price {
  font-size: 0.95rem;
}

.zoom-out .product-price {
  font-size: 0.75rem;
}

.regular-price {
  font-weight: 600;
  color: #e74c3c;
}

.original-price {
  text-decoration: line-through;
  color: #999;
  margin-right: 0.25rem;
}

.sale-price {
  font-weight: 600;
  color: #e74c3c;
  margin-right: 0.25rem;
}

.discount {
  font-size: 0.85rem;
  color: #27ae60;
  font-weight: 500;
}

/* Product category */
.product-category {
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

/* No products message */
.product-list p {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: #666;
  font-style: italic;
}

.product-description-gallery {
  display: flex;
  flex-direction: column;
}

.product-description-gallery img {
  width: 100%;
  height: auto;
  margin: 0 -2rem;
  max-width: calc(100% + 4rem) !important;
  width: calc(100% + 4rem) !important;
  padding: 0;
}

/* Telegram Theme Buy Now Button */
.htb-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(135deg, #0088cc 0%, #0070a0 100%);
  color: #ffffff;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
  position: relative;
  overflow: hidden;
  border: 2px solid #0088cc;
  display: inline-flex;
  flex-shrink: 0;
}

.htb-button.full-width {
  display: flex;
}

.htb-button:hover {
  background: linear-gradient(135deg, #0077b6 0%, #005a8f 100%);
  box-shadow: 0 6px 16px rgba(0, 136, 204, 0.4);
  transform: translateY(-2px);
  color: #ffffff;
}

.htb-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 136, 204, 0.3);
}

.htb-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.htb-button span.icon svg {
  width: 1.25rem;
  height: 1.25rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.htb-button:hover span.icon svg {
  transform: scale(1.1);
}

/* Dark mode support */
body.dark .htb-button {
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.5);
}

body.dark .htb-button:hover {
  box-shadow: 0 6px 16px rgba(0, 136, 204, 0.6);
}
