{"id":5813,"date":"2026-08-02T00:49:25","date_gmt":"2026-08-01T22:49:25","guid":{"rendered":"https:\/\/hipstor.bg\/?page_id=5813"},"modified":"2026-08-24T04:20:45","modified_gmt":"2026-08-24T02:20:45","slug":"book-your-unit","status":"publish","type":"page","link":"https:\/\/hipstor.bg\/en\/book-your-unit\/","title":{"rendered":"Book Your Unit"},"content":{"rendered":"<p>&lt;<style>\r\n* { box-sizing: border-box; margin: 0; padding: 0; }\r\nbody { font-family: 'Segoe UI', sans-serif; background: #f0f2f5; color: #333; }\r\n.hipstor-wrap { max-width: 1400px; margin: 0 auto; padding: 20px; }\r\n.hp-legend {\r\n  display: flex; flex-wrap: wrap; gap: 16px;\r\n  padding: 14px 0; margin-bottom: 20px;\r\n}\r\n.hp-legend-item { display: flex; align-items: center; gap: 6px; font-size: 1em; font-weight: 600; }\r\n.hp-legend-dot { width: 16px; height: 16px; border-radius: 4px; border: 1px solid #aaa; }\r\n.hp-overview {\r\n  background: white; border-radius: 16px; padding: 28px 24px;\r\n  margin-bottom: 28px; box-shadow: 0 2px 12px rgba(0,0,0,0.08);\r\n}\r\n.hp-overview-subtitle { font-size: 1.1em; color: #555; margin-bottom: 24px; margin-top: 6px; }\r\n.hp-cat-label {\r\n  font-size: 1.2em; font-weight: 800; letter-spacing: 1.2px;\r\n  text-transform: uppercase; color: black; margin: 22px 0 12px; padding-left: 2px;\r\n}\r\n.hp-cat-label:first-of-type { margin-top: 8px; }\r\n.hp-cards-grid { display: flex; flex-wrap: wrap; gap: 14px; }\r\n.hp-size-card {\r\n  background: #f8fffe; border: 2px solid #c8f5c8; border-radius: 16px;\r\n  padding: 18px 16px 14px; min-width: 160px; max-width: 200px; flex: 1 1 160px;\r\n  display: flex; flex-direction: column; transition: box-shadow 0.2s, transform 0.2s; cursor: pointer;\r\n}\r\n.hp-size-card:hover { box-shadow: 0 6px 20px rgba(40,167,69,0.18); transform: translateY(-2px); }\r\n.hp-size-card.tbb { background: #f0f7ff; border-color: #c8e0ff; }\r\n.hp-size-card.tbb:hover { box-shadow: 0 6px 20px rgba(41,128,185,0.18); }\r\n.hp-sc-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }\r\n.hp-sc-size { font-size: 2em; font-weight: 900; color: #1a1a2e; line-height: 1; }\r\n.hp-sc-badge {\r\n  background: #28a745; color: white; border-radius: 20px;\r\n  padding: 4px 11px; font-size: 0.75em; font-weight: 700; white-space: nowrap; margin-top: 2px;\r\n}\r\n.hp-size-card.tbb .hp-sc-badge { background: #2980b9; }\r\n.hp-sc-price { font-size: 0.82em; color: black; margin-bottom: 12px; }\r\n.hp-sc-avail { font-size: 0.76em; color: #888; margin-bottom: 10px; line-height: 1.4; }\r\n.hp-sc-btn {\r\n  width: 100%; padding: 10px 8px; background: #28a745; color: white;\r\n  border: none; border-radius: 10px; font-size: 0.9em; font-weight: 700;\r\n  cursor: pointer; transition: background 0.2s, transform 0.1s; margin-top: auto;\r\n}\r\n.hp-sc-btn:hover { background: #218838; transform: scale(1.02); }\r\n.hp-size-card.tbb .hp-sc-btn { background: #2980b9; }\r\n.hp-size-card.tbb .hp-sc-btn:hover { background: #2471a3; }\r\n.hp-warehouse-card {\r\n  background: #fff8e1; border: 2px solid #f0a500; border-radius: 14px;\r\n  padding: 20px 24px; min-width: 340px; max-width: 460px; width: 100%;\r\n  cursor: pointer; transition: box-shadow 0.2s, transform 0.2s;\r\n}\r\n.hp-warehouse-card:hover { box-shadow: 0 6px 24px rgba(240,165,0,0.25); transform: translateY(-2px); }\r\n.hp-wc-icon { font-size: 2em; margin-bottom: 6px; display: block; }\r\n.hp-wc-title { color: #856404; font-weight: 700; font-size: 0.82em; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px; }\r\n.hp-wc-sub { font-size: 1.15rem; font-weight: 600; color: #1a252f; line-height: 1.5; margin-bottom: 16px; }\r\n.hp-wc-btn {\r\n  background: #f0a500; color: black; border: none; border-radius: 8px;\r\n  padding: 11px 20px; width: 100%; font-size: 0.92em; font-weight: 700;\r\n  cursor: pointer; transition: background 0.2s;\r\n  display: flex; align-items: center; justify-content: center; gap: 6px; font-family: inherit;\r\n}\r\n.hp-wc-btn:hover { background: #d4900a; color: #fff; }\r\n.hp-overlay {\r\n  display: none; position: fixed; inset: 0;\r\n  background: rgba(0,0,0,0.55); z-index: 9999;\r\n  align-items: center; justify-content: center;\r\n}\r\n.hp-overlay.active { display: flex; }\r\n.hp-modal {\r\n  background: white; border-radius: 16px; padding: 30px 28px 24px;\r\n  max-width: 480px; width: 92%; position: relative;\r\n  max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.25);\r\n}\r\n.hp-modal-close {\r\n  position: absolute; top: 14px; right: 18px;\r\n  background: none; border: none; font-size: 1.5em; cursor: pointer; color: #888;\r\n}\r\n.hp-modal-close:hover { color: #333; }\r\n.hp-modal h2 { font-size: 1.3em; color: #1a1a2e; margin-bottom: 4px; }\r\n.hp-modal-meta { font-size: 1.1em; color: #555; margin-bottom: 18px; margin-top: 4px; }\r\n.hp-unit-assign {\r\n  background: #f9f9f9; border: 1.5px solid #e0e0e0; border-radius: 10px;\r\n  padding: 12px 14px; margin-bottom: 16px; font-size: 0.83em; line-height: 1.8; color: #555;\r\n}\r\n.hp-unit-assign strong { color: #1a1a2e; font-size: 1em; }\r\n.hp-unit-pill {\r\n  display: inline-block; background: orange; color: black;\r\n  border-radius: 20px; padding: 2px 10px; font-size: 0.85em; font-weight: 700; margin: 2px 3px;\r\n}\r\n.hp-unit-pill.tbb { background: #2980b9; color: white; }\r\n.hp-period-label { font-weight: 700; color: #333; margin-bottom: 10px; font-size: 1.1em; }\r\n.hp-period-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }\r\n.hp-period-btn {\r\n  border: 2px solid orange; border-radius: 10px; padding: 12px 8px;\r\n  background: white; cursor: pointer; text-align: center; transition: all 0.2s; font-family: inherit;\r\n}\r\n.hp-period-btn:hover { background: #fff3cd; }\r\n.hp-period-btn.selected { border-color: darkorange; background: orange; }\r\n.hp-period-btn.tbb-style { border-color: #2980b9; }\r\n.hp-period-btn.tbb-style:hover { background: #d6eaf8; }\r\n.hp-period-btn.tbb-style.selected { border-color: #2980b9; background: #2980b9; color: white; }\r\n.hp-period-btn.span2 { grid-column: 1 \/ -1; }\r\n.hp-pb-mo { font-size: 1.6em; font-weight: 800; }\r\n.hp-pb-lbl { font-size: 0.85em; color: #555; }\r\n.hp-period-btn.selected .hp-pb-lbl { color: #333; }\r\n.hp-pb-badge {\r\n  display: inline-block; background: #f39c12; color: white;\r\n  border-radius: 20px; padding: 1px 6px; font-size: 0.65em; font-weight: 700; margin-left: 2px;\r\n}\r\n.hp-pb-price { font-size: 1.1em; font-weight: 700; margin-top: 3px; color: #1a1a2e; }\r\n.hp-warn { color: #e74c3c; font-size: 0.82em; display: none; margin-bottom: 10px; }\r\n.hp-note {\r\n  font-size: 0.78em; color: #666; font-style: italic;\r\n  text-align: center; margin-bottom: 14px; line-height: 1.6;\r\n}\r\n.hp-book-btn {\r\n  width: 100%; padding: 15px; background: orange; color: black;\r\n  border: none; border-radius: 10px; font-size: 1.05em; font-weight: 700;\r\n  cursor: pointer; transition: background 0.2s;\r\n}\r\n.hp-book-btn:hover { background: darkorange; color: white; }\r\n.hp-book-btn.tbb { background: #2980b9; color: white; }\r\n.hp-book-btn.tbb:hover { background: #2471a3; }\r\n.hp-inq4-overlay {\r\n  display: none; position: fixed; inset: 0;\r\n  background: rgba(0,0,0,0.55); z-index: 10000;\r\n  align-items: center; justify-content: center;\r\n}\r\n.hp-inq4-overlay.active { display: flex; }\r\n.hp-inq4-box {\r\n  background: white; border-radius: 16px; padding: 32px 28px 24px;\r\n  max-width: 480px; width: 92%; position: relative;\r\n  max-height: 90vh; overflow-y: auto; box-shadow: 0 12px 40px rgba(0,0,0,0.25);\r\n}\r\n.hp-inq4-close {\r\n  position: absolute; top: 12px; right: 16px;\r\n  background: none; border: none; font-size: 1.4em; cursor: pointer; color: #aaa;\r\n}\r\n.hp-inq4-close:hover { color: #333; }\r\n.hp-inq4-box h2 { font-size: 1.25em; color: #1a252f; margin-bottom: 4px; }\r\n.hp-inq4-sub { font-size: 0.85em; color: #888; margin: 4px 0 20px; line-height: 1.5; }\r\n.hp-inq4-label { display: block; margin-bottom: 5px; font-size: 0.82em; font-weight: 700; color: #333; }\r\n.hp-inq4-input {\r\n  width: 100%; padding: 10px 13px; border: 1.5px solid #e0e0e0; border-radius: 8px;\r\n  font-size: 0.9em; margin-bottom: 14px; transition: border 0.2s; font-family: inherit;\r\n}\r\n.hp-inq4-input:focus { outline: none; border-color: #e67e22; }\r\n.hp-inq4-note {\r\n  background: #fff8f0; border-left: 4px solid #e67e22; border-radius: 6px;\r\n  padding: 11px 14px; margin-bottom: 18px; font-size: 0.8em; color: #666; line-height: 1.7;\r\n}\r\n.hp-inq4-submit {\r\n  width: 100%; padding: 13px; background: orange; color: white;\r\n  border: none; border-radius: 8px; font-size: 0.95em; font-weight: 700;\r\n  cursor: pointer; transition: background 0.2s;\r\n}\r\n.hp-inq4-submit:hover { background: darkorange; }\r\n.hp-inq4-submit:disabled { background: #bbb; cursor: default; }\r\n.hp-inq4-error {\r\n  display: none; background: #fff0f0; border-left: 4px solid #e74c3c;\r\n  border-radius: 6px; padding: 10px 14px; margin-bottom: 14px;\r\n  font-size: 0.82em; color: #c0392b;\r\n}\r\n.hp-loading { text-align: center; padding: 60px 20px; color: #888; font-size: 1.1em; }\r\n.hp-error   { text-align: center; padding: 60px 20px; color: #e74c3c; font-size: 1.1em; }\r\n@media (max-width: 600px) {\r\n  .hp-size-card     { min-width: 140px; }\r\n  .hp-warehouse-card{ min-width: 100%; max-width: 100%; }\r\n  .hp-modal         { padding: 20px 16px 18px; }\r\n}\r\n<\/style>\r\n\r\n<!-- \u2550\u2550 WRAPPER \u2550\u2550 -->\r\n<div class=\"hipstor-wrap\">\r\n  <div class=\"hp-legend\">\r\n    <div class=\"hp-legend-item\">\r\n      <div class=\"hp-legend-dot\" style=\"background:#c8f5c8;\"><\/div>\r\n      Available \u2014 book now - 30% off for new bike customers\r\n    <\/div>\r\n    <div class=\"hp-legend-item\">\r\n      <div class=\"hp-legend-dot\" style=\"background:#c8e0ff;\"><\/div>\r\n      \u26a1 Ready within 7 days\r\n    <\/div>\r\n  <\/div>\r\n  <div id=\"hp-map-container\">\r\n    <div class=\"hp-loading\">\u23f3 Loading units...<\/div>\r\n  <\/div>\r\n<\/div>\r\n\r\n<!-- QO MODAL -->\r\n<div class=\"hp-overlay\" id=\"hp-qo-overlay\">\r\n  <div class=\"hp-modal\">\r\n    <button class=\"hp-modal-close\" onclick=\"hpCloseQo()\">\u2715<\/button>\r\n    <h2 id=\"hp-qo-title\">Book Storage<\/h2>\r\n    <div class=\"hp-modal-meta\" id=\"hp-qo-meta\"><\/div>\r\n    <div class=\"hp-unit-assign\" id=\"hp-qo-assign\"><\/div>\r\n    <div class=\"hp-period-label\">Select rental period:<\/div>\r\n    <div class=\"hp-period-grid\" id=\"hp-qo-periods\"><\/div>\r\n    <div class=\"hp-warn\" id=\"hp-qo-warn\">\u26a0\ufe0f Please select a rental period first.<\/div>\r\n    <div class=\"hp-note\">\r\n      \ud83d\udca1 Prices exclude 20% VAT.<br>\r\n      \ud83d\udd12 A refundable deposit will be added at checkout.\r\n    <\/div>\r\n    <button class=\"hp-book-btn\" id=\"hp-qo-book-btn\" onclick=\"hpQoBook()\">BOOK NOW<\/button>\r\n  <\/div>\r\n<\/div>\r\n\r\n<!-- INQ4 MODAL -->\r\n<div class=\"hp-inq4-overlay\" id=\"hp-inq4-overlay\">\r\n  <div class=\"hp-inq4-box\">\r\n    <button class=\"hp-inq4-close\" onclick=\"hpCloseInq4()\">\u2715<\/button>\r\n    <h2>\ud83c\udfed Request Your Space<\/h2>\r\n    <p class=\"hp-inq4-sub\">Tell us your needs and we'll get back to you shortly.<\/p>\r\n    <hr style=\"border:none;border-top:1px solid #eee;margin-bottom:20px;\">\r\n    <form id=\"hp-inq4-form\" onsubmit=\"hpSubmitInq4(event)\">\r\n      <label class=\"hp-inq4-label\">\ud83d\udcd0 Desired size (m\u00b2)<\/label>\r\n      <input class=\"hp-inq4-input\" type=\"number\" id=\"hp-inq4-sqm\" placeholder=\"e.g. 50\" min=\"1\" required>\r\n      <label class=\"hp-inq4-label\">\ud83d\uddd3\ufe0f Preferred rental period<\/label>\r\n      <select class=\"hp-inq4-input\" id=\"hp-inq4-period\" required>\r\n        <option value=\"\" disabled selected>\u2014 Select \u2014<\/option>\r\n        <option>1 month<\/option>\r\n        <option>3 months<\/option>\r\n        <option>6 months<\/option>\r\n        <option>12 months<\/option>\r\n        <option>Flexible \/ to be discussed<\/option>\r\n      <\/select>\r\n      <label class=\"hp-inq4-label\">\ud83d\udc64 Full name<\/label>\r\n      <input class=\"hp-inq4-input\" type=\"text\" id=\"hp-inq4-name\" placeholder=\"Your name\" required>\r\n      <label class=\"hp-inq4-label\">\ud83d\udcde Phone<\/label>\r\n      <input class=\"hp-inq4-input\" type=\"tel\" id=\"hp-inq4-phone\" placeholder=\"+359 88...\" required>\r\n      <label class=\"hp-inq4-label\">\u2709\ufe0f Email<\/label>\r\n      <input class=\"hp-inq4-input\" type=\"email\" id=\"hp-inq4-email\" placeholder=\"your@email.com\" required>\r\n      <div class=\"hp-inq4-note\">\r\n        \ud83d\udce9 We'll confirm by <strong>email or phone<\/strong> within 24h.\r\n      <\/div>\r\n      <div class=\"hp-inq4-error\" id=\"hp-inq4-error\">\r\n        \u26a0\ufe0f Something went wrong. Please try again or contact us directly.\r\n      <\/div>\r\n      <button class=\"hp-inq4-submit\" type=\"submit\" id=\"hp-inq4-btn\">\ud83d\udce8 Send Inquiry<\/button>\r\n    <\/form>\r\n    <div id=\"hp-inq4-success\" style=\"display:none;text-align:center;padding:20px 0 8px;\">\r\n      <div style=\"font-size:48px;margin-bottom:12px;\">\u2705<\/div>\r\n      <h3 style=\"color:#27ae60;margin:0 0 8px;\">Inquiry sent!<\/h3>\r\n      <p style=\"color:#777;font-size:0.88em;line-height:1.6;margin:0 0 20px;\">\r\n        Thank you! We'll be in touch soon.\r\n      <\/p>\r\n      <button onclick=\"hpCloseInq4()\"\r\n        style=\"padding:10px 28px;background:#e67e22;color:white;\r\n               border:none;border-radius:8px;font-size:0.9em;font-weight:700;cursor:pointer;\">\r\n        Close\r\n      <\/button>\r\n    <\/div>\r\n  <\/div>\r\n<\/div>\r\n\r\n<script>\r\n(function () {\r\n  'use strict';\r\n\r\n  \/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\r\n     WooCommerce LINKS\r\n     \u2705 \u0412\u0421\u0418\u0427\u041a\u0418 \u043a\u043b\u044e\u0447\u043e\u0432\u0435 \u0441\u0430 STRING \u0437\u0430 \u0441\u044a\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\r\n     \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 *\/\r\n  const LINKS = {\r\n    Standard: {\r\n      '1.8': {\r\n        '1' :'https:\/\/hipstor-self-storage.sumupstore.com\/product\/1-8sqm-self-storage-1-month-subscription\/',\r\n        '3' :'https:\/\/hipstor-self-storage.sumupstore.com\/produkt\/1-8sqm-self-storage-3-months-subscription\/',\r\n        '6' :'https:\/\/hipstor-self-storage.sumupstore.com\/product\/1-8sqm-self-storage-6-months-subscription\/',\r\n        '9' :'https:\/\/hipstor-self-storage.sumupstore.com\/produkt\/1-8sqm-self-storage-9-months-subscription\/',\r\n        '12':'https:\/\/hipstor-self-storage.sumupstore.com\/produkt\/1-8sqm-self-storage-12-months-subscription\/',\r\n      },\r\n      '2': {\r\n        '1' :'https:\/\/hipstor.bg\/en\/product\/2sqm-storage\/',\r\n        '3' :'https:\/\/hipstor.bg\/en\/product\/2sqm-storage-3-months-subscription\/',\r\n        '6' :'https:\/\/hipstor.bg\/en\/product\/2sqm-storage-6-months-subscription\/',\r\n        '9' :'https:\/\/hipstor.bg\/en\/product\/2sqm-storage-9-months-subscription\/',\r\n        '12':'https:\/\/hipstor.bg\/en\/product\/2sqm-storage-12-months-subscription\/',\r\n      },\r\n      '3': {\r\n        '1' :'https:\/\/hipstor.bg\/en\/product\/3-sqm-storage\/',\r\n        '3' :'https:\/\/hipstor.bg\/en\/product\/3sqm-storage-3-months-subscription\/',\r\n        '6' :'https:\/\/hipstor.bg\/en\/product\/3sqm-storage-6-months-subscription\/',\r\n        '9' :'https:\/\/hipstor.bg\/en\/product\/3sqm-storage-9-months-subscription\/',\r\n        '12':'https:\/\/hipstor.bg\/en\/product\/3sqm-storage-12-months-subscription\/',\r\n      },\r\n      '4': {\r\n        '1' :'https:\/\/hipstor.bg\/en\/product\/4-sqm-storage\/',\r\n        '3' :'https:\/\/hipstor.bg\/en\/product\/4sqm-storage-3-months-subscription\/',\r\n        '6' :'https:\/\/hipstor.bg\/en\/product\/4sqm-storage-6-months-subscription\/',\r\n        '9' :'https:\/\/hipstor.bg\/en\/product\/4sqm-storage-9-months-subscription\/',\r\n        '12':'https:\/\/hipstor.bg\/en\/product\/4sqm-storage-12-months-subscription\/',\r\n      },\r\n      '6': {\r\n        '1' :'https:\/\/hipstor.bg\/en\/product\/6-sqm-storage\/',\r\n        '3' :'https:\/\/hipstor.bg\/en\/product\/6sqm-storage-3-months-subscription\/',\r\n        '6' :'https:\/\/hipstor.bg\/en\/product\/6sqm-storage-6-months-subscription\/',\r\n        '9' :'https:\/\/hipstor.bg\/en\/product\/6sqm-storage-9-months-subscription\/',\r\n        '12':'https:\/\/hipstor.bg\/en\/product\/6sqm-storage-12-months-subscription\/',\r\n      },\r\n      '8': {\r\n        '1' :'https:\/\/hipstor.bg\/product\/standard-8sqm-1month\/',\r\n        '3' :'https:\/\/hipstor.bg\/product\/standard-8sqm-3months\/',\r\n        '6' :'https:\/\/hipstor.bg\/product\/standard-8sqm-6months\/',\r\n        '9' :'https:\/\/hipstor.bg\/product\/standard-8sqm-9months\/',\r\n        '12':'https:\/\/hipstor.bg\/product\/standard-8sqm-12months\/',\r\n      },\r\n    },\r\n    Elevated: {\r\n      '1': {\r\n        '1' :'https:\/\/hipstor.bg\/en\/product\/1-sqm-storage-elevated\/',\r\n        '3' :'https:\/\/hipstor.bg\/en\/product\/1-sqm-storage-3-months-subscription-elevated\/',\r\n        '6' :'https:\/\/hipstor.bg\/en\/product\/1-sqm-storage-6-months-subscription-elevated\/',\r\n        '9' :'https:\/\/hipstor.bg\/en\/product\/1-sqm-storage-9-months-subscription-elevated\/',\r\n        '12':'https:\/\/hipstor.bg\/en\/product\/1-sqm-storage-12-months-subscription-elevated\/',\r\n      },\r\n      '2': {\r\n        '1' :'https:\/\/hipstor.bg\/en\/product\/2-sqm-storage-elevated\/',\r\n        '3' :'https:\/\/hipstor.bg\/en\/product\/2-sqm-storage-3-months-subscription-elevated\/',\r\n        '6' :'https:\/\/hipstor.bg\/en\/product\/2-sqm-storage-6-months-subscription-elevated\/',\r\n        '9' :'https:\/\/hipstor.bg\/en\/product\/2-sqm-storage-9-months-subscription-elevated\/',\r\n        '12':'https:\/\/hipstor.bg\/en\/product\/2-sqm-storage-12-months-subscription-elevated\/',\r\n      },\r\n      '3': {\r\n        '1' :'https:\/\/hipstor.bg\/en\/product\/3-sqm-storage-elevated\/',\r\n        '3' :'https:\/\/hipstor.bg\/en\/product\/3-sqm-storage-3-months-subscription\/',\r\n        '6' :'https:\/\/hipstor.bg\/en\/product\/3-sqm-storage-6-months-subscription\/',\r\n        '9' :'https:\/\/hipstor.bg\/en\/product\/3-sqm-storage-9-months-subscription\/',\r\n        '12':'https:\/\/hipstor.bg\/en\/product\/3-sqm-storage-12-months-subscription\/',\r\n      },\r\n      '4': {\r\n        '1' :'https:\/\/hipstor.bg\/en\/product\/4-sqm-storage-elevated\/',\r\n        '3' :'https:\/\/hipstor.bg\/en\/product\/4-sqm-storage-3-months-subscription\/',\r\n        '6' :'https:\/\/hipstor.bg\/en\/product\/4-sqm-storage-6-months-subscription\/',\r\n        '9' :'https:\/\/hipstor.bg\/en\/product\/4-sqm-storage-9-months-subscription\/',\r\n        '12':'https:\/\/hipstor.bg\/en\/product\/4-sqm-storage-12-months-subscription\/',\r\n      },\r\n      '6': {\r\n        '1' :'https:\/\/hipstor.bg\/en\/product\/6-sqm-storage-elevated\/',\r\n        '3' :'https:\/\/hipstor.bg\/en\/product\/elevated-6-sqm-storage-3-months-subscription\/',\r\n        '6' :'https:\/\/hipstor.bg\/en\/product\/elevated-6-sqm-storage-6-months-subscription\/',\r\n        '9' :'https:\/\/hipstor.bg\/en\/product\/6-sqm-storage-9-months-subscription\/',\r\n        '12':'https:\/\/hipstor.bg\/en\/product\/elevated-6-sqm-storage-12-months-subscription\/',\r\n      },\r\n    },\r\n    \/* \u2705 \u041f\u041e\u041f\u0420\u0410\u0412\u0415\u041d\u041e: Bike \u2014 string \u043a\u043b\u044e\u0447\u043e\u0432\u0435 '1' \u0438 \u043f\u0435\u0440\u0438\u043e\u0434 '1','3','6','9','12' *\/\r\n    Bike: {\r\n      '2.5': {\r\n        '1' :'https:\/\/hipstor.bg\/contact\/',\r\n        '3' :'https:\/\/hipstor.bg\/contact\/',\r\n        '6' :'https:\/\/hipstor.bg\/contact\/',\r\n        '9' :'https:\/\/hipstor.bg\/contact\/',\r\n        '12':'https:\/\/hipstor.bg\/contact\/',\r\n      },\r\n    },\r\n  };\r\n\r\n  const FALLBACK_URL = 'https:\/\/hipstor.bg\/contact\/';\r\n\r\n  \/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\r\n     PRICES \u2014 \u2705 \u0412\u0421\u0418\u0427\u041a\u0418 \u043a\u043b\u044e\u0447\u043e\u0432\u0435 STRING\r\n     \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 *\/\r\n  const PRICES = {\r\n    Standard: {\r\n      '1.8': { '1':33.00, '3':32.00, '6':30.00, '9':28.00, '12':27.00 },\r\n      '2':   { '1':37.00, '3':35.00, '6':33.00, '9':31.00, '12':30.00 },\r\n      '3':   { '1':56.00, '3':53.00, '6':50.00, '9':47.00, '12':44.00 },\r\n      '4':   { '1':74.00, '3':70.00, '6':67.00, '9':63.00, '12':59.00 },\r\n      '6':   { '1':111.00,'3':106.00,'6':100.00,'9':94.00, '12':89.00 },\r\n      '8':   { '1':148.00,'3':141.00,'6':133.00,'9':126.00,'12':119.00 },\r\n    },\r\n    Elevated: {\r\n      '1': { '1':15.00, '3':14.00, '6':13.00, '9':12.50, '12':12.00 },\r\n      '2': { '1':30.00, '3':28.00, '6':27.00, '9':25.00, '12':24.00 },\r\n      '3': { '1':44.00, '3':42.00, '6':40.00, '9':38.00, '12':36.00 },\r\n      '4': { '1':59.00, '3':56.00, '6':53.00, '9':50.00, '12':47.00 },\r\n      '6': { '1':89.00, '3':84.00, '6':80.00, '9':76.00, '12':71.00 },\r\n    },\r\n    \/* \u2705 \u041f\u041e\u041f\u0420\u0410\u0412\u0415\u041d\u041e: Bike \u2014 string \u043a\u043b\u044e\u0447\u043e\u0432\u0435 *\/\r\n    Bike: {\r\n      '2.5': { '1':45.50, '3':43.00, '6':40.50, '9':38.50, '12':36.00 },\r\n    },\r\n  };\r\n\r\n  \/* \u2550\u2550 HELPER: \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0438\u0440\u0430 SQM \u043a\u044a\u043c string \u043a\u043b\u044e\u0447 \u2550\u2550\r\n     \"1.80\" \u2192 \"1.8\"  |  \"2.00\" \u2192 \"2\"  |  \"1\" \u2192 \"1\"\r\n     \u2705 \u0420\u0430\u0431\u043e\u0442\u0438 \u0437\u0430 \u0432\u0441\u0438\u0447\u043a\u0438 \u0441\u043b\u0443\u0447\u0430\u0438, \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u043d\u043e Bike *\/\r\n  function normSqm(raw) {\r\n    const n = parseFloat(String(raw).trim());\r\n    if (isNaN(n)) return String(raw).trim();\r\n    \/\/ \u041f\u0440\u0435\u043c\u0430\u0445\u0432\u0430 \u0438\u0437\u043b\u0438\u0448\u043d\u0438 \u043d\u0443\u043b\u0438: 2.00\u2192\"2\", 1.80\u2192\"1.8\"\r\n    return String(n);\r\n  }\r\n\r\n  \/* \u2550\u2550 PRICE LOOKUP \u2550\u2550 *\/\r\n  function getPrice(type, sqmRaw, moRaw) {\r\n    try {\r\n      const sqmKey = normSqm(sqmRaw);\r\n      const moKey  = String(moRaw);\r\n      const p = PRICES[type][sqmKey][moKey];\r\n      if (p != null) return p;\r\n    } catch(e) {}\r\n    return null;\r\n  }\r\n\r\n  \/* \u2550\u2550 LINK LOOKUP \u2550\u2550 *\/\r\n  function getLink(type, sqmRaw, moRaw) {\r\n    try {\r\n      const sqmKey = normSqm(sqmRaw);\r\n      const moKey  = String(moRaw);\r\n      const url = LINKS[type][sqmKey][moKey];\r\n      if (url) return url;\r\n    } catch(e) {}\r\n    return FALLBACK_URL;\r\n  }\r\n\r\n  \/* \u2550\u2550 STATE \u2550\u2550 *\/\r\n  let qoGroup = null, qoPeriod = null;\r\n\r\n  \/* \u2550\u2550 STATUS \u2550\u2550 *\/\r\n  function getStatus(u) {\r\n    const occ = (u.Occupation || '').trim();\r\n    if (!occ || occ === 'Available' || occ === 'Free') return 'available';\r\n    if (occ === '#TBB') return 'tbb';\r\n    return 'booked';\r\n  }\r\n\r\n  \/* \u2550\u2550 BUILD URL (append query params) \u2550\u2550 *\/\r\n  function buildUrl(base, u) {\r\n    try {\r\n      const url = new URL(base);\r\n      const unitId = u.Unit || u.unit;\r\n      if (unitId)    url.searchParams.set('unit_id',   unitId);\r\n      if (u.sqm)     url.searchParams.set('unit_sqm',  u.sqm);\r\n      if (u.hipstor) url.searchParams.set('hipstor',   u.hipstor);\r\n      if (u.type)    url.searchParams.set('unit_type', u.type);\r\n      return url.toString();\r\n    } catch(e) { return base; }\r\n  }\r\n\r\n  \/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\r\n     RENDER\r\n     \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 *\/\r\n  function renderMap(allUnits) {\r\n    const container = document.getElementById('hp-map-container');\r\n    container.innerHTML = '';\r\n\r\n    const section = document.createElement('div');\r\n    section.className = 'hp-overview';\r\n    section.innerHTML = '<div class=\"hp-overview-subtitle\">Choose a size and book directly.<\/div>';\r\n\r\n    const categories = [\r\n      { key: 'Standard', label: '\ud83d\udce6 Standard Units' },\r\n      { key: 'Elevated', label: '\ud83d\udd3c Elevated Storage' },\r\n      { key: 'Bike',     label: '\ud83c\udfcd\ufe0f Motorbike Storage' },\r\n    ];\r\n\r\n    categories.forEach(cat => {\r\n      const catUnits = allUnits.filter(u => {\r\n        const s = getStatus(u);\r\n        return (u.Type || '').trim() === cat.key\r\n          && Number(u.SQM) < 400\r\n          && (s === 'available' || s === 'tbb');\r\n      });\r\n      if (!catUnits.length) return;\r\n\r\n      const bySqm = {};\r\n      catUnits.forEach(u => {\r\n        \/* \u2705 normSqm \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u0435\u043d string \u043a\u043b\u044e\u0447 *\/\r\n        const sqmKey = normSqm(u.SQM);\r\n        if (!bySqm[sqmKey]) bySqm[sqmKey] = { available: [], tbb: [] };\r\n        getStatus(u) === 'available'\r\n          ? bySqm[sqmKey].available.push(u)\r\n          : bySqm[sqmKey].tbb.push(u);\r\n      });\r\n\r\n      const catLabel = document.createElement('div');\r\n      catLabel.className = 'hp-cat-label';\r\n      catLabel.textContent = cat.label;\r\n      section.appendChild(catLabel);\r\n\r\n      const grid = document.createElement('div');\r\n      grid.className = 'hp-cards-grid';\r\n\r\n      Object.keys(bySqm).sort((a, b) => Number(a) - Number(b)).forEach(sqmKey => {\r\n        const grp   = bySqm[sqmKey];\r\n        const isTbb = grp.available.length === 0;\r\n        const total = grp.available.length + grp.tbb.length;\r\n\r\n        \/* \u2705 getPrice \u0441 normSqm *\/\r\n        const price1 = getPrice(cat.key, sqmKey, 1);\r\n\r\n        let availNote = '';\r\n        if (!isTbb) {\r\n          availNote = `<div class=\"hp-sc-avail\">\r\n            \u2705 ${grp.available.length} available\r\n            ${grp.tbb.length ? ` \u00b7 \u26a1 ${grp.tbb.length} within 7 days` : ''}\r\n          <\/div>`;\r\n        } else {\r\n          availNote = `<div class=\"hp-sc-avail\">\r\n            \u26a1 ${grp.tbb.length} unit${grp.tbb.length > 1 ? 's' : ''} ready within 7 days\r\n          <\/div>`;\r\n        }\r\n\r\n        const card = document.createElement('div');\r\n        card.className = 'hp-size-card' + (isTbb ? ' tbb' : '');\r\n        card.innerHTML = `\r\n          <div class=\"hp-sc-header\">\r\n            <div>\r\n              <div class=\"hp-sc-size\">${Number(sqmKey)} m\u00b2<\/div>\r\n              ${price1\r\n                ? `<div class=\"hp-sc-price\">from ${price1.toFixed(2)} \u20ac\/mo<\/div>`\r\n                : '<div class=\"hp-sc-price\">&nbsp;<\/div>'}\r\n            <\/div>\r\n            <div class=\"hp-sc-badge\">${total} unit${total > 1 ? 's' : ''}<\/div>\r\n          <\/div>\r\n          ${availNote}\r\n          <button class=\"hp-sc-btn\">${isTbb ? '\ud83d\udce9 REQUEST' : 'BOOK NOW'}<\/button>`;\r\n\r\n        const allU = [...grp.available, ...grp.tbb];\r\n        card.querySelector('.hp-sc-btn').addEventListener('click', e => {\r\n          e.stopPropagation();\r\n          hpOpenQo({ type: cat.key, sqm: sqmKey, units: allU, isTbb });\r\n        });\r\n        grid.appendChild(card);\r\n      });\r\n\r\n      section.appendChild(grid);\r\n    });\r\n\r\n    \/* Warehouse card *\/\r\n    const whUnit = allUnits.find(u => Number(u.SQM) >= 400 && getStatus(u) !== 'booked');\r\n    if (whUnit) {\r\n      const whLabel = document.createElement('div');\r\n      whLabel.className = 'hp-cat-label';\r\n      whLabel.textContent = '\ud83c\udfed Available space for customized storage';\r\n      section.appendChild(whLabel);\r\n\r\n      const whGrid = document.createElement('div');\r\n      whGrid.className = 'hp-cards-grid';\r\n\r\n      const wCard = document.createElement('div');\r\n      wCard.className = 'hp-warehouse-card';\r\n      wCard.innerHTML = `\r\n        <span class=\"hp-wc-icon\">\ud83c\udfed<\/span>\r\n        <div class=\"hp-wc-title\">HIPSTOR ${whUnit.HIPSTOR || '4'}<\/div>\r\n        <div class=\"hp-wc-sub\">Over ${whUnit.SQM} m\u00b2 ready to be booked.<\/div>\r\n        <button class=\"hp-wc-btn\">\ud83d\udce9 REQUEST THE SPACE YOU NEED<\/button>`;\r\n      wCard.querySelector('.hp-wc-btn').addEventListener('click', e => { e.stopPropagation(); hpOpenInq4(); });\r\n      wCard.addEventListener('click', hpOpenInq4);\r\n      whGrid.appendChild(wCard);\r\n      section.appendChild(whGrid);\r\n    }\r\n\r\n    container.appendChild(section);\r\n  }\r\n\r\n  \/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\r\n     QO MODAL\r\n     \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 *\/\r\n  function hpOpenQo(group) {\r\n    qoGroup = group; qoPeriod = null;\r\n    const { type, sqm, units, isTbb } = group;\r\n    const isTbbStyle = isTbb ? ' tbb-style' : '';\r\n\r\n    document.getElementById('hp-qo-title').textContent =\r\n      `${isTbb ? '\u26a1 Request' : '\ud83d\udce6 Book'} ${Number(sqm)} m\u00b2 Storage`;\r\n    document.getElementById('hp-qo-meta').textContent = `${type} \u00b7 ${Number(sqm)} m\u00b2`;\r\n\r\n    const sorted = [...units].sort((a, b) => {\r\n      const o = { available: 0, tbb: 1 };\r\n      return (o[getStatus(a)] || 0) - (o[getStatus(b)] || 0);\r\n    });\r\n    const assigned = sorted[0];\r\n    const pillCls  = isTbb ? 'hp-unit-pill tbb' : 'hp-unit-pill';\r\n    const unitName = assigned.Unit || assigned.unit || '?';\r\n\r\n    document.getElementById('hp-qo-assign').innerHTML = `\r\n      <strong>\ud83d\udccb Your unit will be:<\/strong><br>\r\n      <span class=\"${pillCls}\">Unit ${unitName} \u00b7 ${assigned.SQM} m\u00b2 \u00b7 ${assigned.HIPSTOR || '?'}<\/span>\r\n      ${isTbb ? '<br><small>\u26a1 Ready within 7 days \u2014 sooner if urgent<\/small>' : ''}\r\n      <br><small style=\"color:#888;margin-top:4px;display:block;\">\r\n        \u2139\ufe0f Unit number confirmed in your order email.\r\n      <\/small>`;\r\n\r\n    const grid = document.getElementById('hp-qo-periods');\r\n    grid.innerHTML = '';\r\n\r\n    [\r\n      { mo: 1,  disc: 0,  span: false },\r\n      { mo: 3,  disc: 5,  span: false },\r\n      { mo: 6,  disc: 10, span: false },\r\n      { mo: 9,  disc: 15, span: false },\r\n      { mo: 12, disc: 20, span: true  },\r\n    ].forEach(({ mo, disc, span }) => {\r\n      const p   = getPrice(type, sqm, mo);\r\n      const btn = document.createElement('button');\r\n      btn.className = `hp-period-btn${isTbbStyle}${span ? ' span2' : ''}`;\r\n      btn.innerHTML = `\r\n        <div class=\"hp-pb-mo\">${mo}<\/div>\r\n        <div class=\"hp-pb-lbl\">month${mo > 1 ? 's' : ''}${disc ? ` <span class=\"hp-pb-badge\">-${disc}%<\/span>` : ''}<\/div>\r\n        ${p != null ? `<div class=\"hp-pb-price\">${p.toFixed(2)} \u20ac\/mo<\/div>` : ''}`;\r\n      btn.addEventListener('click', () => hpQoSelectPeriod(mo, btn));\r\n      grid.appendChild(btn);\r\n    });\r\n\r\n    const bookBtn = document.getElementById('hp-qo-book-btn');\r\n    bookBtn.className = 'hp-book-btn' + (isTbb ? ' tbb' : '');\r\n    bookBtn.textContent = isTbb ? '\ud83d\udce9 SEND REQUEST' : 'BOOK NOW';\r\n\r\n    document.getElementById('hp-qo-warn').style.display = 'none';\r\n    document.getElementById('hp-qo-overlay').classList.add('active');\r\n  }\r\n\r\n  window.hpCloseQo = function () {\r\n    document.getElementById('hp-qo-overlay').classList.remove('active');\r\n    qoGroup = qoPeriod = null;\r\n  };\r\n\r\n  function hpQoSelectPeriod(months, btn) {\r\n    qoPeriod = months;\r\n    document.querySelectorAll('.hp-period-btn').forEach(b => b.classList.remove('selected'));\r\n    btn.classList.add('selected');\r\n    document.getElementById('hp-qo-warn').style.display = 'none';\r\n  }\r\n\r\n  window.hpQoBook = function () {\r\n    if (!qoPeriod) {\r\n      document.getElementById('hp-qo-warn').style.display = 'block';\r\n      return;\r\n    }\r\n    const { type, sqm, units } = qoGroup;\r\n    const sorted = [...units].sort((a, b) => {\r\n      const o = { available: 0, tbb: 1 };\r\n      return (o[getStatus(a)] || 0) - (o[getStatus(b)] || 0);\r\n    });\r\n    const unit = sorted[0];\r\n\r\n    \/* \u2705 \u041f\u041e\u041f\u0420\u0410\u0412\u0415\u041d\u041e: getLink \u0441 normSqm *\/\r\n    const base = getLink(type, sqm, qoPeriod);\r\n    const url  = buildUrl(base, {\r\n      Unit:    unit.Unit || unit.unit,\r\n      sqm:     unit.SQM,\r\n      hipstor: unit.HIPSTOR,\r\n      type,\r\n    });\r\n    window.open(url, '_blank');\r\n    hpCloseQo();\r\n  };\r\n\r\n  \/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\r\n     INQ4 MODAL\r\n     \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 *\/\r\n  window.hpOpenInq4 = function () {\r\n    document.getElementById('hp-inq4-overlay').classList.add('active');\r\n    document.getElementById('hp-inq4-form').style.display    = 'block';\r\n    document.getElementById('hp-inq4-success').style.display = 'none';\r\n    document.getElementById('hp-inq4-error').style.display   = 'none';\r\n    document.getElementById('hp-inq4-form').reset();\r\n    const btn = document.getElementById('hp-inq4-btn');\r\n    btn.disabled    = false;\r\n    btn.textContent = '\ud83d\udce8 Send Inquiry';\r\n  };\r\n\r\n  window.hpCloseInq4 = function () {\r\n    document.getElementById('hp-inq4-overlay').classList.remove('active');\r\n  };\r\n\r\n  window.hpSubmitInq4 = async function (e) {\r\n    e.preventDefault();\r\n    const btn = document.getElementById('hp-inq4-btn');\r\n    btn.disabled = true; btn.textContent = '\u23f3 Sending...';\r\n    document.getElementById('hp-inq4-error').style.display = 'none';\r\n\r\n    const payload = {\r\n      sqm:    document.getElementById('hp-inq4-sqm').value.trim(),\r\n      period: document.getElementById('hp-inq4-period').value,\r\n      name:   document.getElementById('hp-inq4-name').value.trim(),\r\n      phone:  document.getElementById('hp-inq4-phone').value.trim(),\r\n      email:  document.getElementById('hp-inq4-email').value.trim(),\r\n    };\r\n    try {\r\n      const ajaxUrl = (typeof hipstorData !== 'undefined')\r\n        ? hipstorData.ajaxUrl\r\n        : '\/wp-admin\/admin-ajax.php';\r\n      const res = await fetch(ajaxUrl + '?action=hipstor_inquiry4', {\r\n        method:  'POST',\r\n        headers: { 'Content-Type': 'application\/json' },\r\n        body:    JSON.stringify(payload),\r\n      });\r\n      if (!res.ok) throw new Error('HTTP ' + res.status);\r\n      document.getElementById('hp-inq4-form').style.display    = 'none';\r\n      document.getElementById('hp-inq4-success').style.display = 'block';\r\n    } catch(err) {\r\n      document.getElementById('hp-inq4-error').style.display = 'block';\r\n      btn.disabled    = false;\r\n      btn.textContent = '\ud83d\udce8 Send Inquiry';\r\n    }\r\n  };\r\n\r\n  \/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\r\n     CSV PARSER\r\n     \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 *\/\r\n  function parseCSV(text) {\r\n    text = text.replace(\/^\\uFEFF\/, '');\r\n    const lines = text.split(\/\\r?\\n\/).filter(l => l.trim());\r\n    if (lines.length < 2) return [];\r\n\r\n    function parseLine(line) {\r\n      const res = []; let cur = '', inQ = false;\r\n      for (let i = 0; i < line.length; i++) {\r\n        const c = line[i];\r\n        if (c === '\"') {\r\n          if (inQ && line[i + 1] === '\"') { cur += '\"'; i++; }\r\n          else inQ = !inQ;\r\n        } else if (c === ',' && !inQ) { res.push(cur.trim()); cur = ''; }\r\n        else cur += c;\r\n      }\r\n      res.push(cur.trim());\r\n      return res;\r\n    }\r\n\r\n    const headers = parseLine(lines[0]);\r\n    return lines.slice(1).map(l => {\r\n      const vals = parseLine(l), obj = {};\r\n      headers.forEach((h, i) => { obj[h.trim()] = (vals[i] || '').trim(); });\r\n      return obj;\r\n    }).filter(o => Object.values(o).some(v => v));\r\n  }\r\n\r\n  \/* \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\r\n     LOAD DATA\r\n     \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 *\/\r\n  function getFallback() {\r\n    return [\r\n      { HIPSTOR:'A', Unit:'A1', SQM:'4',   Type:'Standard', Occupation:'Available' },\r\n      { HIPSTOR:'A', Unit:'A2', SQM:'4',   Type:'Standard', Occupation:'Booked'    },\r\n      { HIPSTOR:'A', Unit:'A3', SQM:'6',   Type:'Standard', Occupation:'Available' },\r\n      { HIPSTOR:'B', Unit:'B1', SQM:'3',   Type:'Elevated', Occupation:'Available' },\r\n      { HIPSTOR:'B', Unit:'B2', SQM:'6',   Type:'Elevated', Occupation:'#TBB'      },\r\n      { HIPSTOR:'C', Unit:'C1', SQM:'1',   Type:'Bike',     Occupation:'Available' },\r\n      { HIPSTOR:'D', Unit:'D1', SQM:'500', Type:'Warehouse',Occupation:'Available' },\r\n    ];\r\n  }\r\n\r\n  function loadFromCSV() {\r\n    const paths = [\r\n      'units.csv',\r\n      '\/wp-content\/uploads\/2026\/07\/units.csv',\r\n      'https:\/\/hipstor.bg\/wp-content\/uploads\/2026\/07\/units.csv',\r\n    ];\r\n    function tryNext(i) {\r\n      if (i >= paths.length) { renderMap(getFallback()); return; }\r\n      fetch(paths[i])\r\n        .then(r => { if (!r.ok) throw new Error(); return r.text(); })\r\n        .then(text => {\r\n          const data = parseCSV(text);\r\n          data.length ? renderMap(data) : tryNext(i + 1);\r\n        })\r\n        .catch(() => tryNext(i + 1));\r\n    }\r\n    tryNext(0);\r\n  }\r\n\r\n  \/* \u2705 \u041f\u041e\u041f\u0420\u0410\u0412\u0415\u041d\u041e: loadUnits \u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043d\u043e \u0437\u0430\u0442\u0432\u043e\u0440\u0435\u043d\u0430\r\n     DOMContentLoaded \u0435 \u0418\u0417\u0412\u042a\u041d loadUnits *\/\r\n  function loadUnits() {\r\n    if (typeof hipstorData !== 'undefined' && hipstorData.ajaxUrl) {\r\n      fetch(hipstorData.ajaxUrl + '?action=hipstor_get_units&nonce=' + (hipstorData.nonce || ''))\r\n        .then(r => r.json())\r\n        .then(data => {\r\n          if (data.success && Array.isArray(data.data) && data.data.length) {\r\n            renderMap(data.data);\r\n          } else {\r\n            loadFromCSV();\r\n          }\r\n        })\r\n        .catch(() => loadFromCSV());\r\n    } else {\r\n      loadFromCSV();\r\n    }\r\n  } \/* \u2705 loadUnits \u043f\u0440\u0430\u0432\u0438\u043b\u043d\u043e \u0437\u0430\u0442\u0432\u043e\u0440\u0435\u043d\u0430 \u0442\u0443\u043a *\/\r\n\r\n  \/* \u2550\u2550 INIT \u2550\u2550 *\/\r\n  document.addEventListener('DOMContentLoaded', function () {\r\n    document.getElementById('hp-qo-overlay').addEventListener('click', function (e) {\r\n      if (e.target === this) hpCloseQo();\r\n    });\r\n    document.getElementById('hp-inq4-overlay').addEventListener('click', function (e) {\r\n      if (e.target === this) hpCloseInq4();\r\n    });\r\n    document.addEventListener('keydown', e => {\r\n      if (e.key === 'Escape') { hpCloseQo(); hpCloseInq4(); }\r\n    });\r\n    loadUnits();\r\n  });\r\n\r\n})();\r\n<\/script>&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;&gt;<\/p>\n","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-5813","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/hipstor.bg\/en\/wp-json\/wp\/v2\/pages\/5813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hipstor.bg\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/hipstor.bg\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/hipstor.bg\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/hipstor.bg\/en\/wp-json\/wp\/v2\/comments?post=5813"}],"version-history":[{"count":6,"href":"https:\/\/hipstor.bg\/en\/wp-json\/wp\/v2\/pages\/5813\/revisions"}],"predecessor-version":[{"id":5952,"href":"https:\/\/hipstor.bg\/en\/wp-json\/wp\/v2\/pages\/5813\/revisions\/5952"}],"wp:attachment":[{"href":"https:\/\/hipstor.bg\/en\/wp-json\/wp\/v2\/media?parent=5813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}