/* ── MGest Punts — Estils ──────────────────────────────────────────────────── */

.mgest-punts-wrap {
    max-width: 680px;
    font-family: inherit;
}

/* Capçalera saldo */
.mgest-punts-header {
    margin-bottom: 24px;
}

.mgest-punts-saldo-box {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    border-radius: 14px;
    padding: 24px 28px;
    color: #fff;
    margin-bottom: 14px;
    position: relative;
}

.mgest-punts-icon {
    font-size: 44px;
    line-height: 1;
    flex-shrink: 0;
}

.mgest-punts-saldo-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.mgest-punts-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
}

.mgest-punts-total {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1px;
    color: #fff;
}

.mgest-punts-loading {
    font-size: 18px;
    font-weight: 400;
    opacity: 0.6;
    animation: mgest-blink 1.2s infinite;
}

@keyframes mgest-blink {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.2; }
}

.mgest-punts-equiv {
    font-size: 15px;
    opacity: 0.85;
    color: #a8d8ea;
    font-weight: 500;
}

.mgest-refresh-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    color: #fff;
    font-size: 20px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: background 0.2s, transform 0.3s;
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.mgest-refresh-btn:hover {
    background: rgba(255,255,255,0.28);
}

.mgest-refresh-btn.spinning {
    animation: mgest-spin 0.7s linear infinite;
}

@keyframes mgest-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.mgest-punts-description {
    font-size: 14px;
    color: #555;
    margin: 0;
    padding: 0 4px;
}

/* Formulari bescanvi */
.mgest-punts-form-box {
    background: #f9f9fb;
    border: 1px solid #e4e4e8;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.mgest-punts-form-box h3 {
    margin: 0 0 18px;
    font-size: 17px;
}

.mgest-punts-range-wrap label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
}

.mgest-range-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}

.mgest-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #d0d0d8;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    accent-color: #0f3460;
}

.mgest-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0f3460;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15,52,96,0.35);
    border: 3px solid #fff;
}

.mgest-number-input {
    width: 100px !important;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    border: 1.5px solid #c5c5cc;
    border-radius: 8px;
    padding: 6px 10px;
    flex-shrink: 0;
}

.mgest-equiv-preview {
    font-size: 14px;
    color: #555;
    margin: 0 0 20px;
}

.mgest-equiv-preview span {
    font-weight: 700;
    color: #0f3460;
    font-size: 16px;
}

.mgest-redeem-btn {
    font-size: 15px !important;
    padding: 10px 28px !important;
    border-radius: 8px !important;
    height: auto !important;
    font-weight: 600 !important;
    background: #0f3460 !important;
    border-color: #0f3460 !important;
    cursor: pointer;
    transition: opacity 0.2s;
}

.mgest-redeem-btn:hover {
    opacity: 0.88;
}

.mgest-redeem-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Alertes */
.mgest-alert {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.mgest-alert-error {
    background: #fff0f0;
    border: 1px solid #f5c6c6;
    color: #c0392b;
}

/* Resultat cupó */
.mgest-coupon-result {
    margin-bottom: 24px;
}

.mgest-coupon-box {
    background: #f0faf4;
    border: 1.5px solid #a8e6c1;
    border-radius: 14px;
    padding: 28px 24px;
    text-align: center;
}

.mgest-coupon-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.mgest-coupon-box h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #1a6b3c;
}

.mgest-coupon-box p {
    margin: 0 0 14px;
    font-size: 15px;
    color: #333;
}

.mgest-coupon-code-wrap {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 2px dashed #2ecc71;
    border-radius: 10px;
    padding: 12px 20px;
    margin-bottom: 14px;
}

.mgest-coupon-code {
    font-family: monospace;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #1a6b3c;
}

.mgest-copy-btn {
    background: #2ecc71;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.mgest-copy-btn:hover {
    background: #27ae60;
}

.mgest-coupon-expiry {
    font-size: 13px;
    color: #777;
    margin-bottom: 6px !important;
}

.mgest-coupon-instructions {
    font-size: 13px;
    color: #555;
    font-style: italic;
}

/* Historial */
.mgest-punts-history h3 {
    font-size: 17px;
    margin-bottom: 14px;
}

.mgest-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.mgest-history-table th,
.mgest-history-table td {
    border: 1px solid #e4e4e8;
    padding: 10px 14px;
    text-align: left;
}

.mgest-history-table th {
    background: #f4f4f7;
    font-weight: 600;
    color: #333;
}

.mgest-history-table tr:nth-child(even) td {
    background: #fafafa;
}

.mgest-history-table code {
    font-size: 13px;
    background: #f0f0f4;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* ── Bloc de punts al carret ─────────────────────────────────────────────── */

.mgest-cart-punts-wrap {
    background: #f9f9fb;
    border: 1px solid #e4e4e8;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.mgest-cart-punts-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.mgest-cart-punts-icon {
    font-size: 22px;
    line-height: 1;
}

.mgest-cart-punts-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
}

.mgest-cart-desc {
    font-size: 14px;
    color: #555;
    margin: 0 0 12px;
}

.mgest-cart-use-btn {
    font-size: 14px !important;
    font-weight: 600 !important;
    background: #0f3460 !important;
    color: #fff !important;
    border-color: #0f3460 !important;
    border-radius: 8px !important;
    padding: 8px 20px !important;
    height: auto !important;
    cursor: pointer;
    transition: opacity 0.2s;
}

.mgest-cart-use-btn:hover {
    opacity: 0.88;
}

/* Saldo disponible */
.mgest-cart-saldo {
    font-size: 14px;
    color: #333;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: #eef2ff;
    border-radius: 8px;
}

.mgest-cart-saldo strong {
    color: #0f3460;
}

/* Range wrap — reutilitza .mgest-range-row i .mgest-slider del compte */
.mgest-cart-range-wrap label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
}

/* Botons d'acció */
.mgest-cart-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.mgest-cart-apply-btn {
    font-size: 14px !important;
    font-weight: 600 !important;
    background: #0f3460 !important;
    border-color: #0f3460 !important;
    border-radius: 8px !important;
    padding: 8px 20px !important;
    height: auto !important;
    cursor: pointer;
    transition: opacity 0.2s;
}

.mgest-cart-apply-btn:hover {
    opacity: 0.88;
}

.mgest-cart-apply-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mgest-cart-cancel-btn {
    background: none;
    border: none;
    font-size: 14px;
    color: #888;
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
}

.mgest-cart-cancel-btn:hover {
    color: #333;
}

/* Estat amb punts ja aplicats */
.mgest-cart-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.mgest-cart-applied-msg {
    font-size: 14px;
    color: #1a6b3c;
    margin: 0;
}

.mgest-cart-applied-msg strong {
    color: #1a6b3c;
}

.mgest-cart-remove-btn {
    background: none;
    border: 1px solid #e0a0a0;
    border-radius: 6px;
    color: #c0392b;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 12px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.mgest-cart-remove-btn:hover {
    background: #fff0f0;
}

/* Responsive carret */
@media (max-width: 480px) {
    .mgest-cart-applied {
        flex-direction: column;
        align-items: flex-start;
    }
    .mgest-cart-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .mgest-punts-saldo-box {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    .mgest-punts-total { font-size: 30px; }
    .mgest-refresh-btn { position: static; margin-top: 8px; }
    .mgest-range-row { flex-direction: column; gap: 10px; }
    .mgest-slider { width: 100%; }
    .mgest-number-input { width: 80% !important; }
    .mgest-history-table { font-size: 12px; }
    .mgest-history-table th, .mgest-history-table td { padding: 7px 8px; }
}
