/**
 * =========================================================================
 * BESCHRIFTUNG - FINALE STYLESHEET (Version bereinigt)
 * =========================================================================
 * Dies ist die finale, bereinigte Version des Stylesheets.
 * Alle Duplikate und veralteten Regeln wurden entfernt.
 * =========================================================================
 */

/* ==========================================================================
   1. Grundlegende Layout-Struktur (Single Column - 540px)
   ========================================================================== */

.page-container.configurator-active {
  display: flex !important;
  flex-direction: column !important; /* فرض الترتيب العمودي */
  max-width: 540px !important; /* العرض المطلوب */
  margin: 20px auto !important;
  padding: 10px;
  gap: 20px;
}

.configurator-container {
  width: 100% !important;
  max-width: 540px !important;
  margin: 0 auto !important;
  min-width: 320px;
  position: relative;
  display: block !important;
}

.summary-section-container {
  width: 100% !important;
  max-width: 540px !important;
  margin: 0 auto 40px auto !important;
  min-width: 320px;
  background-color: #ffffff;
  border: 1px solid #861e38;
  border-radius: 8px;
  padding: 25px;
  box-sizing: border-box; /* لضمان عدم خروج البادينج عن العرض */
  display: block !important;
}
/* ==========================================================================
   2. Formular-Grundelemente
   ========================================================================== */

fieldset {
  border: 1px solid #861e38;
  padding: 20px;
  margin-bottom: 25px;
  border-radius: 8px;
}

legend {
  font-weight: 600;
  font-size: 1.1em;
  padding: 0 10px;
  color: #861e38;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
}

input[type="number"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* ==========================================================================
   3. Spezifische Konfigurator-Elemente
   ========================================================================== */

/* --- 3.1 Button-Auswahl für Service-Art --- */
#beschriftung-config-form .button-selector-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

#beschriftung-config-form .selector-button {
  background-color: #ffffff;
  border: 2px solid #ddd;
  border-radius: 6px;
  padding: 12px 18px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 500;
  color: #333;
  transition: all 0.2s ease-in-out;
  position: relative;
  flex-grow: 1;
  text-align: center;
}

#beschriftung-config-form .selector-button:hover {
  border-color: #861e38;
  color: #861e38;
}

#beschriftung-config-form .selector-button.selected {
  background-color: #fdf5f7;
  border-color: #861e38;
  color: #861e38;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(134, 30, 56, 0.15);
}

#beschriftung-config-form .selector-button.selected::after {
  content: "✔";
  position: absolute;
  top: 5px;
  right: 8px;
  font-size: 16px;
  color: #861e38;
}

/* --- 3.2 Visuelle Farbauswahl --- */
.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px;
  margin-top: 5px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background-color: #fdfdfd;
}

.color-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  border: 2px solid transparent;
  padding: 5px;
  border-radius: 5px;
  transition: all 0.2s ease-in-out;
  width: 70px;
}

.color-swatch {
  width: 40px;
  height: 40px;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-bottom: 5px;
  position: relative;
}

.color-name-display {
  font-size: 12px;
  color: #333;
  text-align: center;
  line-height: 1.2;
  font-weight: 500;
}

.color-code-display {
  font-size: 11px;
  color: #777;
}

.color-option:hover {
  border-color: #861e38;
  background-color: #f9f9f9;
}

.color-option.selected {
  border-color: #861e38;
  background-color: #fdf5f7;
}

.color-option.selected .color-swatch::after {
  content: "✔";
  color: white;
  font-size: 20px;
  line-height: 40px;
  text-align: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.7);
}

/* --- 3.3 Schalter (Toggle Switches) --- */
.toggle-wrapper {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  margin-right: 10px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #861e38;
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* --- 3.4 Datei-Upload-Liste --- */
.selected-files-beschriftung ul {
  list-style-type: none;
  padding: 0;
  margin: 15px 0 0 0;
}

.selected-files-beschriftung li {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 8px 12px;
  margin-bottom: 5px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9em;
}

.remove-file-button-beschriftung {
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  font-weight: bold;
  padding: 0;
}

/* ==========================================================================
   4. Popover Info-Boxen
   ========================================================================== */

.config-popover {
  position: absolute;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 15px;
  width: 300px;
  z-index: 100;
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
  font-size: 0.95em;
  line-height: 1.5;
  color: #333;
}

.config-popover.visible {
  visibility: visible;
  opacity: 1;
}

.config-popover.arrow-bottom::after,
.config-popover.arrow-bottom::before {
  content: "";
  position: absolute;
  border-style: solid;
  border-color: transparent;
  width: 0;
  height: 0;
}

.config-popover.arrow-bottom::before {
  top: 100%;
  left: 50%;
  margin-left: -9px;
  border-width: 9px;
  border-top-color: #e0e0e0;
}

.config-popover.arrow-bottom::after {
  top: 100%;
  left: 50%;
  margin-left: -8px;
  border-width: 8px;
  border-top-color: #ffffff;
}

/* ==========================================================================
   5. Zusammenfassung & Preis (Rechte Spalte)
   ========================================================================== */

.summary-section {
  background-color: transparent; /* << جعل الخلفية شفافة */
  border: none; /* << إزالة الحافة */
  padding: 0; /* << إزالة الهامش الداخلي */
  margin-bottom: 30px; /* << إضافة مسافة قبل منطقة السعر */
  border-radius: 0; /* << إزالة الحواف الدائرية */
}

.summary-section h2 {
  margin-top: 0;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
  margin-bottom: 15px;
  font-size: 1.6em;
}

.summary-section .summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dotted #eee;
}

.summary-section .summary-item:last-child {
  border-bottom: none;
}

.summary-label {
  color: #666;
  margin-right: 15px;
}

.summary-value {
  color: #000;
  font-weight: 500;
  text-align: right;
}

.price-and-cart-container-beschriftung {
  background-color: transparent; /* << جعل الخلفية شفافة */
  border: none; /* << إزالة الحافة */
  padding: 0; /* << إزالة الهامش الداخلي */
  border-radius: 0; /* << إزالة الحواف الدائرية */
}

.price-display-area-beschriftung {
  text-align: right;
  margin-bottom: 15px;
}

.price-main-line-beschriftung {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}

.price-label-beschriftung {
  font-weight: 600;
  font-size: 1.2em;
  color: #333;
}

.net-total-price-beschriftung {
  font-size: 1.8em;
  font-weight: 700;
  color: #861e38;
}

.unit-price-value-beschriftung {
  font-size: 1em;
  color: #28a745 !important;
  font-weight: 700 !important;
}

.vat-shipping-text-beschriftung {
  font-size: 0.85em;
  color: #777;
  margin-top: 8px;
  display: block;
}

.add-to-cart-button-beschriftung {
  background-color: #861e38 !important;
  color: #ffffff !important;
  padding: 12px 25px;
  border: none;
  border-radius: 5px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
}
/* ==========================================================================
   Anpassung für Standard WooCommerce Formular
   تعديل لنموذج ووكومرس القياسي
   ========================================================================== */

/* استهداف نموذج "أضف إلى السلة" القياسي لووكومرس */
form.cart {
  clear: both;
  padding-top: 20px;
  float: none !important; /* تم التغيير من left إلى none */
  width: 100% !important;
  display: block !important;
}
/* ==========================================================================
   Stile für Top Sticky Price Bar (Neues, verbessertes Design)
   أنماط شريط السعر العلوي (تصميم جديد ومحسن)
   ========================================================================== */

/* ==> يمكنك تعديل المسافات من الأعلى بسهولة من هنا <== */
:root {
  --sticky-top-desktop: 190px; /* المسافة على شاشات الحاسوب */
  --sticky-top-mobile: 0px; /* المسافة على شاشات الجوال */
}

/* 1. التصميم الأساسي للشريط (مدمج من أفضل ما في الكودين) */
.beschriftung-top-sticky-bar {
  /* التصميم المأخوذ من كودك الجديد */
  background-color: #ffffff;
  border-radius: 8px;
  padding: 15px 25px;
  margin-bottom: 25px; /* المسافة السفلية مثل تصميمك الآخر */
  box-shadow: 0 8px 8px rgba(0, 0, 0, 0.15);

  /* التخطيط الداخلي الذي صممناه */
  display: flex;
  justify-content: space-between;
  align-items: baseline;

  /* خصائص أخرى ضرورية */
  width: 100%;
  box-sizing: border-box; /* لضمان أن الهامش لا يزيد العرض */
  z-index: 90;

  /* للتحكم بالإظهار والإخفاء */
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 0.3s ease-out,
    visibility 0.3s ease-out;
  max-width: 540px !important; /* أضف هذا السطر */
  margin-left: auto !important;
  margin-right: auto !important;
  left: 0;
  right: 0;
}

.beschriftung-top-sticky-bar.visible {
  visibility: visible;
  opacity: 1;
}

/* 2. تصميم النصوص الداخلية (تبقى كما هي) */
.sticky-price-details {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.beschriftung-top-sticky-bar .sticky-price-label {
  font-size: 1.2em;
  font-weight: 600;
  color: #333;
}
.beschriftung-top-sticky-bar .sticky-price-value {
  font-size: 2em;
  font-weight: 700;
  color: #861e38;
}
.sticky-price-subtext {
  font-size: 0.85em;
  color: #777;
  margin-top: 2px;
}

/* 3. تحديد الموضع حسب حجم الشاشة (باستخدام المتغيرات) */

/* على الحاسوب (شاشة أكبر من 992 بكسل) */
@media (min-width: 993px) {
  .beschriftung-top-sticky-bar {
    position: -webkit-sticky; /* لدعم متصفح سفاري */
    position: sticky;
    top: var(--sticky-top-desktop);
  }
}

/* على الجوال (شاشة أصغر من 992 بكسل) */
@media (max-width: 992px) {
  .beschriftung-top-sticky-bar {
    position: sticky;
    top: 80px;
    border-radius: 8px; /* نزيل الحواف الدائرية على الجوال لأنه يملأ الشاشة */
    margin-bottom: 0; /* لا حاجة لمسافة سفلية وهو ثابت */
  }
  .page-container.configurator-active {
    padding-top: 85px; /* مسافة لتجنب التداخل على الجوال */
  }
}
/* ======================================================
   Stile für Preset-Buttons (Standardgrößen & Menge)
   ====================================================== */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 5px;
  margin-bottom: 15px;
}
.preset-grid-tight {
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
}
.preset-button {
  border: 2px solid #ddd;
  background-color: #fff;
  padding: 12px;
  text-align: center;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}
.preset-button:hover {
  border-color: #aaa;
}
.preset-button.active {
  border-color: #861e38;
  background-color: #fdf5f7;
  color: #861e38;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(134, 30, 56, 0.1);
}
/* Stil für die Abmessungswarnung */
.beschriftung-dimension-warning-message {
  padding: 10px 15px;
  border-radius: 5px;
  color: #721c24; /* Dark red text */
  background-color: #f8d7da; /* Light red background */
  border: 1px solid #f5c6cb; /* Red border */
  font-weight: 500;
  text-align: center;
}
/* Stile für Angebotsanfrage */
.beschriftung-notice {
  padding: 15px 20px;
  border-radius: 5px;
  margin-top: 15px;
  border: 1px solid transparent;
}

.beschriftung-notice-info {
  color: #ffffff; /* تغيير لون النص إلى الأبيض */
  background-color: #861e38; /* تغيير لون الخلفية إلى اللون العنابي الداكن */
  border-color: #70172d; /* تغيير لون الحافة ليتطابق */
}

.beschriftung-quote-button {
  width: 100%;
  padding: 12px 25px;
  font-size: 1.2em;
  font-weight: bold;
  background-color: #861e38 !important;
  color: #ffffff !important;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.beschriftung-quote-form {
  border: 1px solid #861e38;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
}

.beschriftung-quote-form .input-text {
  width: 100%;
  margin-top: 5px;
}
/* التحكم بالمسافات داخل صندوق عرض السعر */
.beschriftung-notice-info p,
.beschriftung-notice-info ul {
  margin-bottom: 0.4em; /* يمكنك تغيير هذه القيمة لتكون أصغر أو أكبر حسب رغبتك */
}
/* --- NEU: تنسيقات تفاصيل السعر والشحن الأخضر --- */
.beschriftung-text-green {
  color: #28a745 !important;
  font-weight: bold;
}
.price-breakdown-beschriftung,
.sticky-price-breakdown {
  display: block;
  font-size: 0.85em; /* أصغر قليلاً من السعر الرئيسي */
  color: #28a745 !important;
  font-weight: 700 !important;
  margin-top: 4px;
  font-weight: normal;
}
.price-label-beschriftung {
  font-size: 1.1em;
}
.beschriftung-text-green {
  color: #28a745 !important; /* اللون الأخضر */
  font-weight: bold;
}

/* ==========================================================================
   WooCommerce Standard-Elemente ausblenden (مُحدث لاستثناء المنتجات ذات الصلة)
   ========================================================================== */

/* إخفاء عناصر المنتج الرئيسي فقط باستخدام .entry-summary */
.woocommerce div.product .entry-summary button.single_add_to_cart_button,
.woocommerce div.product .entry-summary .quantity,
.woocommerce div.product .entry-summary p.price,
.woocommerce div.product .entry-summary span.price,
.woocommerce-breadcrumb,
.product_meta,
#ppcp-messages,
.ppcp-messages,
.product_title.entry-title {
  display: none !important;
}

/* احتياط إضافي: إخفاء نموذج السلة الرئيسي إذا لم يكن هو الكونفيجوريتور */
.woocommerce div.product .entry-summary form.cart:not(.configurator-cart) {
  display: none !important;
}

/* إجبار السعر وزر الإضافة على الظهور في قسم المنتجات ذات الصلة (Zubehör) */
.related.products .price,
.related.products .quantity,
.related.products .button,
.related.products .add_to_cart_button {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}