/* BUYING OPTIONS: states of the license panel (main.css) not in the original template.
   Loading: the panel opens at once with what is known (title, license types, icons, hints);
   placeholders stand in for quantities, prices and buttons until the server answers.
   Free licenses: no quantity to choose, the price as a green label. */

/* a placeholder: the row button's fill, breathing slowly */

.skel {
    display: block;
    background-color: rgba(21, 71, 52, 0.2);
    animation: skel 1.2s ease-in-out infinite alternate;
}

@keyframes skel {
    from { opacity: 1; }
    to { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
    .skel {
        animation: none;
    }
}

/* each placeholder takes the size of what it stands for */
.skel-select { width: 100%; height: 28px; border-radius: 5px; }
.skel-price  { width: 9em; height: 1em; margin-left: auto; }
.skel-button { width: 7.5em; height: 35px; border-radius: 5px; margin-left: auto; }
.skel-total  { width: 7em; height: 1.25em; margin-left: auto; }

/* free licenses: the price reads as a label, as % OFF does */
.lic-price .free {
    color: #154734;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lic-price:has(.free) {
    opacity: 1;
}

/* "Close ×" stays on one line; the panel title beside it wraps instead */
.lic-close {
    white-space: nowrap;
}

/* a license in the cart: its price at full strength, as the To Cart / Remove state shows it is chosen */
.lic-price.in-cart {
    opacity: 1;
    color: #000;
}

/* Touch screens: a tap leaves :hover stuck on the buy button, so there the label follows the panel
   instead: "Buying Options" while its panel is open (aria-expanded, set by buying.js), "Add to Cart"
   once it is closed. Mouse users keep the hover. */
@media (hover: none) {
    .buy:hover {
        background-color: #111;
    }
    .buy:hover .text-init {
        top: 0;
    }
    .buy:hover .text-hover {
        top: 2.5em;
    }
    .buy[aria-expanded="true"] {
        background-color: #093322;
    }
    .buy[aria-expanded="true"] .text-init {
        top: -2.5em;
    }
    .buy[aria-expanded="true"] .text-hover {
        top: 0;
    }
}

/* Wide screens, where each license sits on one row: fixed columns, so nothing moves when a bulk
   discount appears or goes. Price and the last column (buttons, "Ready to check out?") take the
   widest they hold (a discounted superfamily price in hryvnia); name and quantity share the rest. */
@media only screen and (min-width: 1151px) {
    .licenses {
        grid-template-columns: 1.75em minmax(0, 1fr) minmax(0, 1.75fr) 12em 12em;
    }
}

/* the widest screens: a little more room for prices, taken from name and quantity */
@media only screen and (min-width: 1411px) {
    .licenses {
        grid-template-columns: 1.75em minmax(0, 1fr) minmax(0, 1.75fr) 14em 12em;
    }
}
