/* Storefront widgets (subscribe popup + support chat), moved out of the layout so
   the browser caches them instead of re-downloading them with every page. */

        .popup-overlay {
          position: fixed; inset: 0; background: rgba(0,0,0,.45);
          display: flex; align-items: center; justify-content: center; z-index: 9999;
          animation: fadeIn .15s ease-out;
        }
        .popup-modal {
          background: #fff; border-radius: 14px; max-width: 420px; width: calc(100% - 32px);
          padding: 20px 20px 16px; box-shadow: 0 10px 35px rgba(0,0,0,.15);
          font-family: inherit; text-align: right;
        }
        .popup-close {
          position: absolute; top: 10px; left: 14px; border: 0; background: transparent;
          font-size: 22px; line-height: 1; cursor: pointer;
        }
        .popup-content { font-size: 16px; color: #111; }
        .popup-content .popup-title { font-weight: 700; margin-bottom: 6px; font-size: 18px; }
        @keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

        :root {
            --chat-primary-color: #363450;
            --chat-button-bottom: 20px;
            --chat-button-left: 20px;
            --chat-border-rad: 25px;
            --chat-box-border-rad: 8px;

        }

        .chat-button {
            position: fixed;
            z-index: 9999;
            bottom: var(--chat-button-bottom);
            left: var(--chat-button-left);
            background-color: var(--chat-primary-color);
            color: white;
            border: none;
            border-radius: var(--chat-border-rad);
            cursor: pointer;
            display: flex;
            padding: 10px 15px;
            justify-content: center;
            align-items: center;
            font-size: 16px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        }

        .chat-button::after {
            content: "";
            position: absolute;
            bottom: -10px;
            left: 0px;
            background-color: transparent;
            height: 0px;
            width: 0px;
            border-left: 0px solid transparent;
            border-right: 10px solid transparent;
            border-top: 10px solid var(--chat-primary-color);
            border-radius: var(--chat-border-rad);

        }

        .chat-box {
            z-index: 999;
            position: fixed;
            width: 360px;
            bottom: 80px;
            left: 20px;
            background: white;
            border: 1px solid #ccc;
            border-radius: var(--chat-box-border-rad);
            display: none;
            flex-direction: column;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        }

        @media screen and (max-width:570px) {
            .chat-button {
                bottom: 80px;
            }

            .chat-box {
                bottom: 140px;
            }
        }

        .chat-box-header {
            background-color: var(--chat-primary-color);
            color: white;
            padding: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-top-left-radius: var(--chat-box-border-rad);
            border-top-right-radius: var(--chat-box-border-rad);

        }

        .chat-box-header .close-button {
            background: none;
            border: none;
            color: white;
            font-size: 16px;
            cursor: pointer;
        }

        .chat-box-content {
            padding: 10px;
            flex: 1;
            overflow-y: auto;
            max-height: 200px;
            gap: 10px;
        }

        .chat-box-footer {
            padding: 10px;
            display: flex;
            gap: 5px;
        }

        .chat-input {
            flex: 1;
            padding: 5px;
            border: 1px solid #ccc;
            border-radius: var(--chat-border-rad);
        }

        .chat-submit {
            background-color: var(--chat-primary-color);
            color: white;
            border: none;
            padding: 5px 10px;
            border-radius: var(--chat-border-rad);
            cursor: pointer;

        }

        .name-input-container {
            display: flex;
            flex-direction: column;
            gap: 10px;

        }

        .name-input {
            padding: 8px;
            border: 1px solid #ccc;
            width: 100%;
            border-radius: var(--chat-border-rad);

        }

        audio {
            display: block;
            margin-top: 10px;
        }

        /* Chat Container */
        .chat-content {
            display: flex;
            flex-direction: column;
            gap: 10px;
            padding: 15px;
            overflow-y: auto;
            max-height: 80vh;
        }

        /* Chat Message */
        .chat-message {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            padding: 12px;
            border-radius: 12px;
            font-size: 14px;
            box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
        }

        .chat-message--opposite {
            align-self: flex-end;
            background-color: #007bff;
            color: white;
        }

        /* Message Avatar */
        .message-avatar {
            width: 12%;
            min-width: 35px;
            height: 35px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            background-color: #ddd;
            color: #555;
        }

        /* Message Content */
        .message-content {
            width: 84%;
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        /* Text Message */
        .message-content div {
            word-wrap: break-word;
            max-width: 100%;
        }

        /* Image Message */
        .message-content img {
            border-radius: 8px;
            max-width: 100%;
            height: auto;
            cursor: pointer;
            transition: transform 0.3s;
        }

        .message-content img:hover {
            transform: scale(1.05);
        }

        /* Audio Message */
        .message-content audio {
            width: 100%;
            margin: 0;
            height: 35px;
        }

        /* File Message */
        .message-content a {
            display: flex;
            align-items: center;
            text-decoration: none;
            color: #007bff;
            font-weight: bold;
        }

        .message-content a:hover {
            text-decoration: underline;
        }

        /* Message Timestamp */
        .message-time {
            width: 100%;
            font-size: 12px;
            color: gray;
            align-self: flex-end;
            margin-inline-start: auto;
        }
