/* ============================================================
   Product page: price, stock, Add to Cart, "added" message
   Brand colour taken from the site's theme colour (#40349a)
   ============================================================ */

:root {
    --amt-brand: #40349a;
    --amt-brand-dark: #2f2675;
    --amt-success: #1e8e4e;
    --amt-danger: #c0392b;
    --amt-border: #d9d7e8;
    --amt-text: #1a1a1a;
    --amt-muted: #6b6b7b;
}

/* ---- Price ---- */
.productDescription .price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--amt-text);
    margin: 18px 0 10px;
}

/* ---- Condition / stock line ---- */
.productDescription .stock-condition {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 22px;
    font-size: 0.95rem;
}

.productDescription .stock-condition .condition,
.productDescription .stock-condition .stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-weight: 500;
    background: #f1f0f8;
    color: var(--amt-brand);
}

.productDescription .stock-condition .stock.in {
    background: #e6f5ec;
    color: var(--amt-success);
}

.productDescription .stock-condition .stock.out {
    background: #fbeaea;
    color: var(--amt-danger);
}

.productDescription .stock-condition .stock::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Hides the plain "|" separator, since the pills already separate them */
.productDescription .stock-condition {
    font-size: 0;            /* collapses the &nbsp;|&nbsp; text node */
}
.productDescription .stock-condition span {
    font-size: 0.95rem;
}

/* ---- Add to Cart form ---- */
.add-to-cart {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 12px;
    margin: 0 0 24px;
}

.add-to-cart label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* Quantity stepper (the - and + buttons are added by product-cart.js) */
.qty-stepper {
    display: inline-flex;
    align-items: stretch;
    border: 1.5px solid var(--amt-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.qty-stepper button {
    width: 42px;
    border: 0;
    background: transparent;
    font-size: 1.25rem;
    color: var(--amt-brand);
    cursor: pointer;
    transition: background 0.15s;
}

.qty-stepper button:hover {
    background: #f1f0f8;
}

.qty-stepper button:disabled {
    color: #c4c2d4;
    cursor: not-allowed;
    background: transparent;
}

.add-to-cart input[type="number"] {
    width: 52px;
    border: 0;
    text-align: center;
    font-size: 1rem;
    font-family: inherit;
    color: var(--amt-text);
    -moz-appearance: textfield;
    appearance: textfield;
}

.add-to-cart input[type="number"]::-webkit-outer-spin-button,
.add-to-cart input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.add-to-cart input[type="number"]:focus {
    outline: none;
}

/* Main button */
.btn-add-to-cart {
    flex: 1 1 220px;
    max-width: 320px;
    min-height: 50px;
    padding: 0 28px;
    border: 0;
    border-radius: 10px;
    background: var(--amt-brand);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 4px 14px rgba(64, 52, 154, 0.25);
}

.btn-add-to-cart:hover {
    background: var(--amt-brand-dark);
}

.btn-add-to-cart:active {
    transform: translateY(1px);
}

.btn-add-to-cart:focus-visible,
.qty-stepper button:focus-visible {
    outline: 3px solid rgba(64, 52, 154, 0.35);
    outline-offset: 2px;
}

.btn-add-to-cart:disabled {
    background: #b9b6cc;
    box-shadow: none;
    cursor: not-allowed;
}

/* Loading spinner while adding */
.btn-add-to-cart.is-loading::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: amt-spin 0.7s linear infinite;
}

/* Brief green confirmation state */
.btn-add-to-cart.is-added {
    background: var(--amt-success);
    box-shadow: 0 4px 14px rgba(30, 142, 78, 0.25);
}

@keyframes amt-spin {
    to { transform: rotate(360deg); }
}

/* ---- "Added to cart" message ---- */
.cart-message {
    flex-basis: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
}

.cart-message.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cart-message.success {
    background: #e6f5ec;
    color: #145c33;
    border: 1px solid #bfe3cd;
}

.cart-message.error {
    background: #fbeaea;
    color: #8a2419;
    border: 1px solid #f1c6c1;
}

.cart-message .icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    background: var(--amt-success);
}

.cart-message.error .icon {
    background: var(--amt-danger);
}

.cart-message a {
    margin-left: auto;
    font-weight: 600;
    color: inherit;
    text-decoration: underline;
    white-space: nowrap;
}

/* ---- Description ---- */
.productDescription .description {
    margin: 0;
    color: var(--amt-muted);
    line-height: 1.6;
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
    .productDescription .price {
        font-size: 1.6rem;
    }
    .btn-add-to-cart {
        max-width: none;
    }
}