/* Basic */
:root {
    --primary-color: #181d23;
    --primary-hover: #34495e;
    --secondary-color: #07151f;
    --secondary-hover: #2980b9;
    --background-color: #ffffff;
    --text-color: #181d23;
    --text-muted: #7f8c8d;
    --border-color: #e0e0e0;
    --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

* {
    margin: 0px;
    padding: 0px;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Headers and Text*/
h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

p {
    margin-bottom: var(--spacing-sm);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 8px;
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-color);
    border: none;
}

.btn-ghost:hover {
    background-color: #e8e8e8;
}

.btn-ghost.active {
    background-color: var(--primary-color);
    color: white;
}

.btn-back {
    padding: 12px 6px;
    margin-bottom: 1.5rem;
}

/* Select */
.select {
    position: relative;
    display: inline-block;
}

.select select {
    appearance: none;
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 40px 12px 16px;
    font-size: 1rem;
    cursor: pointer;
    min-width: 200px;
}

.select::after {
    content: "▼";
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 12px;
    color: var(--text-muted);
    }

/* Card */
.card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: 
        transform 0.2s ease,
        box-shadow 0.2s ease;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.main {
    min-height: calc(100vh - 200px);
    padding: var(--spacing-lg) 0;
}

/* Utilities */
.text-muted {
    color: var(--text-muted);
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header */
.header {
    background-color: white;
    border-bottom: 3px solid var(--border-color);
    padding: var(--spacing-sm) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.logo {
    font-weight: 700;
    margin-bottom: 0.3rem;
}

#logo-link {
    color: var(--primary-color);
    text-decoration: none;
}

.desktop-nav {
    display: none;
    gap: var(--spacing-sm);
}

.mobile-nav {
    display: block;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
    }

    .mobile-nav {
        display: none;
    }
}


/* Catalog Header */
.catalog-header {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

@media (min-width: 768px) {
    .catalog-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}

.sort-section {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

@media (max-width: 768px) {
    .sort-section {
        align-items: center;
        gap: var(--spacing-sm);
    }


    .select select {
        width: 100%; /* Занимает всю доступную ширину */
        min-width: 165px; /* Отменяем фиксированную минимальную ширину */
    }
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.product-image {
    aspect-ratio: 3/4;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.product-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    flex: 1;
    margin-bottom: var(--spacing-sm);
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-content: center;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.product-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.product-link:hover {
    text-decoration: underline;
}

/* Product Page */
.product-page-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-xl);
}

@media (min-width: 1024px) {
  .product-page-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.main-image {
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-xs);
}

.thumbnail {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--border-radius);
  border: 3px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.thumbnail.active {
  border-color: var(--primary-color);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-details {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.product-main-details .product-title {
  font-size: 1.4rem;
  margin-bottom: var(--spacing-md);
}

.product-main-details .product-description {
  font-size: 1.1rem;
  margin-bottom: var(--spacing-lg);
}

.product-main-details .product-price {
  font-size: 1.4rem;
  margin-bottom: var(--spacing-lg);
}

.product-specs {
  border-top: 1px solid var(--border-color);
  padding-top: var(--spacing-md);
}

#product-specs-heading {
    font-size: 1.4rem;
}

.specs-list {
  list-style: none;
}

.specs-list li {
  display: flex;
  justify-content: space-between;
  padding: var(--spacing-xs) 0;
  border-bottom: 2px solid #f8f9fa;
  font-size: 1.1rem;
}

.availability-link {
    color: var(--secondary-color);
}

/* Transition */

.contacts {
  transition: all 1s ease;
}

#footer-contacts.highlight {
  background-color: rgba(255, 255, 255, 0.3);
  padding: 19px;
  border-radius: 8px;
  animation: pulse 1s ease-in-out 1s;   
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}


/* Footer */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: var(--spacing-xl) 0 var(--spacing-lg) 0;
}

.footer-heading {
    color: white;
    margin-bottom: var(--spacing-sm);
}

.footer a {
    color: white;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

#footer-contacts,
.footer-hours,
.footer-info {
    padding: 20px;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.address {
    font-style: normal;
}

.footer-bottom {
    border-top: 3px solid rgba(255, 255, 255, 0.2);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    text-align: center;
}

/* Loading */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl) 0;
}
