/* =============================================
   DAARTS — Components (Mobile-First)
   ============================================= */

/* --- Hero Section --- */
.hero {
   background: var(--color-primary-gradient);
   color: var(--color-white);
   padding: 32px var(--gap);
   text-align: center;
}

.hero h1 {
   font-family: var(--font-condensed);
   font-size: clamp(18px, 5vw, 24px);
   letter-spacing: 0.07px;
   line-height: 1.4;
   color: var(--color-white);
   margin: 0;
   overflow-wrap: break-word;
   hyphens: auto;
}

/* --- Product Cards Grid --- */
.cards-grid {
   display: grid;
   grid-template-columns: repeat(2, 1fr);
   gap: var(--gap);
   padding: var(--gap) 0;
}

.card {
   display: flex;
   flex-direction: column;
   background: var(--color-white);
   border-radius: var(--radius);
   overflow: hidden;
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
   cursor: pointer;
   transition: transform var(--transition), box-shadow var(--transition);
   text-decoration: none;
   color: var(--color-text);
}

.card:hover {
   transform: translateY(-4px);
   box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-body {
   aspect-ratio: 1;
   overflow: hidden;
}

.card-body img {
   width: 100%;
   height: 100%;
   object-fit: cover;
   transition: transform var(--transition);
}

.card:hover .card-body img {
   transform: scale(1.05);
}

.card-footer {
   padding: 12px;
   text-align: center;
   background: #F8F8F8;
}

.card-footer h6 {
   font-size: 13px;
   line-height: 1.4;
   margin: 0;
}

/* --- Product Detail --- */
.product-hero {
   margin-bottom: 20px;
}

.product-hero img {
   width: 100%;
   max-width: 640px;
   height: auto;
   border-radius: var(--radius);
}

.product-description {
   margin-bottom: 24px;
}

.product-back {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   margin-bottom: 16px;
   font-size: 14px;
   color: var(--color-text-muted);
}

.product-back:hover {
   color: var(--color-primary);
}

/* --- Tables --- */
.table-wrapper {
   width: 100%;
   overflow-x: auto;
   -webkit-overflow-scrolling: touch;
   margin: 16px 0;
}

.spec-table {
   width: 100%;
   border-collapse: collapse;
   font-family: var(--font-primary);
   font-size: 13px;
   table-layout: fixed;
}

.spec-table th,
.spec-table td {
   padding: 8px 12px;
   border: 1px solid var(--color-border-light);
   text-align: left;
}

.spec-table th {
   background: #F8F8F8;
   font-weight: bold;
}

.spec-table tr:hover {
   background: #FAFAFA;
}

/* --- Buttons --- */
.btn {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   padding: 10px 20px;
   font-family: var(--font-condensed);
   font-size: 15px;
   border: none;
   border-radius: var(--radius);
   cursor: pointer;
   text-decoration: none;
   transition: all var(--transition);
   min-height: 44px;
}

.btn-primary {
   background: var(--color-primary);
   color: var(--color-white);
}

.btn-primary:hover {
   background: var(--color-primary-dark);
   color: var(--color-white);
}

/* --- Dividers --- */
.divider {
   border: none;
   border-top: 1px solid var(--color-border-light);
   margin: 24px 0;
}

/* --- Scroll to top button --- */
.scroll-top {
   position: fixed;
   right: 16px;
   bottom: 80px;
   width: 48px;
   height: 48px;
   background: var(--color-primary);
   color: var(--color-white);
   border: none;
   border-radius: 50%;
   cursor: pointer;
   display: none;
   align-items: center;
   justify-content: center;
   font-size: 20px;
   box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
   transition: all var(--transition);
   z-index: 99999;
}

.scroll-top.is-visible {
   display: flex;
}

.scroll-top:hover {
   background: var(--color-primary-dark);
   transform: translateY(-2px);
}

/* --- Breadcrumbs --- */
.breadcrumbs {
   background: #f5f5f5;
   padding: 10px var(--gap);
   font-size: 13px;
   line-height: 1.4;
}

.breadcrumbs ol {
   list-style: none;
   margin: 0;
   padding: 0;
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 4px;
}

.breadcrumbs li {
   display: flex;
   align-items: center;
   gap: 4px;
}

.breadcrumbs li + li::before {
   content: "›";
   color: var(--color-text-muted);
   font-size: 15px;
}

.breadcrumbs a {
   color: var(--color-primary);
   text-decoration: none;
}

.breadcrumbs a:hover {
   text-decoration: underline;
}

.breadcrumbs span[aria-current] {
   color: var(--color-text-muted);
}

/* (old catalog-block removed — see card-style block below) */

/* --- Sections --- */
.section {
   padding: 24px 0;
}

.section-title {
   margin-top: 24px;
   margin-bottom: 20px;
   font-family: var(--font-condensed);
   font-size: 22px;
   color: var(--color-primary);
   padding-bottom: 10px;
   border-bottom: 3px solid var(--color-primary);
   display: inline-block;
   max-width: 100%;
   word-break: break-word;
}

/* Section title above sidebar: full width line, tight spacing */
.container > h1.section-title,
.section > h2.section-title {
   display: block;
   margin-bottom: 16px;
   font-weight: normal;
}

/* Parent section name (transparent) next to h1 */
.section-title-parent {
   color: #D9D9D9;
   font-family: var(--font-condensed);
   font-size: 24px;
   font-weight: normal;
   letter-spacing: 0.07px;
   margin-left: 12px;
}

/* --- Content images --- */
.content-image {
   margin: 16px 0;
   text-align: center;
}

.content-image img {
   max-width: 100%;
   height: auto;
   border-radius: var(--radius);
   border: 1px solid var(--color-border);
}

/* --- Catalog block on product pages (card style like Каталоги.html) --- */
.catalog-block {
   display: flex;
   flex-wrap: wrap;
   justify-content: center;
   gap: 16px;
   margin: 24px auto;
}

.catalog-block .catalog-card {
   display: flex;
   flex-direction: column;
   width: 240px;
   flex-shrink: 0;
   border: 2px solid var(--color-primary);
   border-radius: var(--radius);
   overflow: hidden;
   text-decoration: none;
   transition: transform 0.3s ease, box-shadow 0.3s ease;
   background: var(--color-primary-gradient);
}

.catalog-block .catalog-card:hover {
   transform: translateY(-2px);
   box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.catalog-block .catalog-card-body {
   background: var(--color-white);
   display: flex;
   align-items: center;
   justify-content: center;
}

.catalog-block .catalog-card-body img {
   width: 100%;
   height: auto;
   border: none;
   border-radius: 0;
   display: block;
   object-fit: contain;
}

.catalog-block .catalog-card-footer {
   padding: 8px 10px;
   text-align: center;
   background: var(--color-primary-gradient);
}

.catalog-block .catalog-card-footer h6 {
   color: var(--color-white);
   font-size: 11px;
   margin: 0;
   font-family: var(--font-primary);
   line-height: 1.4;
}

/* --- Home page cards (smaller, red footer) --- */
.cards-grid--home .card {
   border: 2px solid var(--color-primary);
}

.cards-grid--home .card-body {
   aspect-ratio: 4/3;
}

.cards-grid--home .card-footer {
   background: var(--color-primary-gradient);
}

.cards-grid--home .card-footer h6 {
   color: var(--color-white);
}

/* --- Catalog cards (full image, smaller) --- */
.cards-grid--catalog {
   grid-template-columns: repeat(2, 1fr);
   justify-content: center;
   gap: 10px;
   max-width: 950px;
   margin: 0 auto;
}

.cards-grid--catalog .card {
   border: 2px solid var(--color-primary);
}

.cards-grid--catalog .card {
   background: var(--color-primary-gradient);
}

.cards-grid--catalog .card-body {
   aspect-ratio: auto;
   overflow: hidden;
   flex: 1;
   display: flex;
   align-items: flex-end;
   background: var(--color-white);
}

.cards-grid--catalog .card-body img {
   width: 100%;
   height: auto;
   object-fit: contain;
}

.cards-grid--catalog .card-footer {
   background: var(--color-primary-gradient);
   min-height: 50px;
   display: flex;
   align-items: center;
   justify-content: center;
}

.cards-grid--catalog .card-footer h6 {
   color: var(--color-white);
   font-size: 11px;
}

/* --- 2-column image grid --- */
.cards-grid--2col {
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: var(--gap);
   margin: 16px 0;
}

/* Product pages: keep 2-column layout for side-by-side images */
.page-content .cards-grid--2col {
   grid-template-columns: 1fr 1fr;
}

/* Product pages: align left, limit width to text block */
.page-content .content-image {
   text-align: left;
}

.page-content .content-image img {
   max-width: 480px;
   width: 100%;
   height: auto;
}

/* Product pages: catalog block aligned with text */
.page-content .catalog-block {
   overflow: visible;
   max-width: 90ch;
   margin-left: 0;
   margin-right: 0;
}

/* Product pages: optimal line length 50-75 chars */
.page-content p,
.page-content ul,
.page-content ol,
.page-content h4,
.page-content h5 {
   max-width: 90ch;
}

/* --- Cookie consent banner --- */
.cookie-banner {
   position: fixed;
   bottom: 0;
   left: 0;
   right: 0;
   background: #222;
   color: #fff;
   padding: 10px 16px;
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   justify-content: center;
   gap: 8px 12px;
   z-index: 9999;
   transform: translateY(100%);
   transition: transform 0.4s ease;
   box-sizing: border-box;
}

.cookie-banner.is-visible {
   transform: translateY(0);
}

.cookie-banner__text {
   flex: 1 1 200px;
   font-size: 12px;
   line-height: 1.4;
   text-align: center;
}

.cookie-banner__text a {
   color: #fff;
   text-decoration: underline;
}

.cookie-banner__btn {
   flex-shrink: 0;
   padding: 6px 16px;
   background: var(--color-primary);
   color: #fff;
   border: none;
   border-radius: var(--radius);
   cursor: pointer;
   font-size: 13px;
   min-height: 34px;
   white-space: nowrap;
   transition: background var(--transition);
}

.cookie-banner__btn:hover {
   background: var(--color-primary-dark);
}

/* --- Text article styles --- */
.Tex-article {
   font-size: 14px;
   line-height: 1.7;
}

/* --- Legal page two-column layout --- */
.legal-columns {
   display: grid;
   grid-template-columns: 1fr;
   gap: 24px;
}

@media (min-width: 768px) {
   .legal-columns {
      grid-template-columns: 1fr 1fr;
      gap: 40px;
   }
}

/* ======================
   TABLET (>=576px)
   ====================== */
@media (min-width: 576px) {
   .cards-grid {
      grid-template-columns: repeat(3, 1fr);
   }

   .cards-grid--catalog {
      grid-template-columns: repeat(3, 1fr);
   }

   .hero h1 {
      font-size: 27px;
   }
}

/* ======================
   DESKTOP (>=992px)
   ====================== */
@media (min-width: 992px) {
   .cards-grid {
      grid-template-columns: repeat(4, 1fr);
   }

   .cards-grid--catalog {
      grid-template-columns: repeat(5, 1fr);
   }

   .hero {
      padding: 48px var(--gap);
   }

   .hero h1 {
      font-size: 30px;
   }
}
