/**
 * Theme Name: SabriTheme Child
 * اسم القالب: SabriTheme Child
 * Template: astra
 * القالب الأب: astra
 * Version: 2.1
 * الإصدار: 2.1
 * Description: Überarbeitetes Stylesheet für den Produkt-Konfigurator.
 * الوصف: ورقة أنماط مُحسّنة لأداة إعداد المنتج.
 */

/* تحويل Aufkleber إلى نظام العمود الواحد */
.page-container.configurator-active {
  display: flex;
  flex-direction: column !important; /* عمودي دائماً */
  max-width: 540px !important; /* العرض الذي طلبته */
  margin: 20px auto !important;
  padding: 10px;
  gap: 20px;
}

.configurator-container,
.summary-section-container {
  width: 100% !important;
  flex: none !important;
  min-width: 0 !important;
}

/* تعديل عرض الزر ليتناسب مع التصميم الجديد */
.add-to-cart-button-aufkleber {
  width: 100% !important; /* ملء العرض بالكامل لسهولة الضغط */
}
/* حاوية قسم الملخص (العمود الأيمن) */
.summary-section-container {
  flex: 2;
  min-width: 320px;
  align-self: stretch;
  border: 1px solid #861e38;
  border-radius: 8px;
  background-color: #fff;
  overflow: hidden;
}

/* ==========================================================================
   Formular-Elemente (Fieldsets, Legends, Inputs)
   عناصر النموذج (مجموعات الحقول، العناوين، حقول الإدخال)
   ========================================================================== */

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;
  display: flex;
  align-items: center;
}

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;
  box-sizing: border-box;
  background-color: #fff;
  color: #333;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}

input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: #861e38;
  outline: none;
  box-shadow: 0 0 0 2px rgba(134, 30, 56, 0.2);
}

/* ==========================================================================
   Info-Popover
   نافذة المعلومات المنبثقة
   ========================================================================== */

.info-popover-aufkleber {
  position: absolute;
  background-color: #333;
  color: #fff;
  padding: 12px 18px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 300px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition:
    opacity 0.3s ease,
    visibility 0s 0.3s,
    transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.info-popover-aufkleber.visible {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
  transform: translateY(0);
}

.info-popover-aufkleber::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
}

.info-popover-aufkleber.arrow-down::after {
  top: 100%;
  border-color: #333 transparent transparent transparent;
}

.info-popover-aufkleber.arrow-up::after {
  bottom: 100%;
  border-color: transparent transparent #333 transparent;
}

/* ==========================================================================
   Kachelauswahl für Aufkleberform
   اختيار شكل الملصق بنظام البلاطات
   ========================================================================== */

.aufkleber-sticker-shape-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 10px;
}

.aufkleber-sticker-shape-container
  .aufkleber-visual-select-option
  input[type="radio"] {
  opacity: 0;
  position: absolute;
  width: 0;
  height: 0;
}

.aufkleber-sticker-shape-container .aufkleber-visual-select-option {
  flex-grow: 1;
  flex-basis: 120px;
}

.aufkleber-sticker-shape-container .aufkleber-visual-select-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 120px;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease-in-out;
  background-color: #fff;
  position: relative;
}

.aufkleber-sticker-shape-container
  .aufkleber-visual-select-option
  .icon-wrapper {
  width: 50px;
  height: 50px;
  margin-bottom: 8px;
}

.aufkleber-sticker-shape-container
  .aufkleber-visual-select-option
  .icon-wrapper
  .main-icon {
  width: 100%;
  height: 100%;
}

.aufkleber-sticker-shape-container
  .aufkleber-visual-select-option
  .checkmark-overlay {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  background-color: #861e38;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}

.aufkleber-sticker-shape-container
  .aufkleber-visual-select-option
  .checkmark-overlay
  svg {
  width: 16px;
  height: 16px;
  fill: white;
}

.aufkleber-sticker-shape-container .aufkleber-visual-select-option span {
  font-size: 13px;
  color: #333;
  line-height: 1.3;
}

.aufkleber-sticker-shape-container
  .aufkleber-visual-select-option
  input[type="radio"]:checked
  + label {
  border-color: #861e38;
  background-color: #fdf5f7;
  box-shadow: 0 0 8px rgba(134, 30, 56, 0.2);
}

.aufkleber-sticker-shape-container
  .aufkleber-visual-select-option
  input[type="radio"]:checked
  + label
  .checkmark-overlay {
  display: flex;
}

.aufkleber-sticker-shape-container
  .aufkleber-visual-select-option
  input[type="radio"]:focus-visible
  + label {
  outline: 2px solid #861e38;
  outline-offset: 2px;
}

.aufkleber-visual-select-option.disabled-option label {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #f0f0f0;
}

/* ==========================================================================
   Datei-Upload-Liste
   قائمة الملفات المرفوعة
   ========================================================================== */

.selected-files-container-aufkleber {
  margin-top: 10px;
  font-size: 0.9em;
  border: 1px solid #e0e0e0;
  padding: 10px;
  border-radius: 4px;
  background-color: #f9f9f9;
}

.selected-files-list-aufkleber {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.selected-files-list-aufkleber li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dotted #dddddd;
}

.selected-files-list-aufkleber li:last-child {
  border-bottom: none;
}

.remove-file-button-aufkleber {
  background: none;
  border: none;
  color: #d32f2f;
  cursor: pointer;
  font-size: 1.4em;
  font-weight: bold;
  line-height: 1;
}

/* ==========================================================================
   Rechte Spalte: Zusammenfassung und Preis
   العمود الأيمن: الملخص والسعر
   ========================================================================== */

.summary-section {
  background-color: #fff;
  border: none;
  border-radius: 0;
  padding: 25px;
  margin-bottom: 0;
  border-bottom: 1px solid #eee;
}

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

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

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

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

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

.price-and-cart-container-aufkleber {
  background-color: #ffffff;
  border: none;
  border-radius: 0;
  padding: 20px;
}

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

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

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

.net-total-price-aufkleber {
  font-size: 1.8em;
  font-weight: 700;
  text-align: right !important;
  color: #861e38;
}

.unit-price-value-aufkleber {
  font-size: 1em;
  color: #28a745 !important;
  font-weight: 700 !important;
  margin-top: -5px;
  display: block;
}

.vat-shipping-text-aufkleber {
  font-size: 0.85em;
  color: #777;
  margin-top: 8px;
  display: block;
}
/* حاوية زر الإضافة للسلة - لضمان التوسيط ومنع الانهيار */
.add-to-cart-area-aufkleber {
  display: flex;
  justify-content: center;
  width: 100%;
  padding-bottom: 20px; /* مسافة لضمان عدم خروج الزر من المربع */
  clear: both;
}
/* زر إضافة للسلة المعدل */
.add-to-cart-button-aufkleber {
  background-color: #861e38 !important;
  color: #ffffff !important;
  padding: 12px 25px;
  border: none;
  border-radius: 5px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  transition:
    background-color 0.3s ease,
    transform 0.2s ease;
  width: 90% !important; /* فرض العرض المطلوب */
  text-align: center;
  display: block;
  float: none !important; /* إلغاء التعويم الذي يمنع التوسيط */
  margin: 0 !important; /* التوسيط يتم الآن عبر الـ flex في الحاوية */
}

.add-to-cart-button-aufkleber:hover,
.add-to-cart-button-aufkleber:focus {
  background-color: #6c182d !important;
  transform: translateY(-2px);
  outline: none;
}

/* ==========================================================================
   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;
}


/* ==========================================================================
   Top Sticky Price Bar
   صندوق السعر العلوي اللاصق
   ========================================================================== */

.top-sticky-price-bar-aufkleber {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-radius: 8px;
  padding: 10px 20px;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 8px 8px rgba(0, 0, 0, 0.15);
}

.top-sticky-price-bar-aufkleber .price-details-wrapper-aufkleber {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}

/* ==========================================================================
   Sticky Bar Logic - Mobile (80px) & PC (190px)
   ========================================================================== */

/* الوضع الافتراضي (للموبايل والأجهزة الصغيرة) */
.top-sticky-price-bar-aufkleber.is-sticky {
  display: flex;
  position: fixed !important;

  /* المسافة للموبايل */
  top: 80px !important;

  /* الترتيب الطبقي */
  z-index: 90 !important;

  left: 0;
  width: 100%;

  /* إزالة المارجن القديم لضمان دقة المسافة */
  margin-top: 0 !important;

  background-color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

/* الوضع للأجهزة الكبيرة (PC / Desktop) - شاشات أكبر من 992px */
@media (min-width: 992px) {
  .top-sticky-price-bar-aufkleber.is-sticky {
    /* المسافة للكمبيوتر */
    top: 190px !important;
  }
}

.top-sticky-price-bar-aufkleber .net-total-price-aufkleber {
  font-size: 2em;
}

/* ==========================================================================
   Standardgrößen-Buttons
   أزرار الأحجام القياسية
   ========================================================================== */

.standard-sizes-container {
  margin-bottom: 25px;
}

.standard-sizes-label {
  display: block;
  font-weight: 500;
  color: #555;
  margin-bottom: 10px;
}

.standard-sizes-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.standard-size-option input[type="radio"] {
  opacity: 0;
  position: absolute;
  width: 0;
  height: 0;
}

.standard-size-option label {
  display: inline-block;
  padding: 8px 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  background-color: #ffffff;
  font-size: 14px;
}

.standard-size-option input[type="radio"]:checked + label {
  background-color: #861e38;
  color: #fff;
  border-color: #861e38;
}

.standard-size-option label:hover {
  border-color: #861e38;
}

/* ==========================================================================
   Konfigurator-Validierung & Anfrage
   التحقق من صحة المدخلات ونموذج الاستفسار
   ========================================================================== */

.input-error {
  border-color: #d63638 !important;
  border-width: 2px !important;
}

.aufkleber-validation-message {
  color: #d63638;
  font-size: 0.9em;
  margin-top: 5px;
  display: block;
}

.aufkleber-info-message {
  color: #d63638;
  background-color: #ffffff;
  border: 1px solid #d63638;
  padding: 10px;
  margin-top: 15px;
  margin-bottom: 10px;
  border-radius: 4px;
  font-size: 0.95em;
  display: block;
}

#aufkleber-inquiry-section {
  margin-top: 20px;
  margin-bottom: 15px;
}

.aufkleber-inquiry-notice {
  background-color: #861e38;
  color: #ffffff;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 25px;
  font-size: 0.95em;
}

.aufkleber-inquiry-notice p {
  margin: 0 0 10px 0;
  color: #ffffff;
}

.aufkleber-inquiry-notice p:last-child {
  margin-bottom: 0;
}

.aufkleber-inquiry-notice ul {
  list-style-type: disc;
  margin: 15px 0 15px 20px;
  padding: 0;
}

.aufkleber-inquiry-notice li {
  margin-bottom: 5px;
  color: #ffffff;
}

.aufkleber-inquiry-form {
  border: 1px solid #861e38;
  padding: 20px;
  border-radius: 8px;
}

.aufkleber-inquiry-form h4 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.2em;
  color: #861e38;
}

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

.aufkleber-inquiry-form input[type="text"],
.aufkleber-inquiry-form input[type="email"],
.aufkleber-inquiry-form input[type="tel"] {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

#summary-price-total-net small {
  display: block;
  line-height: 1.2;
  margin-top: 5px;
}

#summary-shipping-cost span {
  color: #28a745;
  font-weight: bold;
}
/* --- تكبير النصوص في الشريط العلوي اللاصق فقط --- */

/* 1. تكبير نصوص الضرائب (Netto + MwSt) في الشريط العلوي */
#top-price-breakdown-details {
  font-size: 0.75em !important; /* تكبير بسيط ليبقى متناسقاً */
  font-weight: 500;
  color: #666 !important;
  line-height: 1.2;
}

/* 2. تكبير سعر القطعة الأخضر في الشريط العلوي بشكل ملحوظ */
#top-price-unit-details {
  font-size: 0.85em !important; /* تكبير حجم سعر القطعة */
  font-weight: 800 !important;
  color: #28a745 !important;
  margin-top: 3px;
  display: block;
}

/* تعديل مساحة الحاوية في الشريط العلوي لتستوعب الخط الأكبر */
.price-details-wrapper-aufkleber {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}
