/* Wishlist Button Styling */
.spc-wishlist {
    position: absolute;
    top: 10px;
    right: 10px; /* Position at top-right corner */
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 0;
    overflow: visible;
}

.spc-wishlist:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.spc-wishlist:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spc-wishlist svg {
    transition: all 0.3s ease;
    color: #ef4444;
}

.spc-wishlist.active {
    background: #ef4444;
}

.spc-wishlist.active svg {
    fill: currentColor;
    color: white;
}

/* Add-only order buttons */
.spc-order-add {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 10;
    border: none;
    border-radius: 6px;
    background: #111827;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    min-height: 32px;
    padding: 9px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.spc-order-add:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.spc-order-add:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
}

.spc-product-detail .spc-order-add,
.spc-order-add-large {
    position: static;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin-left: 10px;
    vertical-align: middle;
}

/* Wishlist button in product detail page */
.spc-product-detail .spc-wishlist {
    position: static;
    width: 44px;
    height: 44px;
    margin-left: 10px;
}

.spc-product-detail .spc-wishlist svg {
    width: 24px;
    height: 24px;
}

/* Large wishlist button */
.spc-wishlist-large {
    position: static !important;
    width: 44px;
    height: 44px;
    margin-left: 10px;
    display: inline-flex !important;
}

.spc-wishlist-large svg {
    width: 24px;
    height: 24px;
}

/* Customer order selection on wishlist page */
.spc-wishlist-select {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    cursor: pointer;
}

.spc-wishlist-select input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.spc-wishlist-select span {
    display: block;
    width: 24px;
    height: 24px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
    transition: all 0.2s ease;
}

.spc-wishlist-select span::after {
    content: '';
    display: block;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    margin: 3px 0 0 7px;
    opacity: 0;
    transform: rotate(45deg);
}

.spc-wishlist-select input:checked + span {
    border-color: #2563eb;
    background: #2563eb;
}

.spc-wishlist-select input:checked + span::after {
    opacity: 1;
}

.spc-wishlist-item.spc-selected-for-order {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18), 0 8px 16px rgba(0, 0, 0, 0.08);
}

.spc-wishlist-order-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.spc-wishlist-select-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #374151;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.spc-wishlist-select-all input {
    width: 16px;
    height: 16px;
}

.spc-wishlist-create-order {
    border: none;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    min-height: 42px;
    padding: 11px 18px;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.spc-wishlist-create-order:hover {
    background: #1d4ed8;
}

.spc-wishlist-create-order:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.spc-wishlist-order-message {
    flex-basis: 100%;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 12px;
    text-align: right;
}

.spc-wishlist-order-message-error {
    background: #fee2e2;
    color: #991b1b;
}

.spc-wishlist-order-message-success {
    background: #dcfce7;
    color: #166534;
}

/* Address popup */
body.spc-order-modal-open {
    overflow: hidden;
}

.spc-order-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
}

.spc-order-modal-backdrop {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.66);
    padding: 24px;
}

.spc-order-modal-dialog {
    position: relative;
    width: min(640px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border-radius: 8px;
    background: #fff;
    padding: 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.26);
}

.spc-order-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6 !important;
    color: #111827 !important;
    cursor: pointer;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    min-width: 34px;
    min-height: 34px;
    max-width: 34px;
    max-height: 34px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    text-align: center;
    appearance: none;
    -webkit-appearance: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.spc-order-modal-close:hover,
.spc-order-modal-close:focus {
    background: #e5e7eb !important;
    color: #111827 !important;
    outline: none;
    transform: none;
}

.spc-order-modal h2 {
    margin: 0 36px 8px 0;
    color: #111827;
    font-size: 24px;
    line-height: 1.2;
}

.spc-order-modal-summary,
.spc-order-modal-total {
    margin: 0 0 8px;
    color: #4b5563;
    font-size: 14px;
}

.spc-order-modal-total {
    margin-bottom: 20px;
    font-weight: 700;
}

.spc-order-modal-fields {
    display: grid;
    gap: 14px;
}

.spc-order-modal-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.spc-order-modal label {
    display: grid;
    gap: 6px;
    color: #374151;
    font-size: 14px;
    font-weight: 700;
}

.spc-order-modal label span {
    color: #dc2626;
}

.spc-order-modal input,
.spc-order-modal select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 10px 12px;
    color: #111827;
    font-size: 15px;
}

.spc-order-modal input:focus,
.spc-order-modal select:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.spc-order-modal-submit {
    width: 100%;
    min-height: 46px;
    margin-top: 18px;
    border: none;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
}

.spc-order-modal-submit:hover {
    background: #1d4ed8;
}

.spc-order-modal-submit:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.spc-order-modal-message {
    border-radius: 6px;
    margin-bottom: 16px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
}

.spc-order-modal-message-success {
    background: #dcfce7;
    color: #166534;
}

.spc-order-modal-message-error {
    background: #fee2e2;
    color: #991b1b;
}

.spc-order-modal-message a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

/* Wishlist Count Badge */
.spc-wishlist-count {
    display: inline-block;
    background: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 5px;
    min-width: 20px;
    text-align: center;
}

.spc-wishlist-count:empty {
    display: none;
}

/* Notification Toast */
.spc-wishlist-notification {
    position: fixed;
    top: 20px;
    right: -300px;
    background: #10b981;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    font-size: 14px;
    font-weight: 500;
    min-width: 200px;
    max-width: 300px;
    transition: right 0.3s ease;
}

.spc-wishlist-notification.show {
    right: 20px;
}

.spc-wishlist-notification-error {
    background: #ef4444;
}

.spc-wishlist-notification-success {
    background: #10b981;
}

/* Animation for notification */
@keyframes slideInRight {
    from {
        right: -300px;
        opacity: 0;
    }
    to {
        right: 20px;
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        right: 20px;
        opacity: 1;
    }
    to {
        right: -300px;
        opacity: 0;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .spc-wishlist {
        width: 32px;
        height: 32px;
        right: 10px;
    }

    .spc-wishlist svg {
        width: 18px;
        height: 18px;
    }

    .spc-wishlist-notification {
        right: -250px;
        max-width: 250px;
        font-size: 13px;
    }

    .spc-wishlist-notification.show {
        right: 10px;
    }

    .spc-order-add {
        bottom: 8px;
        font-size: 12px;
        min-height: 30px;
        padding: 8px 10px;
    }

    .spc-wishlist-order-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .spc-wishlist-create-order,
    .spc-wishlist-select-all {
        width: 100%;
        justify-content: center;
    }

    .spc-wishlist-order-message {
        text-align: center;
    }

    .spc-order-modal-backdrop {
        align-items: flex-start;
        padding: 14px;
    }

    .spc-order-modal-dialog {
        max-height: calc(100vh - 28px);
        padding: 22px;
    }

    .spc-order-modal-row {
        grid-template-columns: 1fr;
    }
}

/* Clear Wishlist Button (if used) */
.spc-clear-wishlist {
    background: #ef4444;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.spc-clear-wishlist:hover {
    background: #dc2626;
}

/* Wishlist Empty State */
.spc-wishlist-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.spc-wishlist-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.spc-wishlist-empty h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #374151;
}

.spc-wishlist-empty p {
    font-size: 14px;
    margin: 0;
}
