/* Custom invitation design: a work's extras, owner page, guest view and the «تصميم دعوة خاصة» section. */
.cd-owner, .cd-view {
  --cd-ink: #360125;
  --cd-ink-soft: #5c4a57;
  --cd-muted: #7a6674;
  --cd-accent: #522546;
  --cd-line: #eadfe6;
  --cd-bg: #fff7f9;
  --cd-wa: #1f9d55;
  color: var(--cd-ink);
  box-sizing: border-box;
}
.cd-owner *, .cd-view * { box-sizing: border-box; }

/* Shared */
.cd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--cd-accent);
  background: #fff; color: var(--cd-accent); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
}
.cd-btn:hover { text-decoration: none; filter: brightness(.97); }
.cd-btn[disabled] { opacity: .6; cursor: default; }
.cd-btn--primary { background: var(--cd-accent); color: #fff; }
.cd-btn--whatsapp { background: var(--cd-wa); border-color: var(--cd-wa); color: #fff; }
.cd-card { background: #fff; border: 1px solid var(--cd-line); border-radius: 16px; padding: 16px; }

/* A work's page: the shared product layout (shop/components/product-detail.php + template_product.css);
   only the parts a template does not have are styled here. */
.cd-work { --cd-ink: #360125; --cd-muted: #7a6674; --cd-accent: #522546; --cd-line: #eadfe6; --cd-bg: #fff7f9; }
.cd-work__preview img, .cd-work__preview video { user-select: none; -webkit-user-drag: none; }
.cd-work__preview .cd-video__el { max-height: 80vh; border-radius: 12px; }
.cd-work__types { border: 0; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.cd-work__types-legend { font-size: 14px; font-weight: 700; color: var(--cd-ink); margin-bottom: 8px; padding: 0; }
.cd-work__type { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border: 1px solid var(--cd-line); border-radius: 12px; background: #fff; cursor: pointer; margin: 0; }
.cd-work__type:has(input:checked) { border-color: var(--cd-accent); background: var(--cd-bg); box-shadow: 0 0 0 1px var(--cd-accent) inset; }
.cd-work__type input { accent-color: var(--cd-accent); width: 18px; height: 18px; margin: 0; }
.cd-work__type-name { flex: 1; font-weight: 600; color: var(--cd-ink); }
.cd-work__type .cd-work__type-price { font-size: 20px; font-weight: 700; color: var(--cd-accent); }
/* Phones: template_product.css flattens the columns and orders preview(1) · header(2) · CTA(3);
   the work's type choice follows the header. A work has no phone price beside the title until it
   is priced, so «السعر يُعلن قريبًا» stays visible. */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  .cd-work__types, .cd-work .cd-work__price-soon { order: 2; margin-block: 0; }
  .cd-work .cd-work__price-soon { display: block !important; }
}

/* Owner page */
.cd-owner { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; display: grid; gap: 16px; }
.cd-owner__header { display: grid; gap: 8px; justify-items: start; }
.cd-owner__title { font-size: 24px; font-weight: 700; margin: 0; }
.cd-owner__hint { color: var(--cd-ink-soft); margin: 0; line-height: 1.8; }
.cd-status { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #f3e8ef; color: var(--cd-accent); }
.cd-status--ready { background: #e3f4ea; color: #2d6a4f; }
.cd-status--canceled { background: #f6e2e2; color: #9b2c2c; }
.cd-owner__design { display: flex; justify-content: center; }
.cd-owner__image, .cd-owner__design video { max-width: 100%; max-height: 70vh; border-radius: 12px; display: block; }
.cd-owner__placeholder { width: 100%; min-height: 180px; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--cd-muted); background: var(--cd-bg); border-radius: 12px; padding: 16px; line-height: 1.8; }
.cd-owner__pay { display: grid; gap: 10px; }
.cd-owner__price { margin: 0; font-size: 16px; }
.cd-owner__price strong { font-size: 22px; margin-inline-start: 6px; }
.cd-owner__note { margin: 0; color: var(--cd-muted); font-size: 13px; }
.cd-owner__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cd-owner__contact { margin: 0; }
.cd-owner__design { flex-direction: column; align-items: center; gap: 10px; }
.cd-owner__version { margin: 0; font-weight: 700; color: var(--cd-accent); }
.cd-owner__review { display: grid; gap: 14px; }
.cd-owner__review textarea { min-height: 110px; }
.cd-form { display: grid; gap: 14px; }
.cd-form__title { font-size: 18px; margin: 0; }
.cd-form__hint { margin: 0; color: var(--cd-muted); font-size: 13px; line-height: 1.7; }
.cd-form__row { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .cd-form__row { grid-template-columns: 1fr 1fr; } }
.cd-field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.cd-field input, .cd-field textarea { width: 100%; min-height: 44px; border: 1px solid #d9cbd4; border-radius: 10px; padding: 8px 12px; font: inherit; font-weight: 400; background: #fff; }
.cd-form__toggles { border: 1px dashed var(--cd-line); border-radius: 12px; padding: 10px 14px; display: grid; gap: 8px; margin: 0; }
.cd-form__toggles legend { font-size: 14px; font-weight: 600; padding: 0 6px; }
.cd-form__toggles label { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.cd-form__error { color: #9b2c2c; background: #fdf0f0; border-radius: 8px; padding: 8px 12px; margin: 0; }
.cd-form__status { color: #2d6a4f; margin: 0; min-height: 1.2em; }

/* Guest view */
.cd-view { max-width: 640px; margin: 0 auto; padding: 0 0 32px; display: grid; gap: 16px; }
.cd-view__media { margin: 0; }
.cd-view__image, .cd-view video { display: block; width: 100%; height: auto; }
/* Still design with music/effect: the template runtime adds its effect overlay (.effect-bg) inside
   .inv-bg-layer and its sound button (#music-toggle-preview) inside .inv-canvas-root. */
.cd-view__stage, .cd-view__stage .inv-bg-layer { position: relative; }
.cd-view__stage .background-effect-img { display: block; width: 100%; height: 100%; object-fit: fill; }
/* Still (PNG) guest view: the design alone, whole and as large as the screen allows (contain), centred,
   inside the safe area, with no page scroll. --cd-ratio is the stored file's own width / height, so the
   fitted box (and the effect overlay inside it) is exactly the picture; without it the image still
   contains itself in the full box. */
.cd-view--still {
  position: fixed; inset: 0; max-width: none; margin: 0; gap: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
.cd-view--still .cd-view__media {
  width: 100%; height: 100%; margin: 0;
  display: flex; align-items: center; justify-content: center;
  container-type: size;
}
/* The fitted box: the plain image (.cd-view__fit) or, with music/effect, the runtime stage around it. */
.cd-view--still .cd-view__fit, .cd-view--still .cd-view__stage { width: 100%; height: 100%; }
.cd-view--still .cd-view__image { width: 100%; height: 100%; object-fit: contain; }
.cd-view--still .cd-view__stage .inv-bg-layer { width: 100%; height: 100%; }
@supports (width: 1cqw) {
  .cd-view--still[style*="--cd-ratio"] .cd-view__fit,
  .cd-view--still[style*="--cd-ratio"] .cd-view__stage {
    width: min(100cqw, 100cqh * (var(--cd-ratio)));
    height: auto;
    aspect-ratio: var(--cd-ratio);
  }
}
.cd-view__details { background: #fff; border: 1px solid var(--cd-line); border-radius: 16px; padding: 16px; margin: 0 16px; display: grid; gap: 8px; }
.cd-view__row { margin: 0; line-height: 1.8; }
.cd-view__label { font-weight: 700; margin-inline-end: 4px; }
.cd-video { position: relative; }
.cd-video__el { display: block; width: 100%; background: #000; }
.cd-video__sound { position: absolute; bottom: 12px; inset-inline-start: 12px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; cursor: pointer; }

/* The «تصميم دعوة خاصة» section (includes/components/custom-design-cta.php — the one component, right above the
   package cards on the home page and below the listing on every /shop view). The package cards stay as they are.
   A cream, botanical panel: the title, a subtitle, a short lead and three real actions on one side, the picture
   (custom-design-visual.php: an invitation and a phone with a video invitation) on the other. RTL: text on the
   right, picture on the left; LTR mirrors it (logical properties only).
   Palette (one place, the tokens below): cream ground, the site's aubergine (--theme-primary, #522546) for the
   title and the first button, blush for «شراء تصميم خاص», cream with a gold edge for «تواصل معنا», gold ornament.
   The sprigs are the middle package card's own ornament files (assets/frontend/images/pricing/shape-1.svg and
   shape-2.svg) used in place as masks, so only their colour changes here. */
.cd-section {
  --cds-ink: var(--theme-primary, #522546);
  --cds-ink-deep: #3d1733;
  --cds-text: #3a2a33;
  --cds-muted: #7a6870;
  --cds-bg: #fbf6f0;
  --cds-bg-2: #f5ece3;
  --cds-line: #eadccd;
  --cds-gold: #c3a06d;
  --cds-gold-soft: #e7d6bc;
  --cds-blush: #f5e1e6;
  --cds-blush-line: #e9c6cf;
  --cds-cream: #fffaf4;
  position: relative; isolation: isolate; overflow: hidden; box-sizing: border-box;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); align-items: center; gap: 40px;
  width: 100%; max-width: 1180px; margin: 56px auto; padding: 56px 56px 52px;
  border-radius: 28px; border: 1px solid var(--cds-line); color: var(--cds-text);
  background:
    radial-gradient(120% 90% at 85% 0%, #fffdf9 0%, rgba(255, 253, 249, 0) 60%),
    linear-gradient(160deg, var(--cds-bg) 0%, var(--cds-bg-2) 100%);
  box-shadow: 0 28px 60px rgba(108, 72, 52, .10), 0 4px 12px rgba(82, 37, 70, .05);
}
.cd-section *, .cd-section *::before, .cd-section *::after { box-sizing: border-box; }
/* Two soft sprigs in the far corners (decoration only, behind everything). */
.cd-section::before, .cd-section::after { content: ""; position: absolute; z-index: -1; pointer-events: none; background: var(--cds-gold-soft);
  -webkit-mask: var(--cds-leaf) center / contain no-repeat; mask: var(--cds-leaf) center / contain no-repeat; }
.cd-section::before { --cds-leaf: url("../../../frontend/images/pricing/shape-1.svg"); width: 150px; height: 190px; inset-inline-start: -26px; top: -30px; opacity: .55; }
.cd-section::after { --cds-leaf: url("../../../frontend/images/pricing/shape-2.svg"); width: 120px; height: 152px; inset-inline-end: -22px; bottom: -28px; opacity: .45; }

.cd-section__text { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
/* A small gold sprig between two fine lines above the title. */
.cd-section__ornament { position: relative; width: 44px; height: 44px; margin-bottom: 14px; background: var(--cds-gold);
  -webkit-mask: url("../../../frontend/images/pricing/shape-1.svg") center / contain no-repeat; mask: url("../../../frontend/images/pricing/shape-1.svg") center / contain no-repeat; }
.cd-section__text::before { content: ""; width: min(320px, 80%); height: 1px; margin-bottom: -36px; margin-top: 22px;
  background: linear-gradient(90deg, transparent, var(--cds-gold) 22%, var(--cds-gold) 38%, transparent 38%, transparent 62%, var(--cds-gold) 62%, var(--cds-gold) 78%, transparent); opacity: .8; }
.cd-section__title { margin: 0 0 12px; font-size: clamp(30px, 3.4vw, 48px); font-weight: 700; line-height: 1.2; color: var(--cds-ink-deep); letter-spacing: 0; }
.cd-section__subtitle { margin: 0 0 18px; font-size: clamp(17px, 1.6vw, 22px); font-weight: 700; line-height: 1.6; color: var(--cds-text); }
.cd-section__lead { margin: 0 0 30px; max-width: 520px; font-size: clamp(15px, 1.25vw, 18px); line-height: 1.9; color: var(--cds-muted); }

.cd-section__actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; width: 100%; max-width: 640px; }
.cd-section__action { display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: 0; }
.cd-section__btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 116px; padding: 16px 12px;
  border-radius: 16px; border: 1.5px solid transparent; font-size: 17px; font-weight: 700; line-height: 1.35; text-align: center; text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease; }
.cd-section__btn svg { flex: none; }
.cd-section__btn:hover, .cd-section__btn:focus-visible { text-decoration: none; transform: translateY(-2px); }
.cd-section__btn:focus-visible { outline: 2px solid var(--cds-gold); outline-offset: 3px; }
.cd-section__btn--view { color: #fff; background: linear-gradient(150deg, color-mix(in srgb, var(--cds-ink) 78%, #b7708f) 0%, var(--cds-ink) 100%);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--cds-ink) 28%, transparent); }
.cd-section__btn--view:hover, .cd-section__btn--view:focus-visible { color: #fff; box-shadow: 0 16px 30px color-mix(in srgb, var(--cds-ink) 34%, transparent); }
.cd-section__btn--buy { color: var(--cds-ink-deep); background: var(--cds-blush); border-color: var(--cds-blush-line); box-shadow: 0 10px 22px rgba(214, 150, 170, .18); }
.cd-section__btn--buy:hover, .cd-section__btn--buy:focus-visible { color: var(--cds-ink-deep); box-shadow: 0 14px 26px rgba(214, 150, 170, .26); }
.cd-section__btn--contact { color: var(--cds-ink-deep); background: var(--cds-cream); border-color: var(--cds-gold); box-shadow: 0 10px 22px rgba(160, 120, 70, .10); }
.cd-section__btn--contact:hover, .cd-section__btn--contact:focus-visible { color: var(--cds-ink-deep); box-shadow: 0 14px 26px rgba(160, 120, 70, .16); }
.cd-section__hint { display: block; font-size: 13.5px; line-height: 1.6; color: var(--cds-muted); text-align: center; }

.cd-section__media { min-width: 0; display: flex; justify-content: center; }

/* The picture: the invitation at the far edge, the phone overlapping its inner side (logical, so LTR mirrors). */
.cd-visual { position: relative; width: 100%; max-width: 500px; aspect-ratio: 1 / 1.02; }
.cd-visual__card { position: absolute; inset-inline-end: 0; top: 0; width: 66%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px;
  background: #fff; box-shadow: 0 26px 48px rgba(92, 60, 40, .20), 0 4px 10px rgba(92, 60, 40, .10); user-select: none; -webkit-user-drag: none; }
.cd-visual__phone { position: absolute; inset-inline-end: 52%; bottom: 0; width: 41%; aspect-ratio: 9 / 18.6; padding: 7px; border-radius: 34px;
  background: linear-gradient(145deg, #f7f4f1, #d9d3cd); box-shadow: 0 30px 50px rgba(60, 40, 30, .26), 0 2px 0 rgba(255, 255, 255, .7) inset; }
.cd-visual__screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 28px; background: #111; }
.cd-visual__screen::before { content: ""; position: absolute; z-index: 2; top: 7px; left: 50%; width: 34%; height: 16px; transform: translateX(-50%);
  border-radius: 10px; background: #111; pointer-events: none; }
.cd-visual__video, .cd-visual__still { display: block; width: 100%; height: 100%; object-fit: cover; background: #111; }
.cd-visual__play { position: absolute; z-index: 3; top: 50%; left: 50%; width: 62px; height: 62px; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; justify-content: center; padding: 0 0 0 4px; border: 0; border-radius: 50%; cursor: pointer;
  color: #fff; background: rgba(110, 82, 64, .62); box-shadow: 0 6px 18px rgba(0, 0, 0, .25); backdrop-filter: blur(2px); }
.cd-visual__play:hover, .cd-visual__play:focus-visible { background: rgba(110, 82, 64, .8); }
.cd-visual__play[hidden] { display: none; }

/* Tablets: the picture above the text, the three actions side by side. */
@media (max-width: 991px) {
  .cd-section { grid-template-columns: 1fr; gap: 28px; padding: 40px 32px 36px; margin: 40px auto; }
  .cd-section__media { order: -1; }
  .cd-visual { max-width: 400px; }
}
/* Phones: the actions become rows (icon · label), each hint under its button. */
@media (max-width: 575px) {
  .cd-section { padding: 28px 16px 24px; border-radius: 22px; gap: 22px; margin: 28px auto; }
  .cd-section::before { width: 96px; height: 122px; }
  .cd-section::after { width: 80px; height: 100px; }
  .cd-visual { max-width: 300px; }
  .cd-section__ornament { width: 34px; height: 34px; margin-bottom: 10px; }
  .cd-section__text::before { margin-top: 17px; margin-bottom: -27px; }
  .cd-section__lead { margin-bottom: 22px; }
  .cd-section__actions { grid-template-columns: 1fr; gap: 12px; }
  .cd-section__action { gap: 6px; }
  .cd-section__btn { flex-direction: row; min-height: 58px; gap: 12px; font-size: 16px; padding: 10px 16px; }
  .cd-section__btn svg { width: 24px; height: 24px; }
  .cd-section__hint { font-size: 13px; }
}

/* The service's product page («شراء تصميم خاص»): the occasion choice under the types; the section's picture as the preview. */
.cd-service__occasion { display: grid; gap: 8px; margin: 0 0 18px; }
.cd-service__occasion select { min-height: 50px; border: 1px solid var(--cd-line); border-radius: 12px; padding: 8px 14px; font: inherit; background-color: #fff; color: var(--cd-ink); }
.cd-service__preview { display: flex; justify-content: center; padding: 24px 8px; background: linear-gradient(160deg, #fbf6f0, #f5ece3); border-radius: 16px; }
.cd-service__preview .cd-visual { max-width: 440px; }
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  .cd-service .cd-service__occasion { order: 2; margin-block: 0; }
}

/* Shop: the designer filter's remove link (shop-section.php, ?designer=<id>) */
.shop-designer-filter-clear { display: inline-block; margin-inline-start: 12px; color: #522546; font-weight: 600; text-decoration: underline; white-space: nowrap; }
