/* Sichen Customize Logo - Modal Styles */
.sichen-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sichen-modal-overlay.active {
    display: flex !important;
}

.sichen-modal-container {
    background: #fff;
    border-radius: 12px;
    max-width: 820px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: sichen-modal-in 0.25s ease-out;
}

@keyframes sichen-modal-in {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.sichen-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px 10px;
}

.sichen-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #222;
    letter-spacing: 0.5px;
}

.sichen-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

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

/* ===== TWO-COLUMN LAYOUT ===== */
.sichen-modal-layout {
    display: flex;
    gap: 0;
    padding: 0;
    min-height: 480px;
}

/* LEFT: Product Preview Panel */
.sichen-preview-panel {
    flex: 0 0 320px;
    background: #faf8f6;
    border-right: 1px solid #e8e4de;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sichen-preview-frame {
    position: relative;
    width: 100%;
    max-width: 280px;
    min-height: 260px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sichen-product-preview {
    max-width: 90%;
    max-height: 260px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}

/* ===== Product Color Dots Below Preview ===== */
.sichen-preview-colors {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    justify-content: center;
}

.sichen-color-dot-sm {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: transform 0.15s;
    border: 2px solid transparent;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.sichen-color-dot-sm:hover {
    transform: scale(1.2);
}

.sichen-color-dot-sm.active {
    border-color: #8B7355;
    outline: 2px solid #8B7355;
    outline-offset: 2px;
}

/* ===== Preview image ===== */
.sichen-preview-img-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
    padding: 0;
}

/* Dimension labels are now embedded directly on the product image */
/* No CSS-based dimension overlays needed */

/* Dimension label */
.sichen-dim-val {
    font-size: 12px;
    font-weight: 700;
    color: #8B7355;
    background: #fff;
    padding: 0 8px;
    white-space: nowrap;
    z-index: 2;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    line-height: 1.3;
}

.sichen-dim-l .sichen-dim-val {
    writing-mode: vertical-lr;
    letter-spacing: 3px;
    padding: 6px 0;
    text-orientation: mixed;
}

.sichen-preview-frame {
    position: relative;
    width: 100%;
    max-width: 240px;
    text-align: center;
    margin: 0 auto;
    padding: 0;
}

/* Logo overlay on product */
.sichen-logo-overlay {
    position: absolute;
    top: 30%;
    left: 30%;
    width: 40%;
    height: 20%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}
.sichen-logo-overlay img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Product info below preview */
.sichen-preview-info {
    margin-top: 12px;
    width: 100%;
    border-top: 1px solid #e8e4de;
    padding-top: 10px;
}

.sichen-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #555;
    padding: 2px 0;
}

.sichen-info-label {
    color: #888;
    font-weight: 500;
}

/* RIGHT: Options Panel */
.sichen-options-panel {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
}

/* Sections */
.sichen-section {
    margin-bottom: 14px;
}

.sichen-section-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

/* Logo Upload Area */
.sichen-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #faf8f6;
}

.sichen-upload-area:hover {
    border-color: #8B7355;
    background: #f5f0eb;
}

.sichen-upload-area p {
    margin: 6px 0 0;
    font-size: 13px;
    color: #555;
}

.sichen-upload-area p span {
    font-size: 11px;
    color: #999;
}

.sichen-upload-area svg {
    margin-bottom: 2px;
}

/* Logo Preview */
#sichen-logo-preview {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e8e4de;
    border-radius: 8px;
    padding: 6px;
    background: #faf8f6;
}

#sichen-logo-preview img {
    max-width: 60px;
    max-height: 60px;
    display: block;
    border-radius: 4px;
}

.sichen-remove-logo {
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Text Inputs */
.sichen-text-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sichen-text-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    color: #333;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.sichen-text-input:focus {
    outline: none;
    border-color: #8B7355;
    box-shadow: 0 0 0 2px rgba(139,115,85,0.15);
}

/* Color Swatches */
.sichen-color-swatches {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sichen-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #fff;
}

.sichen-swatch:hover {
    transform: scale(1.1);
    border-color: #aaa;
}

.sichen-swatch.active {
    border-color: #8B7355;
    outline: 2px solid #8B7355;
    outline-offset: 2px;
}

.sichen-swatch[data-color="White"] { 
    border: 2px solid #ddd !important;
}
.sichen-swatch[data-color="White"].active { 
    border: 3px solid #8B7355 !important;
}

/* Position Radio */
.sichen-position-options {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.sichen-radio {
    position: relative;
    cursor: pointer;
}

.sichen-radio input {
    position: absolute;
    opacity: 0;
}

.sichen-radio span {
    display: block;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 12px;
    color: #555;
    transition: all 0.2s;
    background: #fff;
}

.sichen-radio input:checked + span {
    border-color: #8B7355;
    background: #f5f0eb;
    color: #6B5B4B;
    font-weight: 600;
}

/* Note */
.sichen-note {
    background: #f9f7f4;
    border-radius: 5px;
    padding: 8px 12px;
}

.sichen-note p {
    margin: 0;
    font-size: 11px;
    color: #666;
}

.sichen-note strong {
    color: #333;
}

/* Footer */
.sichen-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 28px 20px;
    border-top: 1px solid #e8e4de;
}

.sichen-modal-footer .button {
    padding: 9px 22px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

#sichen-cancel-customize {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #555;
}

#sichen-cancel-customize:hover {
    background: #eee;
}

#sichen-apply-customize {
    background: #8B7355;
    border: 1px solid #8B7355;
    color: #fff;
    font-weight: 600;
}

#sichen-apply-customize:hover {
    background: #7a6548;
    border-color: #7a6548;
}

/* Customization Summary on Product Page */
#sichen-customize-summary {
    animation: sichen-slide-down 0.2s ease-out;
}

@keyframes sichen-slide-down {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 200px; }
}

/* Scrollbar */
.sichen-modal-container::-webkit-scrollbar {
    width: 6px;
}

.sichen-modal-container::-webkit-scrollbar-track {
    background: transparent;
}

.sichen-modal-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 700px) {
    .sichen-modal-layout {
        flex-direction: column;
    }
    .sichen-preview-panel {
        flex: none;
        border-right: none;
        border-bottom: 1px solid #e8e4de;
        padding: 16px;
    }
    .sichen-modal-container {
        max-width: 100%;
        border-radius: 0;
        max-height: 100vh;
    }
    .sichen-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .sichen-modal-footer {
        flex-direction: column;
    }
    .sichen-modal-footer .button {
        width: 100%;
        text-align: center;
    }
}
