/* Base layout / structure. Colours, sizes, borders and hover states are
   generated dynamically from the module configuration page and are
   printed inline in the page head, so they override this file. */

.customproductlink-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
    width: 100%;
}

.customproductlink-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    word-break: break-word;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.customproductlink-btn:hover,
.customproductlink-btn:focus {
    text-decoration: none;
}

/* Icon + text vertical alignment fix: SVGs are inline by default and sit
   on the text baseline, which leaves a small visual gap under them and
   makes the icon look "dropped" compared to the text. Forcing the icon
   wrapper to center its content and the SVG itself to be a block element
   removes that offset. */
.customproductlink-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}

.customproductlink-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Mobile: stack the buttons one under the other, full width each. */
@media (max-width: 767px) {
    .customproductlink-wrapper {
        flex-direction: column;
    }

    .customproductlink-btn {
        flex: 1 1 auto;
        width: 100%;
    }
}
