/* ==========================================================================
   USBoxesCo — Box Design Editor (/tools/design-your-box)
   Classes ".ube-" se shuru. Theme html font-size 62.5% rakhta hai, isliye px.
   Footer CTA band quote.css chhupa deti hai (wohi file is page pe load hai).
   ========================================================================== */

.ube {
    --ube-orange: #ff6600;
    --ube-orange-dark: #e05a00;
    --ube-orange-soft: #fff1e8;
    --ube-navy: #0f172a;
    --ube-ink: #111827;
    --ube-text: #374151;
    --ube-muted: #6b7280;
    --ube-line: #e5e7eb;
    --ube-soft: #f6f7fb;
    --ube-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px; line-height: 1.55; color: var(--ube-text);
    background: var(--ube-soft); padding-bottom: 48px;
}
.ube *, .ube *::before, .ube *::after { box-sizing: border-box; }
.ube [hidden] { display: none !important; }
/* Theme har <p> pe font-size 1.6rem !important lagata hai, isliye yahan bhi !important */
.ube p { font-size: 13px !important; line-height: 1.5; }
.ube .ube-hero p { font-size: 15px !important; }
.ube-container { width: 100%; max-width: 1480px; margin: 0 auto; padding: 0 20px; }
.ube button { font-family: inherit; }
.ube svg { width: 18px; height: 18px; flex: none; }

/* ---------- Hero ---------- */
.ube-hero {
    background: radial-gradient(600px 240px at 85% 0%, rgba(255, 102, 0, .28), transparent 70%), var(--ube-navy);
    color: #cbd5e1; padding: 26px 0 30px; margin-bottom: 22px;
}
.ube-crumbs { display: flex; gap: 8px; list-style: none; margin: 0 0 10px; padding: 0; font-size: 13px; }
.ube-crumbs li + li::before { content: '/'; margin-right: 8px; color: #64748b; }
.ube-crumbs a { color: #cbd5e1; text-decoration: none; }
.ube-crumbs a:hover { color: #fff; }
.ube-crumbs span { color: #fff; }
.ube-hero h1 { margin: 0 0 6px; color: #fff; font-size: 34px; line-height: 1.2; font-weight: 700; }
.ube-hero h1 span { color: var(--ube-orange); }
.ube-hero p { margin: 0; max-width: 720px; font-size: 15px; }

/* ---------- Layout ---------- */
.ube-app { display: grid; grid-template-columns: 290px minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.ube-card { background: #fff; border: 1px solid var(--ube-line); border-radius: 18px; box-shadow: var(--ube-shadow); padding: 18px; }

/* ---------- Settings ---------- */
.ube-step + .ube-step { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--ube-line); }
.ube-step__title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 16px; font-weight: 700; color: var(--ube-ink); }
.ube-step__title span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ube-orange-soft); color: var(--ube-orange); font-size: 13px; }
.ube-step__title small { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--ube-muted); }
.ube-seg { display: grid; gap: 8px; }
.ube-seg--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ube-seg + .ube-seg, .ube-size + .ube-seg, .ube-err + .ube-seg { margin-top: 10px; }
.ube-seg button {
    min-height: 42px; padding: 6px 10px; border: 1.5px solid var(--ube-line); border-radius: 10px; background: #fff;
    color: var(--ube-ink); font-size: 13px; font-weight: 600; line-height: 1.25; cursor: pointer; transition: border-color .15s, background .15s;
}
.ube-seg button:hover { border-color: #ffb27f; }
.ube-seg button[aria-pressed="true"] { border-color: var(--ube-orange); background: var(--ube-orange-soft); color: var(--ube-orange-dark); }
.ube-size { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.ube-size label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ube-muted); }
.ube input[type="number"], .ube textarea, .ube select {
    width: 100%; min-height: 40px; padding: 8px 10px; border: 1.5px solid var(--ube-line); border-radius: 10px;
    background: #fff; color: var(--ube-ink); font: 500 14px/1.3 'Poppins', sans-serif; margin: 0;
}
.ube input[type="number"]:focus, .ube textarea:focus, .ube select:focus { outline: none; border-color: var(--ube-orange); }
.ube input.has-error { border-color: #dc2626; }
.ube-err { margin: 8px 0 0; color: #b91c1c; font-size: 13px; }
.ube-hint { margin: 10px 0 0; font-size: 13px; color: var(--ube-muted); }
.ube-hint strong { color: var(--ube-ink); }
.ube-add { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.ube-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.ube-swatches button, .ube-swatch-custom {
    width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ube-line); background: var(--c); cursor: pointer; padding: 0;
    box-shadow: inset 0 0 0 2px #fff;
}
.ube-swatches button[aria-pressed="true"] { border-color: var(--ube-orange); }
.ube-swatch-custom { position: relative; overflow: hidden; background: conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.ube-swatch-custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

/* ---------- Buttons ---------- */
.ube-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 14px;
    border-radius: 12px; border: 2px solid transparent; cursor: pointer; text-decoration: none !important;
    font: 700 13px/1.1 'Poppins', sans-serif; letter-spacing: .03em; text-transform: uppercase; text-align: center;
    transition: background-color .2s, border-color .2s, transform .2s;
}
.ube-btn:hover { transform: translateY(-1px); }
.ube-btn--primary { background: var(--ube-orange); color: #fff !important; box-shadow: 0 10px 24px rgba(255, 102, 0, .28); }
.ube-btn--primary:hover { background: var(--ube-orange-dark); }
.ube-btn--outline { background: #fff; color: var(--ube-orange) !important; border-color: var(--ube-orange); }
.ube-btn--outline:hover { background: var(--ube-orange-soft); }
.ube-btn--block { width: 100%; }
.ube-btn[disabled] { opacity: .55; pointer-events: none; }
.ube-link { background: none; border: 0; padding: 4px; color: var(--ube-muted); font-size: 13px; font-weight: 600; text-decoration: underline; cursor: pointer; }
.ube-link:hover { color: var(--ube-ink); }
.ube-chip {
    min-height: 36px; padding: 0 12px; border: 1.5px solid var(--ube-line); border-radius: 999px; background: #fff;
    color: var(--ube-ink); font-size: 13px; font-weight: 600; cursor: pointer;
}
.ube-chip:hover { border-color: var(--ube-orange); }
.ube-chip[aria-pressed="true"] { border-color: var(--ube-orange); background: var(--ube-orange-soft); }
.ube-chip--danger { color: #b91c1c; }
.ube-chip--danger:hover { border-color: #dc2626; }

/* ---------- Editor ---------- */
.ube-main { padding: 12px; min-width: 0; }
.ube-tools { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.ube-tools button {
    display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; border-radius: 10px;
    border: 1.5px solid var(--ube-line); background: #fff; color: var(--ube-ink); font-size: 13px; font-weight: 600; cursor: pointer;
}
.ube-tools button:hover { border-color: var(--ube-orange); }
.ube-tools button[disabled] { opacity: .4; pointer-events: none; }
.ube-tools button[aria-pressed="true"] { background: var(--ube-orange-soft); border-color: var(--ube-orange); }
.ube-tools__gap { flex: 1; }
.ube-stage { position: relative; height: 640px; overflow: auto; border-radius: 12px; background: #eef1f6; }
.ube-paper { position: relative; margin: 0 auto; }
.ube-paper canvas { display: block; touch-action: none; cursor: default; outline: none; }
.ube-sel { position: absolute; left: 0; top: 0; border: 1.5px solid var(--ube-orange); pointer-events: none; transform-origin: 50% 50%; }
.ube-sel i, .ube-sel b { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; border: 2px solid var(--ube-orange); pointer-events: auto; touch-action: none; }
.ube-sel i[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.ube-sel i[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.ube-sel i[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.ube-sel i[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.ube-sel b { left: 50%; top: -28px; background: var(--ube-orange); cursor: grab; }
.ube-sel b::after { content: ''; position: absolute; left: 50%; top: 12px; width: 1.5px; height: 16px; margin-left: -.75px; background: var(--ube-orange); }

.ube-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 10px 0 0; padding: 0; font-size: 12px; color: var(--ube-muted); }
.ube-legend li { display: flex; align-items: center; gap: 6px; }
.ube-legend i { display: inline-block; width: 22px; height: 0; border-top: 2px solid #e00000; }
.ube-legend i.is-fold { border-top: 2px dashed #0050ff; }
.ube-legend i.is-safe { border-top: 2px dashed #16a34a; }
.ube-legend i.is-bleed { height: 10px; border: 0; border-radius: 3px; background: repeating-linear-gradient(45deg, #cbd5e1 0 3px, #f1f5f9 3px 6px); }

.ube-props { margin-top: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--ube-line); background: #fafbfc; }
.ube-props__text { display: grid; grid-template-columns: minmax(0, 1fr) 150px 60px auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.ube-props__text label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ube-muted); }
.ube-props__text textarea { min-height: 40px; resize: vertical; }
.ube-props__text input[type="color"] { width: 100%; height: 40px; padding: 2px; border: 1.5px solid var(--ube-line); border-radius: 10px; background: #fff; cursor: pointer; }
.ube-props__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ube-dpi { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: #15803d; }
.ube-dpi.is-low { color: #b45309; }

/* ---------- 3D ---------- */
.ube-view { position: sticky; top: 90px; }
.ube-view__title { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 8px; font-size: 16px; font-weight: 700; color: var(--ube-ink); }
.ube-view__title small { font-size: 12px; font-weight: 400; color: var(--ube-muted); }
.ube-3d { position: relative; height: 270px; border-radius: 14px; background: radial-gradient(circle at 50% 40%, #fff, #e9edf3); perspective: 900px; cursor: grab; touch-action: none; overflow: hidden; }
.ube-3d.is-drag { cursor: grabbing; }
.ube-cube { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; }
.ube-cube.is-anim { transition: transform .5s ease; }
.ube-face { position: absolute; backface-visibility: hidden; outline: 1px solid rgba(0, 0, 0, .12); }
.ube-face canvas { display: block; width: 100%; height: 100%; }
.ube-face::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
.ube-face[data-face="front"]::after { background: rgba(0, 0, 0, .03); }
.ube-face[data-face="back"]::after, .ube-face[data-face="left"]::after, .ube-face[data-face="right"]::after { background: rgba(0, 0, 0, .1); }
.ube-face[data-face="bottom"]::after { background: rgba(0, 0, 0, .18); }
/* Pillow box 3D: khari pattiyan + siron ki chhatein (js/design-editor.js drawPillow3d) */
.ube-pillow { position: absolute; transform-style: preserve-3d; }
.ube-strip { position: absolute; backface-visibility: hidden; }
.ube-strip canvas { display: block; width: 100%; height: 100%; }
.ube-cap { position: absolute; }
.ube-cap::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .16); }
.ube-views { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.ube-views button { min-height: 34px; border: 1.5px solid var(--ube-line); border-radius: 9px; background: #fff; font-size: 12px; font-weight: 600; color: var(--ube-ink); cursor: pointer; }
.ube-views button:hover { border-color: #ffb27f; }
.ube-views button[aria-pressed="true"] { border-color: var(--ube-orange); background: var(--ube-orange-soft); color: var(--ube-orange-dark); }
.ube-warn { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 13px; }
.ube-acts { display: grid; gap: 10px; margin-top: 14px; }
.ube-note { margin: 12px 0 0; font-size: 12px; color: var(--ube-muted); text-align: center; }

/* ---------- Quote popup ---------- */
.ube-modal { width: min(860px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 24px 64px rgba(15, 23, 42, .35); }
.ube-modal::backdrop { background: rgba(15, 23, 42, .55); }
.ube-modal[open] { display: flex; flex-direction: column; }
.ube-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--ube-line); }
.ube-modal__head h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--ube-ink); }
.ube-modal__close { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--ube-line); background: #fff; color: var(--ube-ink); cursor: pointer; }
.ube-modal__body { padding: 18px 20px 22px; overflow: auto; }
.ube-attach { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--ube-orange-soft); color: #9a3412; font-size: 13px; font-weight: 600; }
.ube-attach.is-ok { background: #ecfdf5; color: #166534; }
.ube-attach.is-err { background: #fef2f2; color: #991b1b; }

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
    .ube-app { grid-template-columns: 280px minmax(0, 1fr); }
    .ube-view { grid-column: 1 / -1; position: static; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 18px; }
    .ube-view__title, .ube-3d, .ube-views { grid-column: 1; }
    .ube-warn, .ube-acts, .ube-note { grid-column: 2; }
    .ube-warn { grid-row: 1; margin-top: 0; }
    .ube-acts { grid-row: 2; align-self: start; }
    .ube-note { grid-row: 3; }
}
@media (max-width: 899px) {
    .ube-app { grid-template-columns: minmax(0, 1fr); }
    .ube-view { display: block; }
    .ube-stage { height: 62vh; min-height: 360px; }
    .ube-props__text { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .ube-props__wide { grid-column: 1 / -1; }
    .ube-hero h1 { font-size: 26px; }
    .ube-sel i, .ube-sel b { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
    .ube-sel b { top: -34px; }
}
@media (max-width: 479px) {
    .ube-container { padding: 0 12px; }
    .ube-card { padding: 14px; }
    .ube-main { padding: 10px; }
    .ube-modal__body { padding: 14px; }
}

/* ---------- Guide (SEO content below the tool) ---------- */
.ube-guide { padding: 40px 0 24px; }
.ube-guide__inner { max-width: 860px; margin: 0 auto; }
.ube-guide h2 { margin: 36px 0 12px; font-size: 26px; line-height: 1.3; font-weight: 700; color: var(--ube-ink); }
.ube-guide h2:first-child { margin-top: 0; }
.ube .ube-guide p { margin: 0 0 14px; font-size: 16px !important; line-height: 1.75; color: var(--ube-text); }
.ube-guide ol, .ube-guide ul { margin: 0 0 16px; padding-left: 22px; font-size: 16px; line-height: 1.75; color: var(--ube-text); }
.ube-guide li { margin-bottom: 6px; }
.ube-guide strong { color: var(--ube-ink); }
.ube-guide a { color: var(--ube-orange) !important; text-decoration: underline !important; text-underline-offset: 3px; }
.ube-table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--ube-line); border-radius: 14px; background: #fff; }
.ube-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.ube-table th, .ube-table td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--ube-line); }
.ube-table th { background: var(--ube-soft); font-weight: 700; color: var(--ube-ink); }
.ube-table tr:last-child td { border-bottom: 0; }
.ube-table td:first-child { white-space: nowrap; font-weight: 600; }
.ube-faq details { background: #fff; border: 1px solid var(--ube-line); border-radius: 14px; margin-bottom: 10px; }
.ube-faq details[open] { border-color: var(--ube-orange); }
.ube-faq summary { list-style: none; cursor: pointer; position: relative; padding: 16px 54px 16px 20px; font-size: 16px; font-weight: 600; color: var(--ube-ink); line-height: 1.45; }
.ube-faq summary::-webkit-details-marker { display: none; }
.ube-faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; background: var(--ube-orange-soft); color: var(--ube-orange); display: grid; place-items: center; font-weight: 700; }
.ube-faq details[open] summary::after { content: "\2212"; }
.ube .ube-faq details p { margin: 0; padding: 0 20px 16px; font-size: 15px !important; }
.ube-cta { margin-top: 36px; padding: 28px; border-radius: 20px; background: var(--ube-navy); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.ube-cta h2 { margin: 0 0 4px !important; color: #fff; font-size: 22px; }
.ube .ube-cta p { margin: 0; color: #94a3b8; font-size: 15px !important; }
@media (max-width: 899px) {
    .ube-guide h2 { font-size: 22px; }
    .ube-table td:first-child { white-space: normal; }
    .ube-cta .ube-btn { width: 100%; }
}
