.hsd-order-page {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: #2b3a42;
    background: #fffdf8;
}

.hsd-order-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 2rem;
}

/* cart.js sets form.hidden = true after a successful submission; without
   this rule the class selector above would win the cascade over the
   browser's default [hidden]{display:none} and the form would stay visible. */
.hsd-order-form[hidden] {
    display: none;
}

.hsd-products {
    flex: 2 1 480px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    align-content: start;
}

.hsd-product {
    background: #fff;
    border: 1px solid #e3d7bf;
    border-radius: 20px;
    padding: 1rem;
}

.hsd-product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.hsd-product-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1c3a4a;
}

.hsd-price-pill {
    background: #f6efe3;
    color: #c9821c;
    font-weight: 700;
    font-size: 0.8rem;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    white-space: nowrap;
}

.hsd-product-description {
    font-size: 0.8rem;
    color: #4a5a62;
    margin: 0.5rem 0 0;
}

.hsd-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

.hsd-attribute-pill {
    background: #eaf6fb;
    color: #1c6e8c;
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.hsd-attribute-select {
    border: none;
    background: transparent;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
}

.hsd-product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.85rem;
}

.hsd-qty-label {
    font-size: 0.75rem;
    color: #8a7a5c;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.hsd-quantity {
    width: 3.5rem;
    border: 1px solid #e3d7bf;
    border-radius: 999px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.hsd-add-to-cart {
    background: #1c9dc9;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.hsd-add-to-cart:hover {
    background: #1889ae;
}

/*
 * No max-height/overflow-y on the cart panel — the confirmation checkbox
 * text must always be fully visible, never scrolled-and-hidden or clipped.
 * The panel grows with the page instead.
 */
.hsd-cart {
    flex: 1 1 280px;
    position: sticky;
    top: 1rem;
    align-self: flex-start;
    background: #eaf6fb;
    border: 1px solid #bfe4f0;
    border-radius: 20px;
    padding: 1.1rem;
}

.hsd-cart-title {
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1c3a4a;
}

#hsd-cart-list {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
}

.hsd-cart-item {
    background: #fff;
    border-radius: 14px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.hsd-cart-empty {
    background: #fff;
    border-radius: 14px;
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
    color: #4a5a62;
}

.hsd-remove-item {
    background: none;
    border: none;
    color: #8a7a5c;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.hsd-remove-item:hover {
    color: #c9821c;
}

.hsd-cart-total-row {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: #1c3a4a;
    font-size: 0.9rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #bfe4f0;
    margin-bottom: 0.9rem;
}

.hsd-cart-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.hsd-cart-fields input {
    border-radius: 999px;
    border: 1px solid #bfe4f0;
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
    font-family: inherit;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

.hsd-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/*
 * This card holds the legally load-bearing order-confirmation text.
 * Deliberately no max-height, no overflow:hidden, no text-overflow, no
 * white-space:nowrap — it must always render in full, never truncated.
 */
.hsd-confirm-card {
    background: #fff;
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    font-size: 0.78rem;
    color: #2b3a42;
    line-height: 1.5;
    margin-bottom: 0.85rem;
    white-space: pre-line;
}

.hsd-confirm-card label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.hsd-confirm-card input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 0.2rem;
}

#hsd-submit-order {
    width: 100%;
    background: linear-gradient(135deg, #1c9dc9, #1c6e8c);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.75rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-sizing: border-box;
}

#hsd-submit-order:disabled {
    background: #a9c2ca;
    cursor: not-allowed;
}

.hsd-closed {
    background: #f6efe3;
    border: 1px solid #e3d7bf;
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 1.5rem 2rem;
}

#hsd-order-message {
    padding: 0 2rem 2rem;
    font-weight: 600;
    color: #1c6e8c;
    white-space: pre-line;
}

@media (max-width: 700px) {
    .hsd-order-form {
        padding: 1.25rem;
        flex-direction: column;
    }

    .hsd-cart {
        position: static;
    }

    .hsd-closed,
    #hsd-order-message {
        margin-left: 1.25rem;
        margin-right: 1.25rem;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}
