/* ═════════════════════════════════════
   Clothing Membership – Frontend CSS
   ═════════════════════════════════════ */
:root {
    --cm-purple:  #7c3aed;
    --cm-pink:    #db2777;
    --cm-green:   #059669;
    --cm-gold:    #d97706;
    --cm-light:   #f5f3ff;
    --cm-border:  #e5e7eb;
    --cm-radius:  12px;
}

/* ── Plan Cards ── */
.cm-plans-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    padding: 8px 0;
}

.cm-plan-card {
    border: 2px solid var(--cm-border);
    border-radius: var(--cm-radius);
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
}
.cm-plan-card:hover {
    border-color: var(--cm-purple);
    box-shadow: 0 8px 24px rgba(124,58,237,.12);
}

.cm-plan-header {
    background: linear-gradient(135deg, var(--cm-purple), var(--cm-pink));
    padding: 24px 20px;
    color: #fff;
    text-align: center;
}
.cm-plan-header h3 { margin: 0 0 12px; font-size: 1.15rem; font-weight: 700; letter-spacing: .03em; }

.cm-plan-price { display: flex; align-items: baseline; justify-content: center; gap: 2px; }
.cm-currency   { font-size: 1.1rem; font-weight: 600; }
.cm-amount     { font-size: 2.4rem; font-weight: 800; line-height: 1; }
.cm-period     { font-size: .9rem; opacity: .85; }

.cm-plan-body { padding: 20px; }
.cm-plan-body p { margin: 0 0 12px; color: #555; font-size: .9rem; }

.cm-benefits { list-style: none; margin: 0; padding: 0; }
.cm-benefits li { padding: 6px 0; font-size: .9rem; border-bottom: 1px solid #f0f0f0; }
.cm-benefits li:last-child { border-bottom: none; }

.cm-plan-footer { padding: 0 20px 20px; text-align: center; }

.cm-btn-buy {
    display: block;
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--cm-purple), var(--cm-pink));
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
    text-decoration: none;
}
.cm-btn-buy:hover { opacity: .88; transform: translateY(-1px); }

.cm-btn-disabled {
    display: block;
    padding: 12px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 8px;
    font-weight: 600;
    font-size: .9rem;
}

.cm-no-plans { color: #666; font-style: italic; }

/* ── Membership Status Box ── */
.cm-status-box {
    border-radius: var(--cm-radius);
    padding: 20px 24px;
    margin: 16px 0;
}
.cm-status-box.cm-active   { background: #d1fae5; border-left: 5px solid var(--cm-green); }
.cm-status-box.cm-inactive { background: #fef3c7; border-left: 5px solid var(--cm-gold); }

.cm-status-badge { font-size: 1rem; font-weight: 700; display: block; margin-bottom: 10px; }
.cm-status-details p { margin: 4px 0; font-size: .9rem; }

/* ── Checkout Gift Section ── */
.cm-gift-section {
    background: #fff;
    border: 2px solid var(--cm-purple);
    border-radius: var(--cm-radius);
    padding: 22px;
    margin: 24px 0;
}

.cm-gift-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--cm-purple);
    font-size: 1.1rem;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--cm-light);
}

.cm-gift-locked {
    background: #fef9c3;
    border-radius: 8px;
    padding: 14px 18px;
    color: #78350f;
    font-size: .95rem;
}

.cm-gift-congrats {
    color: var(--cm-green);
    font-weight: 600;
    margin: 0 0 16px;
}

.cm-gift-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.cm-gift-item { position: relative; }

.cm-gift-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cm-gift-label { cursor: pointer; display: block; }

.cm-gift-card {
    border: 2px solid var(--cm-border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
    background: #fafafa;
}
.cm-gift-radio:checked ~ .cm-gift-card,
.cm-gift-label:hover .cm-gift-card {
    border-color: var(--cm-purple);
    box-shadow: 0 0 0 3px rgba(124,58,237,.15);
    background: var(--cm-light);
}

.cm-gift-img img { width: 100%; height: 130px; object-fit: cover; display: block; }

.cm-gift-info-block {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cm-gift-info-block strong { font-size: .88rem; color: #111; line-height: 1.3; }

.cm-gift-free {
    display: inline-block;
    background: linear-gradient(135deg, var(--cm-purple), var(--cm-pink));
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* Variant dropdown */
.cm-variant-selector {
    margin-top: 10px;
    padding: 12px;
    background: var(--cm-light);
    border-radius: 8px;
    border: 1px solid #ddd6fe;
}
.cm-attr-row { margin-bottom: 8px; }
.cm-attr-row label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 4px; color: var(--cm-purple); }
.cm-attr-row select { width: 100%; padding: 6px 8px; border-radius: 6px; border: 1px solid #c4b5fd; font-size: .88rem; }

.cm-gift-note { font-size: .8rem; color: #888; margin: 0; }

/* ── Non-member teaser at checkout ── */
.cm-gift-teaser {
    background: #fef3c7;
    border: 1px dashed var(--cm-gold);
    border-radius: var(--cm-radius);
    padding: 16px 20px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.cm-gift-icon { font-size: 2rem; }
.cm-gift-teaser p { margin: 0; color: #78350f; font-size: .95rem; }
.cm-gift-teaser a { color: var(--cm-purple); font-weight: 600; }

/* ── Order gift badge ── */
.cm-order-gift-badge {
    display: inline-block;
    background: #d1fae5;
    color: #065f46;
    border-radius: 6px;
    padding: 2px 10px;
    font-size: .8rem;
    font-weight: 600;
    margin-top: 4px;
}

/* ── Login notice ── */
.cm-login-notice { color: #555; }

/* ═══════════════════════════════════════
   Gift Cart-Based Styles (v3)
   ═══════════════════════════════════════ */

/* Progress bar (cart page - not enough items) */
.cm-gift-progress-wrap {
    background: #fff;
    border: 2px dashed #c4b5fd;
    border-radius: 12px;
    padding: 18px 20px;
    margin: 16px 0 24px;
}
.cm-gift-progress-label {
    font-size: .93rem;
    color: #374151;
    margin-bottom: 10px;
}
.cm-gift-progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}
.cm-gift-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #db2777);
    border-radius: 999px;
    transition: width .4s ease;
}

/* Gift confirmed (already in cart) */
.cm-gift-confirmed {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    border-radius: 10px;
    padding: 12px 18px;
    margin: 0 0 14px;
    font-size: .93rem;
    color: #065f46;
}
.cm-gift-confirmed a { color: #7c3aed; font-weight: 600; text-decoration: none; }
.cm-gift-confirmed a:hover { text-decoration: underline; }

/* Unlocked notice */
.cm-gift-unlocked-notice {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 10px;
    padding: 12px 18px;
    margin: 0 0 14px;
    font-size: .93rem;
    color: #78350f;
}

/* Gift selector section */
.cm-gift-section {
    background: #fff;
    border: 2px solid #7c3aed;
    border-radius: 14px;
    padding: 22px;
    margin: 0 0 28px;
}
.cm-gift-heading {
    font-size: 1.05rem;
    color: #7c3aed;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ede9fe;
}

/* Gift grid */
.cm-gift-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.cm-gift-item { position: relative; }
.cm-gift-radio { position: absolute; opacity: 0; width: 0; height: 0; }

.cm-gift-label { cursor: pointer; display: block; }

.cm-gift-card {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.cm-gift-card:hover,
.cm-gift-card-selected {
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 3px rgba(124,58,237,.15) !important;
    background: #f5f3ff !important;
}
.cm-gift-item.cm-gift-selected .cm-gift-card {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124,58,237,.15);
    background: #f5f3ff;
}

.cm-gift-img img { width: 100%; height: 120px; object-fit: cover; display: block; }
.cm-gift-info-block { padding: 10px 10px 12px; }
.cm-gift-name { display: block; font-size: .82rem; color: #111; line-height: 1.3; margin-bottom: 6px; font-weight: 600; }

.cm-gift-free-badge {
    display: inline-block;
    background: linear-gradient(135deg, #7c3aed, #db2777);
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* Variant selector */
.cm-variant-selector {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
}
.cm-attr-row { margin-bottom: 8px; }
.cm-attr-row label { display: block; font-size: .8rem; font-weight: 600; color: #5b21b6; margin-bottom: 4px; }
.cm-attr-row select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #c4b5fd;
    border-radius: 6px;
    font-size: .85rem;
    background: #fff;
}
.cm-variation-status { font-size: .8rem; margin: 6px 0 0; min-height: 16px; }

/* Submit button */
.cm-gift-submit-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cm-gift-submit-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #7c3aed, #db2777);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s;
}
.cm-gift-submit-btn:hover   { opacity: .87; }
.cm-gift-submit-btn:disabled{ opacity: .5; cursor: wait; }
.cm-gift-submit-msg { font-size: .88rem; font-weight: 600; }

/* Cart badge */
.cm-gift-cart-badge {
    display: inline-block;
    background: #d1fae5;
    color: #065f46;
    font-size: .72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 6px;
}

/* FREE price display */
.cm-gift-free-price {
    color: #059669;
    font-weight: 700;
    font-size: .9rem;
}

/* Checkout notices */
.cm-checkout-gift-notice {
    border-radius: 10px;
    padding: 14px 18px;
    margin: 0 0 20px;
    font-size: .93rem;
}
.cm-checkout-gift-ok   { background: #d1fae5; border-left: 4px solid #059669; color: #065f46; }
.cm-checkout-gift-warn { background: #fef3c7; border-left: 4px solid #f59e0b; color: #78350f; }
.cm-checkout-gift-info { background: #eff6ff; border-left: 4px solid #3b82f6; color: #1e40af; }
.cm-checkout-gift-notice a { color: #7c3aed; font-weight: 600; text-decoration: none; }
.cm-checkout-gift-notice a:hover { text-decoration: underline; }
