/* =========================================================
   AFA Digital Catalogue - Connected Architecture
   Precision Tab & Container Alignment (1:1 with user design)
   ========================================================= */

.catalog-page {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
}

.catalog-background {
  position: fixed;
  z-index: -2;
  inset: 0;
  background:
    radial-gradient(circle at 14% 18%, rgba(215, 24, 42, .05), transparent 30%),
    radial-gradient(circle at 86% 72%, rgba(188, 190, 192, .15), transparent 36%),
    var(--paper);
  pointer-events: none;
}

.catalog-page::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 0, 0, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, .03) 1px, transparent 1px);
  background-size: 64px 64px;
  content: "";
  pointer-events: none;
  opacity: .5;
}

/* Header */
.catalog-header {
  display: flex;
  width: min(1320px, calc(100% - 2.5rem));
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-inline: auto;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.catalog-brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--black);
  text-decoration: none;
}

.catalog-brand > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, .14);
  border-radius: 50%;
  background: white;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.catalog-brand img {
  width: 82%;
  height: 82%;
  object-fit: contain;
}

.catalog-brand strong {
  display: flex;
  flex-direction: column;
  font-family: Arial, sans-serif;
  font-weight: 800;
  line-height: 1.1;
}

.catalog-brand small {
  margin-top: .2rem;
  font-family: var(--font);
  font-size: .68rem;
  font-weight: 500;
  color: #666;
}

.header-center-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.header-center-title span {
  color: var(--red);
  font-family: Arial, sans-serif;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.header-center-title strong {
  font-size: .94rem;
  color: #222;
}

.catalog-header-actions {
  display: flex;
  align-items: center;
  gap: .8rem;
}

.catalog-basket-btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: .6rem;
  padding: .4rem 1.05rem;
  border: 1.5px solid rgba(0, 0, 0, .12);
  border-radius: 999px;
  background: #ffffff;
  color: var(--black);
  font-family: inherit;
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
  appearance: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: all 200ms ease;
}

.catalog-basket-btn:hover {
  border-color: var(--red);
  color: var(--red);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(215, 24, 42, 0.12);
}

.catalog-basket-btn svg {
  color: var(--red);
  transition: transform 200ms ease;
}

.catalog-basket-btn:hover svg {
  transform: scale(1.1);
}

.basket-badge {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  padding: 0 .45rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f0f0ed;
  color: #444;
  font-size: .75rem;
  font-weight: 800;
  transition: all 220ms ease;
}

.basket-badge.has-items {
  background: var(--red);
  color: #ffffff;
  animation: badge-pop 320ms cubic-bezier(0.2, 1.2, 0.35, 1) both;
}

@keyframes badge-pop {
  0% { transform: scale(0.6); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.catalog-home-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: .55rem;
  padding: .4rem .95rem;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .85);
  color: var(--black);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 200ms ease, transform 200ms var(--ease), border-color 200ms ease;
}

.catalog-home-link:hover {
  background: white;
  border-color: var(--black);
  transform: translateY(-2px);
}

.catalog-home-link span {
  color: var(--red);
  font-size: 1.15rem;
}

/* Main Area */
.catalog-main {
  width: min(1320px, calc(100% - 2.5rem));
  margin-inline: auto;
  padding: 2.2rem 0 4rem;
  min-height: calc(100svh - 90px);
  display: flex;
  flex-direction: column;
}

.catalog-dashboard:not(.is-box-open) {
  margin-block: 0.8rem auto;
}

/* Centered Intro Header */
.catalog-intro {
  max-width: 760px;
  margin: 0 auto 2.6rem;
  text-align: center;
  transition: opacity 320ms ease, transform 320ms ease;
}

.catalog-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--red);
  font-family: Arial, sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  margin-bottom: .6rem;
}

.catalog-eyebrow span {
  width: 28px;
  height: 2px;
  background: var(--red);
}

.catalog-intro h1 {
  margin: 0 0 .75rem;
  font-size: clamp(2.4rem, 5.2vw, 4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.035em;
  color: #111111;
}

.catalog-intro h1 em {
  color: var(--red);
  font-style: normal;
}

.catalog-intro p {
  margin: 0 auto;
  color: #555555;
  font-size: clamp(.92rem, 1.4vw, 1.05rem);
  line-height: 1.65;
}

/* =========================================================
   DASHBOARD WRAPPER & CATEGORY CARDS ROW
   ========================================================= */

.catalog-dashboard {
  position: relative;
  width: min(1200px, 100%);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
}

/* 3 Category Cards in a Row (Never shrunk, always full width & height) */
.category-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 100%;
  position: relative;
  z-index: 5;
  align-items: stretch;
}

/* Category Main Card */
.category-main-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.3rem;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 0, 0, 0.02);
  color: var(--black);
  text-align: right;
  cursor: pointer;
  appearance: none;
  outline: none;
  overflow: visible;
  font-family: inherit;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 260ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 220ms ease;
  animation: card-appear-spring 600ms cubic-bezier(0.2, 1.15, 0.35, 1) both;
}

.category-main-card:nth-child(1) { animation-delay: 80ms; }
.category-main-card:nth-child(2) { animation-delay: 180ms; }
.category-main-card:nth-child(3) { animation-delay: 280ms; }

@keyframes card-appear-spring {
  0% {
    opacity: 0;
    transform: translateY(34px) scale(0.93);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.category-main-card:hover:not(.is-active-card) {
  transform: translateY(-6px);
  border-color: rgba(215, 24, 42, 0.35);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(215, 24, 42, 0.1);
}

.category-main-card:focus-visible {
  outline: 3px solid rgba(215, 24, 42, 0.45);
  outline-offset: 4px;
}

/* Card Visual Art */
.category-main-card .photo-art {
  height: 180px;
  overflow: hidden;
  margin-bottom: 1.15rem;
  border-radius: 18px;
  background: #f1f0eb;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.category-main-card .photo-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1);
}

.category-main-card:hover .photo-art img {
  transform: scale(1.05);
}

/* Card Content */
.category-main-card .card-content h3 {
  margin: 0 0 .4rem;
  font-size: clamp(1.35rem, 1.8vw, 1.65rem);
  font-weight: 800;
  line-height: 1.25;
  color: #111;
}

.category-main-card .card-content p {
  margin: 0;
  color: #666;
  font-size: .84rem;
  line-height: 1.55;
  min-height: 2.8em;
}

/* Card Bottom Action Row */
.category-main-card .card-bottom-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.2rem;
  padding-top: .9rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.category-main-card .count-pill {
  display: inline-flex;
  padding: .25rem .65rem;
  border-radius: 999px;
  background: #f4f3ee;
  color: #444;
  font-size: .72rem;
  font-weight: 700;
}

.category-main-card .view-hint {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--red);
  font-size: .8rem;
  font-weight: 700;
}

.category-main-card .view-hint i {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: rgba(215, 24, 42, 0.08);
  font-style: normal;
  font-family: Arial, sans-serif;
  font-size: .88rem;
  transition: transform 220ms ease, background-color 220ms ease, color 220ms ease;
}

.category-main-card:hover .view-hint i {
  background: var(--red);
  color: white;
  transform: translateY(2px);
}

/* =========================================================
   SEAMLESS ACTIVE TAB & CONTAINER CONNECTION
   (Matches media_1790005130164.png 1:1)
   ========================================================= */

/* =========================================================
   SEAMLESS CONNECTED ARCHITECTURE (Matches user sketch 1:1)
   With generous spacing under inactive cards so they don't stick
   ========================================================= */

/* When the box is open, give a 32px gap below the cards row */
.catalog-dashboard.is-box-open .category-cards-row {
  margin-bottom: 32px;
}

/* Inactive cards: stay at their normal height with 32px clearance above the container */
.catalog-dashboard.is-box-open .category-main-card:not(.is-active-card) {
  opacity: 0.92;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.catalog-dashboard.is-box-open .category-main-card:not(.is-active-card):hover {
  opacity: 1;
  transform: translateY(-4px);
}

/* ACTIVE CARD: Extends down 32px across the gap to seamlessly merge into the container */
.category-main-card.is-active-card {
  padding-bottom: calc(1.3rem + 32px);
  margin-bottom: -34px;
  border-bottom: 3px solid #ffffff;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  z-index: 8;
  background: #ffffff;
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  transform: none;
}

.category-main-card.is-active-card .view-hint {
  color: var(--red);
  font-weight: 800;
}

.category-main-card.is-active-card .view-hint i {
  background: var(--red);
  color: white;
  transform: rotate(180deg);
}

/* Concave Fillet (Inverted Radius) - Left Side */
/* Blends active card's left vertical wall into the container's top horizontal edge */
.category-main-card[data-category="rebar"].is-active-card::before,
.category-main-card[data-category="open"].is-active-card::before {
  content: "";
  display: block !important;
  position: absolute;
  left: -24px;
  bottom: -2px;
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M0 24 A24 24 0 0 0 24 0 V24 H0 Z' fill='%23ffffff'/%3E%3Cpath d='M0 24 A24 24 0 0 0 24 0' fill='none' stroke='rgba(0,0,0,0.08)' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 10;
}

/* Concave Fillet (Inverted Radius) - Right Side */
/* Blends active card's right vertical wall into the container's top horizontal edge */
.category-main-card[data-category="open"].is-active-card::after,
.category-main-card[data-category="closed"].is-active-card::after {
  content: "";
  display: block !important;
  position: absolute;
  right: -24px;
  bottom: -2px;
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M0 24 A24 24 0 0 0 24 0 V24 H0 Z' fill='%23ffffff'/%3E%3Cpath d='M0 24 A24 24 0 0 0 24 0' fill='none' stroke='rgba(0,0,0,0.08)' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transform: scaleX(-1);
  pointer-events: none;
  z-index: 10;
}

/* =========================================================
   CONNECTED PRODUCTS CONTAINER
   Exact same width from first to last product card above
   ========================================================= */

.connected-products-box {
  position: relative;
  z-index: 4;
  width: 100%;
  margin-top: -2px;
  padding: clamp(2rem, 3.2vw, 3rem);
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 28px;
  background: #ffffff;
  box-shadow:
    0 30px 80px -10px rgba(0, 0, 0, 0.07),
    0 10px 28px -5px rgba(0, 0, 0, 0.03);
  animation: connected-box-unfold 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes connected-box-unfold {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Corner alignments matching media_1790005130164.png */
.catalog-dashboard[data-active-category="rebar"] .connected-products-box {
  border-top-right-radius: 0;
  border-top-left-radius: 28px;
}

.catalog-dashboard[data-active-category="open"] .connected-products-box {
  border-top-right-radius: 28px;
  border-top-left-radius: 28px;
}

.catalog-dashboard[data-active-category="closed"] .connected-products-box {
  border-top-right-radius: 28px;
  border-top-left-radius: 0;
}

/* Header inside connected box */
.connected-box-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-bottom: 1.8rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.box-title-group {
  max-width: 620px;
}

.box-eyebrow {
  display: inline-block;
  color: var(--red);
  font-family: Arial, sans-serif;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  margin-bottom: .25rem;
}

.box-title-group h2 {
  margin: 0 0 .4rem;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 800;
  color: #111;
  line-height: 1.15;
}

.box-title-group p {
  margin: 0;
  color: #666;
  font-size: .92rem;
  line-height: 1.5;
}

.box-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.box-filter-pills {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.box-filter-pill {
  padding: .45rem .95rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  background: #f7f7f5;
  color: #555;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  font-family: inherit;
  transition: all 200ms ease;
}

.box-filter-pill:hover {
  background: #eee;
  color: #111;
}

.box-filter-pill.is-active {
  border-color: var(--red);
  background: var(--red);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(215, 24, 42, 0.24);
}

.box-close-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  background: white;
  color: #333;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  appearance: none;
  font-family: inherit;
  transition: all 200ms ease;
}

.box-close-btn:hover {
  border-color: var(--red);
  color: var(--red);
  transform: translateY(-1px);
}

/* =========================================================
   SUB-PRODUCTS GRID
   ========================================================= */

.sub-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.35rem;
}

.sub-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.45rem;
  border: 1.5px solid rgba(188, 190, 192, 0.45);
  border-radius: 20px;
  background: var(--paper); /* #f4f3ef - رنگ طوسی هویت بصری AFA */
  color: #111;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  outline: none;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 260ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 220ms ease,
              background-color 220ms ease;
  animation: subprod-card-enter 450ms cubic-bezier(0.2, 1.15, 0.35, 1) both;
  animation-delay: calc(var(--item-index, 0) * 35ms + 40ms);
}

@keyframes subprod-card-enter {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sub-product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(215, 24, 42, 0.45);
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(215, 24, 42, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.subprod-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-bottom: .85rem;
}

.subprod-badges {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.subprod-badge-size {
  display: inline-flex;
  padding: .32rem .72rem;
  border-radius: 8px;
  background: #111111;
  color: #ffffff;
  font-family: Arial, sans-serif;
  font-size: .84rem;
  font-weight: 800;
  letter-spacing: .04em;
  direction: ltr;
}

.subprod-badge-grade {
  display: inline-flex;
  padding: .28rem .55rem;
  border: 1px solid rgba(215, 24, 42, 0.25);
  border-radius: 7px;
  background: rgba(215, 24, 42, 0.08);
  color: var(--red);
  font-size: .74rem;
  font-weight: 700;
}

.subprod-stock-status {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: rgba(39, 122, 62, 0.08);
  border: 1px solid rgba(39, 122, 62, 0.2);
  color: #1e7039;
  font-size: .7rem;
  font-weight: 700;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #28a745;
  box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
  animation: pulse-dot-anim 1.8s infinite;
}

@keyframes pulse-dot-anim {
  0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(40, 167, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.subprod-main-info {
  margin-bottom: .95rem;
}

.subprod-title {
  margin: 0 0 .35rem;
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.3;
  color: #111;
}

.subprod-subtitle {
  margin: 0;
  color: #666;
  font-size: .82rem;
  line-height: 1.5;
}

.subprod-pills-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1.1rem;
}

.quick-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .35rem .65rem;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 9px;
  background: #ffffff;
  font-size: .75rem;
  color: #555;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.quick-pill strong {
  color: #111;
  font-weight: 800;
}

.quick-pill small {
  color: #666;
  font-size: .7rem;
}

.subprod-card-action {
  padding-top: .8rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.btn-dossier-preview {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--red);
  font-size: .82rem;
  font-weight: 700;
  transition: transform 200ms ease;
}

.sub-product-card:hover .btn-dossier-preview {
  transform: translateX(-4px);
}

.empty-products-notice {
  grid-column: 1 / -1;
  padding: 3rem 2rem;
  text-align: center;
  color: #777;
  font-size: .95rem;
}

/* =========================================================
   PRODUCT DETAIL / ENLARGED TECHNICAL DOSSIER MODAL
   ========================================================= */

.product-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: clamp(1rem, 2.5vw, 2.5rem);
  background: rgba(15, 17, 21, 0.65);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  animation: modal-overlay-fade 280ms ease both;
}

@keyframes modal-overlay-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.product-detail-overlay[hidden] {
  display: none !important;
}

.product-detail-card {
  position: relative;
  width: min(1200px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  padding: clamp(1.6rem, 2.8vw, 2.6rem);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 28px;
  background: #ffffff;
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.22),
    0 10px 30px rgba(0, 0, 0, 0.08);
  animation: detail-modal-enter 380ms cubic-bezier(0.16, 1, 0.3, 1) both;
  outline: none;
}

@keyframes detail-modal-enter {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.close-detail-btn {
  position: absolute;
  top: 1.4rem;
  left: 1.4rem;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  background: #f7f7f6;
  color: #333;
  cursor: pointer;
  transition: all 200ms ease;
  z-index: 15;
}

.close-detail-btn:hover {
  background: #111;
  color: white;
  transform: rotate(90deg);
}

/* Dossier Top Header */
.dossier-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 1.4rem;
}

.dossier-kicker {
  display: inline-block;
  color: var(--red);
  font-family: Arial, sans-serif;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: .4rem;
}

.dossier-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: .5rem;
}

.dossier-size-badge {
  padding: .35rem .85rem;
  border-radius: 9px;
  background: #111;
  color: white;
  font-family: Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  direction: ltr;
}

.dossier-title {
  margin: 0;
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  font-weight: 800;
  color: #111;
}

.dossier-grade-badge {
  padding: .3rem .7rem;
  border-radius: 8px;
  background: rgba(215, 24, 42, 0.08);
  border: 1px solid rgba(215, 24, 42, 0.25);
  color: var(--red);
  font-size: .82rem;
  font-weight: 800;
}

.dossier-mark-badge {
  padding: .3rem .7rem;
  border-radius: 8px;
  background: #f0f0ed;
  border: 1px solid #d4d4d0;
  color: #333;
  font-size: .78rem;
  font-weight: 700;
}

.dossier-desc {
  margin: 0;
  color: #555;
  font-size: .88rem;
  line-height: 1.6;
  max-width: 820px;
}

.dossier-header-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-shrink: 0;
}

.dossier-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  height: 42px;
  padding: 0 1.1rem;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 11px;
  background: #ffffff;
  color: #333;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 200ms ease;
}

.dossier-btn-outline:hover {
  border-color: #111;
  background: #111;
  color: #ffffff;
}

.dossier-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  height: 42px;
  padding: 0 1.1rem;
  border-radius: 11px;
  background: var(--red);
  color: #ffffff;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(215, 24, 42, 0.25);
  transition: all 200ms ease;
}

.dossier-btn-primary:hover {
  background: #bb1323;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(215, 24, 42, 0.35);
}

/* Dossier Navigation Tabs */
.dossier-tabs-nav {
  display: flex;
  align-items: center;
  gap: .4rem;
  overflow-x: auto;
  padding-bottom: .6rem;
  margin-bottom: 1.4rem;
  border-bottom: 2px solid #eaeae6;
  scrollbar-width: thin;
}

.dossier-tab-btn {
  display: inline-flex;
  align-items: center;
  padding: .7rem 1.1rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #666;
  font-family: inherit;
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 200ms ease;
  position: relative;
}

.dossier-tab-btn:hover {
  color: #111;
  background: #f4f3ef;
}

.dossier-tab-btn.is-active {
  color: var(--red);
  background: rgba(215, 24, 42, 0.08);
}

.dossier-tab-btn.is-active::after {
  content: '';
  position: absolute;
  bottom: -0.65rem;
  right: 15%;
  left: 15%;
  height: 3px;
  background: var(--red);
  border-radius: 3px 3px 0 0;
}

/* Dossier Body Grid (Sidebar + Main Content) */
.dossier-body-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.8rem;
  align-items: start;
}

/* Sidebar */
.dossier-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.dossier-visual-card {
  position: relative;
  height: 220px;
  overflow: hidden;
  border-radius: 18px;
  background: #f2f2ef;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.dossier-visual-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visual-badge {
  position: absolute;
  top: .8rem;
  right: .8rem;
  padding: .25rem .55rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  font-family: Arial, sans-serif;
  font-size: .62rem;
  letter-spacing: .06em;
}

.visual-caption {
  position: absolute;
  bottom: .8rem;
  right: .8rem;
  left: .8rem;
  padding: .35rem .65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  color: #333;
  font-size: .72rem;
  text-align: center;
  font-weight: 700;
}

.dossier-quick-card {
  padding: 1.2rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  background: #fcfcfb;
}

.dossier-quick-card h4 {
  margin: 0 0 .9rem;
  font-size: .84rem;
  font-weight: 800;
  color: #222;
  padding-bottom: .5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dossier-quick-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.quick-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: .8rem;
}

.quick-summary-item span {
  color: #666;
}

.quick-summary-item strong {
  color: #111;
  font-weight: 800;
}

.dossier-qc-seal {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  padding: 1rem;
  border: 1px solid rgba(39, 122, 62, 0.25);
  border-radius: 14px;
  background: rgba(39, 122, 62, 0.05);
}

.qc-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #277a3e;
  color: white;
  font-size: .85rem;
  font-weight: 800;
  flex-shrink: 0;
}

.dossier-qc-seal strong {
  display: block;
  font-size: .8rem;
  color: #1b5e20;
  margin-bottom: .2rem;
}

.dossier-qc-seal p {
  margin: 0;
  font-size: .74rem;
  color: #3b5e40;
  line-height: 1.5;
}

/* Main Content Panels */
.dossier-main-content {
  display: flex;
  flex-direction: column;
}

.dossier-tab-pane {
  animation: pane-fade 250ms ease both;
}

.dossier-tab-pane[hidden] {
  display: none !important;
}

@keyframes pane-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.pane-header {
  margin-bottom: 1.1rem;
}

.pane-header h3 {
  margin: 0 0 .3rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #111;
}

.pane-header p {
  margin: 0;
  color: #666;
  font-size: .82rem;
  line-height: 1.5;
}

.dossier-table-container {
  overflow-x: auto;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: #ffffff;
  margin-bottom: 1.2rem;
}

.dossier-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
  text-align: right;
}

.dossier-table th {
  padding: .85rem 1rem;
  background: #f7f7f5;
  color: #333;
  font-weight: 800;
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

.dossier-table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: #444;
}

.dossier-table tbody tr:last-child td {
  border-bottom: none;
}

.dossier-table tbody tr:hover {
  background: #fafaf8;
}

.cell-highlight {
  font-weight: 800;
  color: #111 !important;
  font-family: Arial, sans-serif;
  direction: ltr;
}

.badge-passed {
  display: inline-flex;
  padding: .2rem .55rem;
  border-radius: 6px;
  background: rgba(39, 122, 62, 0.1);
  color: #1e7039;
  font-size: .75rem;
  font-weight: 700;
}

.badge-code {
  display: inline-flex;
  padding: .2rem .55rem;
  border-radius: 6px;
  background: #111;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: .75rem;
  font-weight: 700;
  direction: ltr;
}

/* Packaging Cards Grid */
.packaging-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .9rem;
  margin-bottom: 1.2rem;
}

.packaging-card {
  padding: 1rem 1.2rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: #fbfbf9;
}

.pack-title {
  display: block;
  font-size: .76rem;
  color: #777;
  margin-bottom: .3rem;
}

.pack-value {
  display: block;
  font-size: .94rem;
  color: #111;
  line-height: 1.5;
}

/* Bottom Bar */
.dossier-bottom-bar {
  margin-top: 1rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.detail-note {
  margin: 0 0 1rem;
  padding: .75rem 1rem;
  border-right: 3px solid var(--red);
  border-radius: 9px;
  background: rgba(215, 24, 42, 0.06);
  color: #3b3b3b;
  font-size: .8rem;
  line-height: 1.6;
}

.dossier-contact-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .8rem;
  padding: .9rem 1.2rem;
  border-radius: 12px;
  background: #111111;
  color: #ffffff;
  font-size: .84rem;
}

.dossier-tel-link {
  color: #ffffff;
  font-family: Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: .08em;
  padding: .3rem .8rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 200ms ease;
}

.dossier-tel-link:hover {
  background: var(--red);
}

.catalog-source-note {
  max-width: 900px;
  margin: 3.5rem auto 0;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  color: #666;
  font-size: .76rem;
  text-align: center;
  line-height: 1.6;
}

/* =========================================================
   RESPONSIVE DESIGN
   ========================================================= */

@media (max-width: 1020px) {
  .category-cards-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
  .category-main-card {
    padding: 1rem;
  }
  .category-main-card .photo-art {
    height: 140px;
  }
  .dossier-body-grid {
    grid-template-columns: 1fr;
  }
  .dossier-sidebar {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .catalog-header {
    min-height: 70px;
  }
  .header-center-title {
    display: none;
  }
  .category-cards-row {
    grid-template-columns: 1fr;
  }
  .category-main-card[data-category="rebar"].is-active-card::before,
  .category-main-card[data-category="open"].is-active-card::before,
  .category-main-card[data-category="open"].is-active-card::after,
  .category-main-card[data-category="closed"].is-active-card::after {
    display: none;
  }
  .connected-products-box {
    border-radius: 24px !important;
    padding: 1.3rem;
    margin-top: 1.5rem;
  }
  .connected-box-header {
    flex-direction: column;
  }
  .sub-products-grid {
    grid-template-columns: 1fr;
  }
  .sub-product-card {
    padding: 1.2rem;
  }
  .dossier-header {
    flex-direction: column;
    align-items: stretch;
  }
  .dossier-header-actions {
    justify-content: flex-start;
  }
  .dossier-sidebar {
    grid-template-columns: 1fr;
  }
  .packaging-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   PRINT STYLES FOR OFFICIAL DOSSIER
   ========================================================= */

@media print {
  body * {
    visibility: hidden;
  }
  .product-detail-overlay {
    position: static;
    background: none;
    padding: 0;
  }
  .product-detail-card,
  .product-detail-card * {
    visibility: visible;
  }
  .product-detail-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    max-height: none !important;
    box-shadow: none !important;
    border: none !important;
    padding: 10mm !important;
  }
  .close-detail-btn,
  .dossier-header-actions,
  .dossier-tabs-nav {
    display: none !important;
  }
  .dossier-tab-pane {
    display: block !important;
    margin-bottom: 20mm;
    page-break-inside: avoid;
  }
}
