/**
 * ==========================================================================
 * VASS PUBLIC PRODUCT OPTIONS
 *
 * Pill-style size display for logged-out visitors.
 * ==========================================================================
 */


/* --------------------------------------------------------------------------
   Main options area
   -------------------------------------------------------------------------- */

.public-product-options {
    width: 100%;
    margin: 18px 0 36px;
}

.public-product-options .product-page-sub-sub {
    margin: 0 0 18px;
}


/* --------------------------------------------------------------------------
   Option groups
   -------------------------------------------------------------------------- */

.public-option-group {
    width: 100%;
}

.public-option-group + .public-option-group {
    margin-top: 38px;
}


/* --------------------------------------------------------------------------
   Four-column grid
   -------------------------------------------------------------------------- */

.public-option-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 14px;
    row-gap: 10px;
    width: 100%;
}


/* --------------------------------------------------------------------------
   Shared pill design
   -------------------------------------------------------------------------- */

.public-option-pill {
    /*
     * Each colour variation overrides this value.
     * It is used for the border and glow.
     */
    --pill-glow: 255, 255, 255;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    width: 100%;

    /*
     * A fixed height makes every pill identical, whether it contains
     * one line or two lines of text.
     */
    height: 60px;
    min-height: 60px;

    padding: 6px 10px;
    gap: 4px;

    box-sizing: border-box;
    overflow: hidden;

    /*
     * A very large radius creates the capsule/button shape.
     */
    border: 1px solid rgba(var(--pill-glow), 0.42);
    border-radius: 999px;

    box-shadow:
        0 0 0 1px rgba(var(--pill-glow), 0.10),
        0 0 9px rgba(var(--pill-glow), 0.22);

    text-align: center;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.1;
    text-transform: uppercase;

    cursor: default;
    user-select: none;

    transform: translateY(0) scale(1);

    transition:
        transform 180ms ease,
        box-shadow 220ms ease,
        filter 220ms ease;

    will-change: transform, box-shadow;
}


/* --------------------------------------------------------------------------
   Standard sizes — yellow
   -------------------------------------------------------------------------- */

.public-option-pill--standard {
    --pill-glow: 255, 194, 56;

    background-color: #fbc715;
    color: #111111;
}


/* --------------------------------------------------------------------------
   Studded sizes — green
   -------------------------------------------------------------------------- */

.public-option-pill--studded {
    --pill-glow: 84, 175, 61;

    background-color: #43631f;
    color: #fff;
}


/* --------------------------------------------------------------------------
   Mega-Stud sizes — grey
   -------------------------------------------------------------------------- */

.public-option-pill--mega-stud {
    --pill-glow: 176, 201, 214;

    background-color: #666666;
    color: #ffffff;
}


/* --------------------------------------------------------------------------
   Text inside each pill
   -------------------------------------------------------------------------- */

.public-option-pill__type,
.public-option-pill__size {
    display: block;
    max-width: 100%;
    margin: 0;

    color: inherit;
    font: inherit;
    line-height: 1.1;

    white-space: nowrap;
}


/* --------------------------------------------------------------------------
   Hover bounce
   -------------------------------------------------------------------------- */

@keyframes public-option-pill-bounce {
    0% {
        transform: translateY(0) scale(1);
    }

    35% {
        transform: translateY(-7px) scale(1.035);
    }

    55% {
        transform: translateY(-1px) scale(0.995);
    }

    75% {
        transform: translateY(-4px) scale(1.018);
    }

    100% {
        transform: translateY(-2px) scale(1.01);
    }
}


/*
 * Only use the bounce on devices that have a proper mouse or trackpad.
 * This prevents sticky hover effects on phones and tablets.
 */
@media (hover: hover) and (pointer: fine) {
    .public-option-pill:hover {
        animation:
            public-option-pill-bounce
            520ms
            cubic-bezier(0.22, 0.8, 0.28, 1)
            both;

        box-shadow:
            0 0 0 1px rgba(var(--pill-glow), 0.58),
            0 0 15px rgba(var(--pill-glow), 0.42);

        filter: brightness(1.05);
    }
}


/* --------------------------------------------------------------------------
   Tablet
   -------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
    .public-option-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .public-option-group + .public-option-group {
        margin-top: 30px;
    }
}


/* --------------------------------------------------------------------------
   Small mobile screens
   -------------------------------------------------------------------------- */

@media (max-width: 479.98px) {
    .public-product-options {
        margin-bottom: 28px;
    }

    .public-option-grid {
        column-gap: 8px;
        row-gap: 8px;
    }

    .public-option-pill {
        height: 56px;
        min-height: 56px;
        padding: 5px 8px;
        font-size: 12px;
    }
}


/* --------------------------------------------------------------------------
   Accessibility: reduce motion when requested by the visitor
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .public-option-pill {
        transition: box-shadow 220ms ease;
    }

    .public-option-pill:hover {
        animation: none;
        transform: none;
    }
}