/* Kim Design Consolidator - Picker Styles */

.kdc-design-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    margin: 20px 0;
}

.kdc-design-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    background: #fff;
    transition: box-shadow 0.2s;
}

.kdc-design-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.kdc-design-card img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 12px;
}

.kdc-design-card h3 {
    margin: 0 0 8px 0;
    font-size: 1.1em;
}

.kdc-styles {
    color: #666;
    font-size: 0.9em;
    margin: 0 0 12px 0;
}

.kdc-pick-btn {
    background: #111;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

.kdc-pick-btn:hover {
    background: #333;
}

/* Modal */
.kdc-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.kdc-modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
}

.kdc-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.kdc-modal-close:hover {
    color: #333;
}

/* Picker */
.kdc-picker-img {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto 16px;
    border-radius: 4px;
}

.kdc-picker h2 {
    text-align: center;
    margin: 0 0 20px 0;
}

.kdc-option-group {
    margin-bottom: 16px;
}

.kdc-option-group > label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}

.kdc-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kdc-opt-btn {
    border: 2px solid #ddd;
    background: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95em;
}

.kdc-opt-btn:hover {
    border-color: #999;
}

.kdc-opt-btn.selected {
    border-color: #111;
    background: #111;
    color: #fff;
}

.kdc-opt-btn.selected .kdc-price {
    color: #ccc;
}

.kdc-price {
    font-size: 0.85em;
    color: #666;
}

.kdc-picker-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.kdc-qty label {
    margin-right: 8px;
}

.kdc-qty input {
    width: 60px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.kdc-add-btn {
    flex: 1;
    background: #111;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
}

.kdc-add-btn:hover:not(:disabled) {
    background: #333;
}

.kdc-add-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.kdc-picker-msg {
    margin-top: 12px;
    text-align: center;
}

.kdc-success {
    color: #2d8a2d;
}

.kdc-error {
    color: #c00;
}

/* Mobile */
@media (max-width: 600px) {
    .kdc-design-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .kdc-modal-content {
        padding: 16px;
    }
}

/* Design pages (v1.1.0) */
.kdc-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

a.kdc-pick-btn {
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.kdc-design-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.kdc-design-page .kdc-back {
    margin: 0 0 16px 0;
}

.kdc-design-page .kdc-back a {
    color: #111;
    text-decoration: underline;
}

.kdc-design-page .kdc-picker-img {
    max-width: 340px;
}

/* Drops / sold out (v1.2.0) */
.kdc-design-card {
    position: relative;
}

.kdc-badge-soldout {
    position: static;
    display: inline-block;
    margin: 0 0 10px 0;
    background: #111;
    color: #fff;
    font-size: 0.72em;
    font-weight: bold;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 5px 9px;
    border-radius: 3px;
}

.kdc-sold-out img {
    opacity: 0.85;
}

.kdc-badge-upcoming {
    position: static;
    display: inline-block;
    margin: 0 0 10px 0;
    background: #fff;
    color: #111;
    border: 2px solid #111;
    font-size: 0.72em;
    font-weight: bold;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 3px;
}

.kdc-upcoming img {
    opacity: 0.92;
}

.kdc-drop-banner {
    background: #111;
    color: #fff;
    text-align: center;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 10px 16px;
    border-radius: 4px;
    margin: 0 0 20px 0;
}

.kdc-soldout-note {
    text-align: center;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #111;
    margin: -8px 0 16px 0;
}

/* Front/back view thumbnails (v1.5.0) */
.kdc-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 10px 0 4px 0;
}
.kdc-thumb {
    width: 64px;
    height: 64px;
    padding: 0;
    border: 2px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
}
.kdc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.kdc-thumb.active {
    border-color: #111;
}

/* Shop by Design page: hide the big page-title heading (Jesse 2026-10-23) */
body.page-id-1485 .wp-block-post-title {
    display: none;
}

/* Admin rename controls (v1.7.0) — visible only when logged in as admin */
.kdc-rename-btn {
    display: inline-block;
    background: #fff;
    border: 1px solid #999;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 0.8em;
    cursor: pointer;
    margin: 2px;
}
.kdc-rename-link {
    display: inline-block;
    font-size: 0.8em;
    color: #666;
    text-decoration: underline;
    margin: 2px 0 6px 0;
}
.kdc-delete-link {
    display: inline-block;
    font-size: 0.8em;
    color: #b00;
    text-decoration: underline;
    margin: 2px 0 6px 10px;
}
.kdc-rename-input {
    font-size: 1em;
    padding: 4px 8px;
    border: 1px solid #111;
    border-radius: 4px;
    max-width: 90%;
}

/* Admin design merge drag-and-drop (v1.8.0) — admin only, cards are
   not draggable for visitors */
.kdc-design-card {
    position: relative;
}
/* Drag handle (v1.8.2): the ONLY place a merge drag starts. It carries no
   selectable text, so a long press cannot turn into text selection or a
   callout menu instead of a drag. touch-action:none means touches that
   start here never scroll the page. */
.kdc-drag-handle {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    padding: 10px 12px;
    background: #111;
    color: #fff;
    border-radius: 6px;
    font-size: 18px;
    line-height: 1;
    letter-spacing: 2px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
}
.kdc-drag-handle:active {
    cursor: grabbing;
}
.kdc-design-card.kdc-dragging {
    opacity: 0.5;
}
.kdc-drag-ghost {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    background: #fff;
}
.kdc-design-card.kdc-drop-target {
    outline: 3px dashed #111;
    outline-offset: 4px;
}
.kdc-merge-hint {
    display: block;
    font-size: 0.75em;
    color: #888;
    margin: 0 0 4px 0;
}
