/* ==========================================================================
   FACTORY PAGE — PHASE D: VISUAL RECONSTRUCTION (SCOPE EXPANSION)
   Dual selectors: body.page-factory-show AND .factory-show-page
   Industrial Company Profile | B2B | Informational | Calm
   ========================================================================== */

/* Color Tokens (LOCKED) */
body.page-factory-show,
.factory-show-page {
  --primary-green: #0F5132;
  --secondary-blue: #1D4ED8;
  --accent-orange: #F97316;
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --border-light: #E5E7EB;
  --bg-soft: #F9FAFB;
  direction: rtl;
}

/* ========== HERO SECTION ========== */

body.page-factory-show .factory-header,
.factory-show-page .factory-header {
  background: var(--bg-soft);
  padding: 2rem 0;
  min-height: auto;
}

body.page-factory-show .factory-header h1,
.factory-show-page .factory-header h1 {
  font-size: 1.6rem;
  color: var(--primary-green);
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}

body.page-factory-show .factory-header p,
.factory-show-page .factory-header p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-align: center;
}

body.page-factory-show .badge-featured,
.factory-show-page .badge-featured {
  display: none;
}

/* ========== ABOUT SECTION (نبذة عن المصنع) ========== */

body.page-factory-show .factory-article-content,
.factory-show-page .factory-article-content {
  direction: rtl;
  text-align: right;
  line-height: 1.85;
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 72ch;
  background: none;
  border: none;
  box-shadow: none;
}

body.page-factory-show .factory-article-content h1,
body.page-factory-show .factory-article-content h2,
body.page-factory-show .factory-article-content h3,
body.page-factory-show .factory-article-content h4,
body.page-factory-show .factory-article-content h5,
body.page-factory-show .factory-article-content h6,
.factory-show-page .factory-article-content h1,
.factory-show-page .factory-article-content h2,
.factory-show-page .factory-article-content h3,
.factory-show-page .factory-article-content h4,
.factory-show-page .factory-article-content h5,
.factory-show-page .factory-article-content h6 {
  color: var(--text-primary);
  font-weight: 600;
  margin: 1rem 0 0.5rem;
}

body.page-factory-show .factory-article-content p,
.factory-show-page .factory-article-content p {
  margin: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ========== PRODUCTS SECTION (المنتجات) ========== */

body.page-factory-show .store-product-card,
body.page-factory-show .product-card,
.factory-show-page .store-product-card,
.factory-show-page .product-card {
  box-shadow: none !important;
  border: 1px solid var(--border-light) !important;
  background: #fff !important;
}

body.page-factory-show .store-product-card:hover,
body.page-factory-show .product-card:hover,
.factory-show-page .store-product-card:hover,
.factory-show-page .product-card:hover {
  box-shadow: none !important;
  transform: none !important;
  border-color: var(--border-light) !important;
}

body.page-factory-show .store-product-image,
.factory-show-page .store-product-image {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
}

body.page-factory-show .store-product-image img,
.factory-show-page .store-product-image img {
  object-fit: contain !important;
  max-height: 180px;
  width: auto !important;
  transition: none !important;
}

body.page-factory-show .store-product-card:hover .store-product-image img,
.factory-show-page .store-product-card:hover .store-product-image img {
  transform: none !important;
}

body.page-factory-show .btn-order-product,
.factory-show-page .btn-order-product {
  display: none !important;
}

body.page-factory-show .btn-outline-primary,
.factory-show-page .btn-outline-primary {
  transform: none !important;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  min-height: 44px;
}

body.page-factory-show .btn-outline-primary:hover,
.factory-show-page .btn-outline-primary:hover {
  transform: none !important;
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-light);
}

body.page-factory-show .store-product-price,
body.page-factory-show .store-product-category,
.factory-show-page .store-product-price,
.factory-show-page .store-product-category {
  font-weight: normal !important;
  border-width: 1px !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
}

/* ========== GENERAL SECTIONS ========== */

body.page-factory-show .content-wrapper,
.factory-show-page .content-wrapper {
  background: #fff;
  padding: 2rem 0;
}

body.page-factory-show .factory-info-card,
body.page-factory-show .content-card,
body.page-factory-show .card,
.factory-show-page .factory-info-card,
.factory-show-page .content-card,
.factory-show-page .card {
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-light);
  background: #fff;
  box-shadow: none;
  border-radius: 0;
}

body.page-factory-show .content-card:hover,
body.page-factory-show .factory-info-card:hover,
body.page-factory-show .jobs-card:hover,
body.page-factory-show .map-card:hover,
body.page-factory-show .card:hover,
.factory-show-page .content-card:hover,
.factory-show-page .factory-info-card:hover,
.factory-show-page .jobs-card:hover,
.factory-show-page .map-card:hover,
.factory-show-page .card:hover {
  box-shadow: none !important;
  transform: none !important;
  border-color: var(--border-light) !important;
}

body.page-factory-show .section-title,
body.page-factory-show h5.section-title,
.factory-show-page .section-title,
.factory-show-page h5.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  background: none;
  border: none;
}

/* Readability: ensure section headers are consistently spaced */
body.page-factory-show .factory-info-card .section-title,
.factory-show-page .factory-info-card .section-title {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Readability: factory image should always look sane */
body.page-factory-show .factory-cover-image,
.factory-show-page .factory-cover-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: contain;
}

body.page-factory-show .info-item,
.factory-show-page .info-item {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

body.page-factory-show .info-item:last-child,
.factory-show-page .info-item:last-child {
  border-bottom: none;
}

body.page-factory-show .info-item strong,
.factory-show-page .info-item strong {
  color: var(--text-primary);
  font-weight: 600;
}

body.page-factory-show .info-item span,
body.page-factory-show .info-item a,
.factory-show-page .info-item span,
.factory-show-page .info-item a {
  color: var(--text-secondary);
}

body.page-factory-show .btn:hover,
body.page-factory-show .btn-primary:hover,
body.page-factory-show button[type="submit"]:hover,
body.page-factory-show .btn-success:hover,
.factory-show-page .btn:hover,
.factory-show-page .btn-primary:hover,
.factory-show-page button[type="submit"]:hover,
.factory-show-page .btn-success:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* ========== STRUCTURE ========== */

body.page-factory-show .store-product-card,
.factory-show-page .store-product-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 400px !important;
}

body.page-factory-show .store-product-body,
.factory-show-page .store-product-body {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
}

body.page-factory-show .store-product-actions,
.factory-show-page .store-product-actions {
  margin-top: auto !important;
}

body.page-factory-show h5.section-title + h5.section-title,
.factory-show-page h5.section-title + h5.section-title {
  display: none !important;
}

body.page-factory-show #factory-map,
.factory-show-page #factory-map {
  height: 400px !important;
  width: 100% !important;
  overflow: hidden !important;
  position: relative !important;
}

body.page-factory-show #factory-map iframe,
.factory-show-page #factory-map iframe {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
}

/* ========== MOBILE (FIRST PRIORITY) ========== */

@media (max-width: 768px) {
  body.page-factory-show .factory-header,
  .factory-show-page .factory-header {
    padding: 1.5rem 0;
  }
  
  body.page-factory-show .factory-header h1,
  .factory-show-page .factory-header h1 {
    font-size: 1.4rem;
    text-align: center;
  }
  
  body.page-factory-show .factory-header p,
  .factory-show-page .factory-header p {
    font-size: 0.9rem;
    text-align: center;
  }
  
  body.page-factory-show .store-products-grid,
  .factory-show-page .store-products-grid {
    grid-template-columns: 1fr !important;
  }
  
  body.page-factory-show #factory-map,
  .factory-show-page #factory-map {
    height: 300px !important;
  }
  
  body.page-factory-show .store-product-card,
  .factory-show-page .store-product-card {
    min-height: 350px !important;
  }
  
  body.page-factory-show .btn,
  body.page-factory-show .btn-outline-primary,
  .factory-show-page .btn,
  .factory-show-page .btn-outline-primary {
    min-height: 44px;
    padding: 0.75rem 1rem;
  }
  
  body.page-factory-show img,
  .factory-show-page img {
    max-width: 100%;
    height: auto;
  }
  
  body.page-factory-show .factory-article-content,
  .factory-show-page .factory-article-content {
    max-width: 100%;
  }
}
