:root {
  --font-body: "Roboto", sans-serif;
  --font-heading: "Poppins", sans-serif;
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-surface-alt: #212529;
  --color-surface-soft: #f7f8fa;
  --color-text: #222529;
  --color-text-muted: #6f6e6b;
  --color-border: #f0f0f0;
  --color-border-dark: #313438;
  --color-primary: #066aab;
  --color-primary-hover: #055789;
  --color-dark: #2b2b2d;
  --color-success: #157347;
  --shadow-soft: 0 5px 25px rgba(0, 0, 0, 0.08);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-pill: 999px;
  --transition: 0.25s ease;
  --container-width: 1220px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
}

body.is-drawer-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

textarea {
  resize: vertical;
}

.container {
  width: min(100% - 32px, var(--container-width));
  margin: 0 auto;
}

.site-shell {
  min-height: 100vh;
  overflow: clip;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.header-main {
  border-bottom: 1px solid var(--color-border);
}

.header-main__inner,
.header-nav__inner,
.footer-bottom__inner {
  display: flex;
  align-items: center;
}

.header-main__inner {
  min-height: 96px;
  gap: 20px;
}

.header-main__toggle {
  display: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  background: transparent;
}

.header-main__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px auto;
  background: var(--color-text);
}

.site-logo {
  flex: 0 0 auto;
}

.site-logo img {
  width: 202px;
  max-width: 100%;
}

.header-tools {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-tools__search-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--color-text);
}

.header-tools__search-toggle svg,
.search-form__submit svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.search-form {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: #fff;
}

.search-form__field {
  flex: 1;
}

.search-form input,
.search-form select {
  width: 100%;
  height: 40px;
  padding: 0 16px;
  border: 0;
  color: var(--color-text-muted);
  background: transparent;
  outline: none;
}

.search-form__select {
  width: 180px;
  border-left: 1px solid var(--color-border);
}

.search-form__submit {
  width: 48px;
  height: 40px;
  border: 0;
  color: #fff;
  background: var(--color-primary);
}

.search-form__submit:hover,
.button--primary:hover,
.newsletter-form button:hover {
  background: var(--color-primary-hover);
}

.icon-link {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.mini-cart {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mini-cart__icon {
  position: relative;
  width: 24px;
  height: 19px;
  border: 2px solid var(--color-text);
  border-radius: 0 0 5px 5px;
}

.mini-cart__icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -10px;
  width: 15px;
  height: 11px;
  margin-left: -7.5px;
  border: 2px solid var(--color-text);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}

.mini-cart__count {
  position: absolute;
  right: -2px;
  top: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--color-dark);
}

.header-nav__inner {
  min-height: 60px;
}

.primary-nav {
  display: flex;
  gap: 35px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
}

.primary-nav a {
  position: relative;
  padding: 4px 0;
}

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 0;
  height: 2px;
  background: var(--color-text);
  transition: width var(--transition);
}

.primary-nav a:hover::after,
.primary-nav a.is-active::after {
  width: 100%;
}

.site-main {
  padding-top: 22px;
}

.catalog-grid,
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.template-card {
  background: var(--color-surface);
  transition: transform var(--transition), box-shadow var(--transition);
}

.template-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.template-card__media {
  position: relative;
  overflow: hidden;
  background: #f8f8f8;
}

.template-card__media img {
  width: 100%;
  aspect-ratio: 396 / 599;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.template-card:hover .template-card__media img {
  transform: scale(1.02);
}

.template-card__overlay {
  position: absolute;
  inset: auto 12px 12px;
  display: flex;
  gap: 8px;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--transition), transform var(--transition);
}

.template-card:hover .template-card__overlay {
  opacity: 1;
  transform: translateY(0);
}

.template-card__content {
  padding: 14px 10px 18px;
  text-align: center;
}

.template-card__category {
  margin: 0 0 8px;
  font-size: 12px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.template-card__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
}

.template-card__rating {
  margin-top: 10px;
  font-size: 13px;
  color: #c7c7c7;
  letter-spacing: 0.18em;
}

.template-card__price {
  margin: 12px 0 0;
  font-size: 18px;
  font-weight: 500;
}

.catalog-actions {
  padding: 32px 0 52px;
  text-align: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  transition: all var(--transition);
}

.button--ghost,
.button--ghost-alt {
  min-width: 110px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: rgba(34, 37, 41, 0.72);
  backdrop-filter: blur(10px);
}

.button--ghost:hover,
.button--ghost-alt:hover {
  background: var(--color-dark);
}

.button--load-more,
.button--primary {
  min-height: 46px;
  padding: 0 28px;
  border: 0;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
}

.button--load-more {
  border: 1px solid #d6d6d6;
  color: var(--color-text);
  background: #fff;
}

.button--load-more:hover {
  border-color: var(--color-text);
}

.page-hero {
  padding: 42px 0 28px;
  background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
}

.page-hero__eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.page-hero__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.1;
}

.breadcrumb {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  color: var(--color-text-muted);
  font-size: 14px;
}

.content-section,
.product-detail {
  padding: 28px 0 70px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}

.content-card,
.copy-block,
.auth-card,
.cart-card,
.product-tabs,
.product-summary,
.product-gallery {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.content-card,
.copy-block,
.auth-card,
.cart-card {
  padding: 28px;
}

.checkout-card {
  padding: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.content-card h2,
.copy-block h2,
.auth-card h2,
.section-heading h2,
.product-tab__title {
  margin: 0 0 14px;
  font-family: var(--font-heading);
  font-size: 24px;
}

.copy-block + .copy-block {
  margin-top: 24px;
}

.copy-block p,
.content-card p,
.product-tab__content p,
.product-summary__description {
  margin: 0 0 14px;
  line-height: 1.8;
  color: var(--color-text-muted);
}

.step-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.9;
  color: var(--color-text-muted);
}

.contact-form,
.newsletter-form {
  display: grid;
  gap: 12px;
}

.form-grid,
.auth-grid {
  display: grid;
  gap: 16px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 24px;
}

.contact-form input,
.contact-form textarea,
.newsletter-form input,
.newsletter-form button,
.product-summary__qty {
  border-radius: var(--radius-sm);
}

.contact-form input,
.contact-form textarea,
.newsletter-form input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  outline: none;
}

.newsletter-form {
  grid-template-columns: 1fr auto;
  margin-top: 18px;
}

.newsletter-form input {
  color: #fff;
  background: #292c30;
  border-color: transparent;
}

.newsletter-form input::placeholder {
  color: #9ca3af;
}

.newsletter-form button {
  padding: 0 24px;
  border: 0;
  font-weight: 700;
  color: #fff;
  background: var(--color-primary);
}

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;
  margin-bottom: 28px;
}

.product-gallery {
  padding: 20px;
}

.product-gallery img {
  width: 100%;
  border-radius: var(--radius-sm);
  background: #fafafa;
}

.product-summary {
  padding: 28px;
}

.product-summary__category {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.product-summary__title {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
}

.product-summary__price {
  margin: 0 0 18px;
  font-size: 32px;
  font-weight: 700;
}

.product-summary__actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 24px 0;
}

.product-summary__qty {
  width: 92px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
}

.product-meta {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.product-meta strong {
  color: var(--color-text);
}

.product-tabs {
  padding: 28px;
}

.product-tab {
  padding: 20px 0;
}

.product-tab + .product-tab {
  border-top: 1px solid var(--color-border);
}

.section-heading {
  margin: 36px 0 18px;
}

.related-grid .template-card {
  border: 1px solid var(--color-border);
}

.footer-main {
  position: relative;
  padding: 52px 0 34px;
  color: #d7d7d7;
  background: var(--color-surface-alt);
}

.footer-main::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(100% - 32px, var(--container-width));
  height: 1px;
  transform: translateX(-50%);
  background: var(--color-border-dark);
}

.footer-main__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
}

.footer-block__title {
  margin: 0 0 18px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.footer-block__text,
.footer-list,
.footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  line-height: 1.7;
  color: #b9b9b9;
}

.footer-list li + li,
.footer-links li + li {
  margin-top: 10px;
}

.footer-list strong {
  color: #fff;
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  padding: 18px 0;
  color: #c7c7c7;
  background: var(--color-surface-alt);
}

.footer-bottom__inner {
  justify-content: space-between;
  gap: 24px;
}

.footer-bottom__copy {
  margin: 0;
  font-size: 14px;
}

.footer-bottom__payment {
  width: 210px;
}

.mobile-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: min(320px, 88vw);
  transform: translateX(-100%);
  transition: transform var(--transition);
}

.mobile-drawer__panel {
  height: 100%;
  padding: 24px 20px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
  overflow-y: auto;
}

.mobile-drawer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.mobile-drawer__top img {
  width: 160px;
}

.mobile-drawer__close {
  border: 0;
  background: transparent;
  font-size: 32px;
  line-height: 1;
}

.mobile-drawer__nav {
  display: grid;
  gap: 14px;
  font-family: var(--font-heading);
  font-weight: 600;
}

.mobile-drawer__nav a.is-active {
  color: var(--color-primary);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

body.is-drawer-open .mobile-drawer {
  transform: translateX(0);
}

body.is-drawer-open .drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.is-search-open .search-form {
  display: flex;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-table th,
.cart-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cart-item img {
  width: 70px;
  border-radius: 10px;
}

.cart-summary {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

.checkout-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.checkout-summary__row strong {
  font-family: var(--font-heading);
}

.checkout-paypal {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}

.paypal-note {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-soft);
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.paypal-note code {
  color: var(--color-text);
  font-weight: 700;
}

.cart-summary__box {
  width: min(100%, 360px);
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.cart-summary__row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cart-empty {
  padding: 28px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--color-text-muted);
}

.notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  padding: 14px 18px;
  border-radius: 14px;
  color: #fff;
  background: var(--color-success);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}

.notice.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1199px) {
  .catalog-grid,
  .related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .site-header {
    position: static;
  }

  .header-main__toggle {
    display: inline-block;
  }

  .primary-nav {
    display: none;
  }

  .search-form__select {
    width: 150px;
  }

  .content-grid,
  .product-layout,
  .auth-grid,
  .checkout-grid,
  .footer-main__grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 767px) {
  .container {
    width: min(100% - 24px, var(--container-width));
  }

  .search-form {
    display: none;
    position: absolute;
    left: 12px;
    right: 12px;
    top: calc(100% - 10px);
    z-index: 5;
    box-shadow: var(--shadow-soft);
  }

  .header-main__inner {
    position: relative;
    min-height: 84px;
  }

  .header-tools {
    justify-content: flex-end;
  }

  .header-tools__search-toggle span,
  .icon-link {
    display: none;
  }

  .catalog-grid,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .newsletter-form,
  .form-grid,
  .footer-bottom__inner,
  .product-summary__actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .cart-item {
    align-items: flex-start;
  }
}

@media (max-width: 575px) {
  .site-logo img {
    width: 148px;
  }

  .catalog-grid,
  .related-grid {
    gap: 2px;
  }

  .template-card__overlay {
    inset-inline: 8px;
    flex-direction: column;
  }

  .button--ghost,
  .button--ghost-alt {
    width: 100%;
    min-width: 0;
  }

  .template-card__title {
    font-size: 15px;
  }

  .content-card,
  .copy-block,
  .auth-card,
  .cart-card,
  .product-summary,
  .product-gallery,
  .product-tabs,
  .checkout-card {
    padding: 20px;
  }

  .cart-table,
  .cart-table thead,
  .cart-table tbody,
  .cart-table tr,
  .cart-table th,
  .cart-table td {
    display: block;
    width: 100%;
  }

  .cart-table thead {
    display: none;
  }

  .cart-table tr {
    padding: 18px 0;
    border-bottom: 1px solid var(--color-border);
  }

  .cart-table td {
    padding: 6px 0;
    border: 0;
  }
}
