/* ======================================================
   SMT Toolkit - Wishlist frontend styles
   Theme handles colours; this file handles layout only.
   ====================================================== */

/* ------------------------------------------------------------------
   Add-to-wishlist button
   ------------------------------------------------------------------ */

.smt-wl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    font-size: inherit;
    color: inherit;
    transition: color .2s, opacity .2s;
}

.smt-wl-btn:disabled {
    opacity: .5;
    cursor: wait;
}

.smt-wl-btn-icon-only .smt-wl-btn-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* Heart icon - theme can override via .smt-wl-btn-icon */
.smt-wl-btn-icon::before {
    content: '♡';
    font-size: 1.1em;
    line-height: 1;
}

.smt-wl-btn.added .smt-wl-btn-icon::before {
    content: '♥';
}

/* ------------------------------------------------------------------
   Counter (header widget)
   ------------------------------------------------------------------ */

.smt-wl-counter-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

.smt-wl-counter-icon::before {
    content: '♡';
    font-size: 1.2em;
    line-height: 1;
}

.smt-wl-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: currentColor;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 0 4px;
}

/* ------------------------------------------------------------------
   Modal
   ------------------------------------------------------------------ */

.smt-wl-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

.smt-wl-modal[hidden] {
    display: none;
}

.smt-wl-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
}

.smt-wl-modal-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    height: 100vh;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, .12);
}

.smt-wl-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.smt-wl-modal-title {
    font-size: 18px;
    font-weight: 600;
}

.smt-wl-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    color: inherit;
    opacity: .6;
}

.smt-wl-modal-close:hover {
    opacity: 1;
}

.smt-wl-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 16px;
}

.smt-wl-modal-body > .smt-wl-modal-table,
.smt-wl-modal-body > .smt-wl-empty,
.smt-wl-modal-body > .smt-wl-modal-actions {
    padding-top: 12px;
}

.smt-wl-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    text-align: center;
}

.smt-wl-view-all-link {
    font-weight: 500;
    text-decoration: none;
}

/* Modal table */
.smt-wl-modal-table {
    width: 100%;
    border-collapse: collapse;
}

.smt-wl-modal-table tr + tr {
    border-top: 1px solid #f0f0f0;
}

.smt-wl-modal-table td {
    padding: 10px 6px;
    vertical-align: middle;
}

.smt-wl-modal-img {
    width: 60px;
}

.smt-wl-modal-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.smt-wl-modal-name {
    display: block;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 2px;
}

.smt-wl-modal-price {
    font-size: .875rem;
    opacity: .7;
}

.smt-wl-modal-del {
    width: 32px;
    text-align: right;
}

.smt-wl-modal-remove {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    opacity: .5;
    color: inherit;
}

.smt-wl-modal-remove:hover {
    opacity: 1;
}

.smt-wl-modal-actions {
    margin-top: 16px;
    text-align: right;
}

/* ------------------------------------------------------------------
   Loading / empty / error states
   ------------------------------------------------------------------ */

.smt-wl-loading,
.smt-wl-empty {
    padding: 20px 0;
    text-align: center;
    opacity: .6;
    font-style: italic;
}

.smt-wl-error {
    color: #c0392b;
    padding: 12px 0;
}

/* ------------------------------------------------------------------
   Multi-wishlist picker popover
   ------------------------------------------------------------------ */

.smt-wl-picker {
    position: absolute;
    z-index: 9999;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
    min-width: 220px;
    padding: 8px 0;
    font-size: 14px;
    margin-top: 6px;
}

.smt-wl-btn {
    position: relative; /* anchor for picker */
}

.smt-wl-picker-loading {
    padding: 12px 16px;
    color: #888;
    font-style: italic;
}

.smt-wl-picker-title {
    padding: 6px 16px 10px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #888;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 4px;
}

.smt-wl-picker-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.smt-wl-picker-item,
.smt-wl-picker-new {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    cursor: pointer;
    transition: background .15s;
}

.smt-wl-picker-item:hover,
.smt-wl-picker-new:hover {
    background: #f5f5ff;
}

/* Checkmark circle */
.smt-wl-picker-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    flex-shrink: 0;
    transition: background .2s, border-color .2s;
    position: relative;
}

.smt-wl-picker-check::after {
    content: '';
    display: none;
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.smt-wl-picker-item.has-product .smt-wl-picker-check {
    background: #5e5df0;
    border-color: #5e5df0;
}

.smt-wl-picker-item.has-product .smt-wl-picker-check::after {
    display: block;
}

.smt-wl-picker-plus {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px dashed #bbb;
    font-size: 14px;
    color: #888;
    flex-shrink: 0;
}

.smt-wl-picker-name {
    font-size: 14px;
    color: #333;
    flex: 1;
}

.smt-wl-picker-new .smt-wl-picker-name {
    color: #5e5df0;
    font-weight: 500;
}

/* ------------------------------------------------------------------
   Modal - wishlist tabs, date, stock, add-to-cart
   ------------------------------------------------------------------ */

.smt-wl-modal-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 12px 20px 4px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.smt-wl-modal-tab {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 13px;
    cursor: pointer;
    color: #555;
    transition: background .15s, border-color .15s, color .15s;
}

.smt-wl-modal-tab:hover {
    background: #f5f5ff;
    border-color: #a0a0e8;
}

.smt-wl-modal-tab.active {
    background: #5e5df0;
    border-color: #5e5df0;
    color: #fff;
}

.smt-wl-modal-date {
    display: block;
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}

.smt-wl-modal-atc,
.smt-wl-modal-atc-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    padding: 4px 10px;
    white-space: nowrap;
    text-decoration: none;
}

/* ------------------------------------------------------------------
   Stock badges (modal + page)
   ------------------------------------------------------------------ */

.smt-wl-stock-in,
.smt-wl-stock-out {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    margin-top: 3px;
}

.smt-wl-stock-in {
    background: #d1fae5;
    color: #065f46;
}

.smt-wl-stock-out {
    background: #fee2e2;
    color: #991b1b;
}

/* ------------------------------------------------------------------
   Wishlist page
   ------------------------------------------------------------------ */

.smt-wl-page {
    max-width: 900px;
}

/* Tabs (multi-wishlist) */
.smt-wl-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}

.smt-wl-tab-btn {
    background: none;
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 4px 4px 0 0;
    font-size: inherit;
    color: inherit;
    margin-bottom: -2px;
    transition: border-color .15s;
}

.smt-wl-tab-btn:hover,
.smt-wl-tab-btn.active {
    border-color: currentColor;
    border-bottom-color: currentColor;
}

.smt-wl-tab-count {
    font-size: .8em;
    opacity: .6;
}

.smt-wl-create-btn {
    background: none;
    border: 1px dashed;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: inherit;
    color: inherit;
    opacity: .7;
    transition: opacity .15s;
}

.smt-wl-create-btn:hover {
    opacity: 1;
}

/* Section header */
.smt-wl-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.smt-wl-section-name {
    font-weight: 600;
    font-size: 1.1em;
    flex: 1;
}

/* Items table */
.smt-wl-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.smt-wl-items-table th,
.smt-wl-items-table td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #e5e7eb;
}

.smt-wl-items-table th {
    font-weight: 600;
    font-size: .875rem;
    white-space: nowrap;
}

.smt-wl-thumb {
    width: 72px;
}

.smt-wl-thumb img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.smt-wl-name a {
    font-weight: 500;
    text-decoration: none;
}

.smt-wl-comment-input {
    width: 100%;
    max-width: 200px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: .875rem;
}

.smt-wl-item-actions {
    white-space: nowrap;
}

.smt-wl-atc-btn {
    margin-right: 8px;
}

.smt-wl-remove-page-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    opacity: .5;
    color: inherit;
}

.smt-wl-remove-page-btn:hover {
    opacity: 1;
}

/* Section footer */
.smt-wl-section-footer {
    margin-top: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Social share on wishlist page */
.smt-wl-social-share {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Guest login notice */
.smt-wl-login-notice {
    padding: 16px;
    background: #f9fafb;
    border-left: 4px solid currentColor;
    border-radius: 4px;
}

/* Guest popup message */
.smt-wl-guest-msg {
    display: inline-block;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: .875rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    margin-top: 6px;
    max-width: 280px;
}

/* Public wishlist page */
.smt-wl-public-owner {
    font-weight: 600;
    margin-bottom: 20px;
}

/* Prevent body scroll when modal is open */
body.smt-wl-modal-open {
    overflow: hidden;
}

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */

@media (max-width: 640px) {
    .smt-wl-items-table th:nth-child(n+3),
    .smt-wl-items-table td:nth-child(n+3) {
        display: none;
    }

    .smt-wl-modal-inner {
        max-width: 100%;
    }

    .smt-wl-comment-input {
        max-width: 120px;
    }
}
