/* =============================================
   Ehva Build Your Box — byb.css
   Matches Joice theme: Poppins + #ff0a54 accent
   ============================================= */

#ehva-byb-wrap {
    font-family: 'Poppins', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 120px;
}

/* ── Banner ── */
.ehva-byb-banner {
    text-align: center;
    padding: 18px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    color: #fff;
}
.ehva-byb-banner-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ── How to shop ── */
.ehva-byb-how {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.ehva-byb-step {
    flex: 1;
    min-width: 180px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px 16px;
}
.ehva-byb-step .step-num {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ehva-byb-step p {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

/* ── Product Grid ── */
.ehva-byb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.ehva-byb-card {
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}
.ehva-byb-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}
.ehva-byb-card.byb-selected {
    border-color: currentColor;
    box-shadow: 0 0 0 2px currentColor;
}

.ehva-byb-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
}
.ehva-byb-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    display: block;
}
.ehva-byb-card:hover .ehva-byb-card-img img {
    transform: scale(1.05);
}

.ehva-byb-card-body {
    padding: 12px 12px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Stars */
.ehva-byb-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.ehva-byb-stars .star {
    font-size: 13px;
    color: #ddd;
}
.ehva-byb-stars .star.full,
.ehva-byb-stars .star.half {
    color: #f4a53a;
}
.star-count {
    font-size: 11px;
    color: #888;
    margin-left: 3px;
}

.ehva-byb-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.35;
    flex: 1;
}
.ehva-byb-card-price {
    font-size: 13px;
    color: #555;
    margin-bottom: 12px;
}

/* Actions pinned to bottom */
.ehva-byb-card-actions {
    margin-top: auto;
}

/* Buttons */
.ehva-byb-add-btn {
    width: 100%;
    padding: 9px 0;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    letter-spacing: 0.3px;
}
.ehva-byb-add-btn:hover {
    opacity: 0.88;
    transform: scale(1.02);
}

/* Qty control */
.ehva-byb-qty-ctrl {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    height: 38px;
    width: 100%;
    box-sizing: border-box;
}
.ehva-byb-minus,
.ehva-byb-plus {
    width: 38px;
    min-width: 38px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    color: #333;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}
.ehva-byb-minus:hover,
.ehva-byb-plus:hover {
    background: #e8e8e8;
}
.ehva-byb-qty-count {
    flex: 1;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    min-width: 0;
}

/* ── Sticky Bar ── */
.ehva-byb-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
    border-top: 1px solid #eee;
    padding: 12px 20px;
}
.ehva-byb-sticky-inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
#ehva-byb-sticky-msg {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}
#ehva-byb-checkout-btn {
    padding: 12px 28px;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    white-space: nowrap;
}
#ehva-byb-checkout-btn:hover:not(:disabled) {
    opacity: 0.88;
    transform: scale(1.02);
}
#ehva-byb-checkout-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading state */
#ehva-byb-checkout-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}
#ehva-byb-checkout-btn.loading::after {
    content: ' ⏳';
}

/* ── Added badge on card ── */
.ehva-byb-added-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fff;
    border-radius: 50px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: none;
}
.ehva-byb-card.byb-selected .ehva-byb-added-badge {
    display: block;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .ehva-byb-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .ehva-byb-banner-title {
        font-size: 17px;
    }
    .ehva-byb-how {
        flex-direction: column;
        gap: 10px;
    }
    #ehva-byb-sticky-msg {
        font-size: 13px;
    }
    #ehva-byb-checkout-btn {
        font-size: 13px;
        padding: 10px 20px;
    }
}

/* ── Variant Dropdowns ── */
.ehva-byb-variants {
    margin-bottom: 10px;
}
.ehva-byb-variant-group {
    margin-bottom: 8px;
}
.ehva-byb-variant-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.ehva-byb-variant-select {
    width: 100%;
    padding: 7px 28px 7px 10px;
    border: 1.5px solid #e0e0e0;
    border-radius: 7px;
    font-size: 12px;
    font-family: 'Poppins', sans-serif;
    color: #333;
    background-color: #fafafa;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.ehva-byb-variant-select:focus {
    outline: none;
    border-color: #ff0a54;
}
.ehva-byb-variant-select.byb-chosen {
    border-color: #ff0a54;
    background-color: #fff5f7;
}
.ehva-byb-variant-hint {
    font-size: 11px;
    color: #e74c3c;
    margin-bottom: 6px;
    font-weight: 500;
}
.ehva-byb-add-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}
