/* =========================================================
   WC Easy Order Form — Stylesheet
   ========================================================= */

/* ---------- Reset / Scope ---------- */
.wceo-wrap *,
.wceo-wrap *::before,
.wceo-wrap *::after {
    box-sizing: border-box;
}

.wceo-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 120px;
    font-family: inherit;
}

/* ---------- Title ---------- */
.wceo-form-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 20px;
    color: #111;
}

/* ---------- Summary bar ---------- */
.wceo-summary-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: #f8f9fc;
    border: 1px solid #e2e6ea;
    border-radius: var(--wceo-radius);
    padding: 12px 18px;
    margin-bottom: 24px;
    font-size: .9rem;
    color: #555;
    min-height: 46px;
}
.wceo-summary-bar .wceo-summary-label {
    font-weight: 600;
    color: #333;
}
.wceo-summary-bar .wceo-summary-total {
    margin-left: auto;
    font-weight: 700;
    color: var(--wceo-accent);
}

/* ---------- Product grid ---------- */
.wceo-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 20px;
}

/* ---------- Product card ---------- */
.wceo-product-card {
    position: relative;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: var(--wceo-radius);
    box-shadow: var(--wceo-shadow);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color .2s, box-shadow .2s, transform .15s;
    cursor: default;
}
.wceo-product-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    transform: translateY(-2px);
}
.wceo-product-card.wceo-selected {
    border-color: var(--wceo-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wceo-accent) 20%, transparent);
}

/* ---------- Checkbox ---------- */
.wceo-card-select {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    cursor: pointer;
    z-index: 2;
}
.wceo-card-select input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.wceo-checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, border-color .2s;
}
.wceo-card-select input:checked ~ .wceo-checkmark {
    background: var(--wceo-accent);
    border-color: var(--wceo-accent);
}
.wceo-checkmark::after {
    content: '';
    display: none;
    width: 6px;
    height: 10px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translate(-1px,-1px);
}
.wceo-card-select input:checked ~ .wceo-checkmark::after {
    display: block;
}

/* ---------- Product image ---------- */
.wceo-product-img {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: 8px;
    background: #f1f5f9;
}
.wceo-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.wceo-product-card:hover .wceo-product-img img {
    transform: scale(1.04);
}

/* ---------- Product info ---------- */
.wceo-product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wceo-product-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
    line-height: 1.35;
    padding-right: 28px; /* avoid overlap with checkbox */
}
.wceo-product-sku {
    margin: 0;
    font-size: .78rem;
    color: #94a3b8;
}
.wceo-product-stock {
    margin: 0;
    font-size: .8rem;
    color: #22c55e;
}
.wceo-product-stock.wceo-low-stock {
    color: #ef4444;
}
.wceo-product-price {
    margin: 4px 0 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--wceo-accent);
}

/* ---------- Options panel ---------- */
.wceo-product-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.wceo-option-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wceo-option-label {
    font-size: .82rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.wceo-required {
    color: #ef4444;
    margin-left: 2px;
}
.wceo-variation-select,
.wceo-addon-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: .9rem;
    background: #f8fafc;
    color: #1a202c;
    appearance: auto;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}
.wceo-variation-select:focus,
.wceo-addon-select:focus {
    outline: none;
    border-color: var(--wceo-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wceo-accent) 15%, transparent);
}

/* ---------- Quantity control ---------- */
.wceo-qty-control {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    overflow: hidden;
    width: fit-content;
}
.wceo-qty-btn {
    background: #f1f5f9;
    border: none;
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
    cursor: pointer;
    color: #475569;
    line-height: 1;
    transition: background .15s;
    flex-shrink: 0;
}
.wceo-qty-btn:hover {
    background: #e2e8f0;
}
.wceo-qty-input {
    width: 52px;
    height: 34px;
    border: none;
    border-left: 1px solid #cbd5e0;
    border-right: 1px solid #cbd5e0;
    text-align: center;
    font-size: .95rem;
    font-weight: 600;
    color: #1a202c;
    background: #fff;
    appearance: textfield;
    -moz-appearance: textfield;
}
.wceo-qty-input::-webkit-outer-spin-button,
.wceo-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ---------- Action bar (sticky footer) ---------- */
.wceo-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 2px solid #e2e8f0;
    box-shadow: 0 -4px 24px rgba(0,0,0,.1);
    z-index: 9999;
    padding: 0 20px;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.wceo-action-bar.wceo-bar-visible {
    transform: translateY(0);
}
.wceo-action-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    flex-wrap: wrap;
}
.wceo-selected-count {
    font-size: .9rem;
    color: #64748b;
}
.wceo-selected-count span {
    font-weight: 700;
    color: var(--wceo-accent);
    font-size: 1.1rem;
}
.wceo-action-total {
    font-size: .95rem;
    color: #334155;
}
.wceo-action-total strong {
    color: var(--wceo-accent);
    font-size: 1.1rem;
}
.wceo-add-btn {
    margin-left: auto;
    background: var(--wceo-accent);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    white-space: nowrap;
}
.wceo-add-btn:hover:not(:disabled) {
    background: var(--wceo-accent-dark);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--wceo-accent) 40%, transparent);
    transform: translateY(-1px);
}
.wceo-add-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ---------- Notice ---------- */
.wceo-notice {
    width: 100%;
    padding: 0;
    font-size: .88rem;
    font-weight: 600;
    text-align: center;
    transition: all .25s;
    overflow: hidden;
    max-height: 0;
}
.wceo-notice.wceo-notice-visible {
    padding: 6px 0 10px;
    max-height: 80px;
}
.wceo-notice.wceo-notice-success { color: #16a34a; }
.wceo-notice.wceo-notice-error   { color: #dc2626; }
.wceo-notice.wceo-notice-info    { color: var(--wceo-accent); }

.wceo-notice a.wceo-cart-link {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 14px;
    background: var(--wceo-accent);
    color: #fff;
    border-radius: 5px;
    font-size: .85rem;
    text-decoration: none;
    font-weight: 700;
    transition: background .2s;
}
.wceo-notice a.wceo-cart-link:hover {
    background: var(--wceo-accent-dark);
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .wceo-product-grid {
        grid-template-columns: 1fr;
    }
    .wceo-action-inner {
        gap: 10px;
    }
    .wceo-add-btn {
        width: 100%;
        text-align: center;
        margin-left: 0;
    }
}
