/* ========== Toast Notifications ========== */
.lwb-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e1e2e;
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    z-index: 999999;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 6px 20px rgba(0,0,0,0.30);
    animation: lwbToastIn 0.3s ease;
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lwb-toast.lwb-toast-error {
    background: #d0021b;
}
@keyframes lwbToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-16px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ========== Modal ========== */
.lwb-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
}
.lwb-modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}
.lwb-modal-content {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 16px;
    padding: 36px 28px 28px;
    max-width: 420px;
    width: 90vw;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    animation: lwbModalIn 0.35s ease;
}
@keyframes lwbModalIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.lwb-modal-title {
    margin: 0 0 20px;
    font-size: 22px;
    font-weight: 700;
    color: #1e1e2e;
    letter-spacing: 0.3px;
}
.lwb-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 32px;
    height: 32px;
    font-size: 24px;
    line-height: 32px;
    cursor: pointer;
    color: #888;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}
.lwb-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}
.lwb-modal-product {
    margin-bottom: 8px;
}
.lwb-modal-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 160px;
    height: 160px;
    margin: 0 auto 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #f0f0f0;
    overflow: hidden;
}
.lwb-modal-thumb {
    display: block !important;
    max-width: 140px !important;
    max-height: 140px !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    border-radius: 6px;
    object-fit: contain;
}
#lwb-result-name,
#lwb-box-result-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px;
    word-break: break-word;
}
.lwb-modal-actions {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.lwb-modal-actions button {
    padding: 10px 22px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}
.lwb-btn-primary {
    background: #2271b1 !important;
    color: #fff !important;
    border-color: #2271b1 !important;
}
.lwb-btn-primary:hover {
    background: #135e96 !important;
    border-color: #135e96 !important;
}
.lwb-btn-outline {
    background: transparent !important;
    color: #555 !important;
    border-color: #ddd !important;
}
.lwb-btn-outline:hover {
    background: #f5f5f5 !important;
    border-color: #bbb !important;
    color: #333 !important;
}
.lwb-buy-now-btn {
    background: #d0021b !important;
    color: #fff !important;
    border-color: #d0021b !important;
}
.lwb-buy-now-btn:hover {
    background: #b00015 !important;
    border-color: #b00015 !important;
}

/* ========== Wheel ========== */
.lwb-wheel-container {
    text-align: center;
    margin: 20px auto;
    position: relative;
}
.lwb-wheel-canvas-wrapper {
    position: relative;
    display: inline-block;
}
.lwb-spin-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: #1e73be;
    color: #fff;
    border: none;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
}

/* ========== Blind Box ========== */
.lwb-box-container {
    text-align: center;
    margin: 20px auto;
}
.lwb-box {
    perspective: 600px;
}
.box-body {
    width: 150px;
    height: 150px;
    background: #d4a373;
    margin: 0 auto;
    line-height: 150px;
    font-size: 40px;
    border-radius: 10px;
}
.box-lid {
    width: 160px;
    height: 30px;
    background: #b88a5e;
    margin: 0 auto;
    border-radius: 5px 5px 0 0;
    transition: transform 0.4s;
}
.lwb-box-actions {
    margin-top: 20px;
}
.lwb-box-actions button {
    margin: 0 5px;
}

/* ========== Items Modal ========== */
#lwb-items-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 15px 0;
}
.lwb-item-card {
    width: 100px;
    text-align: center;
    background: #f9f9f9;
    padding: 8px;
    border-radius: 6px;
}
.lwb-item-card img {
    display: block;
    margin: 0 auto;
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 4px;
}
.lwb-item-card p {
    font-size: 12px;
    margin: 5px 0 0;
    word-break: break-word;
}

/* ========== Skin Presets ========== */
.skin-red .box-body { background: linear-gradient(45deg, #d32f2f, #fbc02d); }
.skin-red .box-lid { background: #b71c1c; }
.skin-red .lwb-spin-btn { background: #d32f2f; }

.skin-blue .box-body { background: linear-gradient(45deg, #1976d2, #ffffff); }
.skin-blue .box-lid { background: #0d47a1; }
.skin-blue .lwb-spin-btn { background: #1976d2; }

.skin-green .box-body { background: linear-gradient(45deg, #388e3c, #a5d6a7); }
.skin-green .box-lid { background: #1b5e20; }
.skin-green .lwb-spin-btn { background: #388e3c; }

.skin-gold .box-body { background: linear-gradient(45deg, #ffd700, #b8860b); }
.skin-gold .box-lid { background: #b8860b; }
.skin-gold .lwb-spin-btn { background: #b8860b; }

/* Custom skin background */
.skin-custom .lwb-wheel-canvas-wrapper,
.skin-custom .lwb-box {
    background-size: cover;
    background-position: center;
}

/* ========== Mobile & Tablet Responsive ========== */
@media (max-width: 768px) {
    .lwb-modal-content {
        padding: 28px 16px 20px;
        max-width: 92vw;
        border-radius: 14px;
    }
    .lwb-modal-title {
        font-size: 19px;
        margin-bottom: 16px;
    }
    .lwb-modal-image-wrap {
        width: 130px;
        height: 130px;
        margin-bottom: 12px;
    }
    .lwb-modal-thumb {
        max-width: 110px !important;
        max-height: 110px !important;
    }
    #lwb-result-name,
    #lwb-box-result-name {
        font-size: 16px;
    }
    .lwb-modal-actions {
        margin-top: 20px;
        gap: 8px;
    }
    .lwb-modal-actions button {
        padding: 10px 16px;
        font-size: 13px;
    }
    .lwb-spin-btn {
        width: 62px;
        height: 62px;
        font-size: 13px;
    }
    .lwb-box-actions button {
        margin: 4px 3px;
        font-size: 13px;
        padding: 8px 14px;
    }
    .lwb-toast {
        top: 16px;
        padding: 10px 20px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .lwb-modal-content {
        padding: 24px 12px 16px;
        max-width: 95vw;
        border-radius: 12px;
    }
    .lwb-modal-title {
        font-size: 17px;
        margin-bottom: 12px;
    }
    .lwb-modal-image-wrap {
        width: 110px;
        height: 110px;
    }
    .lwb-modal-thumb {
        max-width: 95px !important;
        max-height: 95px !important;
    }
    .lwb-modal-actions {
        flex-direction: column;
        gap: 8px;
    }
    .lwb-modal-actions button {
        width: 100%;
        padding: 12px 16px;
        font-size: 14px;
    }
    .lwb-modal-close {
        top: 8px;
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 20px;
        line-height: 28px;
    }
    canvas#lwb-wheel-canvas {
        width: 300px !important;
        height: 300px !important;
    }
    .lwb-spin-btn {
        width: 54px;
        height: 54px;
        font-size: 12px;
    }
    .lwb-toast {
        top: 10px;
        padding: 10px 16px;
        font-size: 12px;
        border-radius: 6px;
    }
}
/* ========== Checkout: address management ========== */
.lwb-address-selector {
    margin: 20px 0;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}
.lwb-address-selector h4 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}
.lwb-address-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.lwb-address-card {
    flex: 1;
    min-width: 180px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 13px;
    line-height: 1.5;
    position: relative;
}
.lwb-address-card:hover {
    border-color: #2271b1;
}
.lwb-address-card.active {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}
.lwb-address-card .lwb-addr-label {
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.lwb-address-card .lwb-addr-actions {
    display: flex;
    gap: 4px;
}
.lwb-address-card .lwb-addr-actions button {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
}
.lwb-address-card .lwb-addr-actions button:hover {
    background: #f0f0f0;
}
.lwb-address-card .lwb-addr-detail {
    color: #666;
}
.lwb-addr-add-btn {
    display: inline-block;
    padding: 10px 18px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.lwb-addr-add-btn:hover {
    background: #135e96;
}
.lwb-addr-save-section {
    display: none;
    margin-top: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}
.lwb-addr-save-section input {
    margin: 4px 0;
    padding: 6px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}
.lwb-addr-save-section .lwb-addr-save-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}
.lwb-addr-save-section .lwb-addr-save-actions button {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}
.lwb-addr-save-btn {
    background: #2271b1;
    color: #fff;
    border: none;
}
.lwb-addr-cancel-btn {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}
@media (max-width: 480px) {
    .lwb-address-card {
        min-width: 100%;
    }
}
