/* ============================================
   EDITOR STYLES - COMPLETE
   ============================================ */
.wp-editor {
    background: var(--wp-dark);
    color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-x: hidden;
}

/* Editor Topbar */
.editor-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px;
    background: var(--wp-dark-2);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky; top: 0; z-index: 300;
    gap: 10px; flex-shrink: 0;
}
.editor-topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.editor-back {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 8px; color: rgba(255,255,255,0.6);
    font-size: 13px; transition: all 0.2s; text-decoration: none; flex-shrink: 0;
}
.editor-back:hover { background: rgba(255,255,255,0.1); color: #fff; }
.editor-topbar-left h3 { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-topbar-left h3 i { margin-right: 6px; opacity: 0.5; }
.editor-save-btn {
    display: flex; align-items: center; gap: 7px;
    padding: 9px 20px;
    background: var(--wp-gradient-1);
    color: #fff; border: none; border-radius: 50px;
    font-family: var(--wp-font);
    font-size: 13px; font-weight: 700;
    cursor: pointer; transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
    white-space: nowrap; flex-shrink: 0;
}
.editor-save-btn:hover { transform: scale(1.02); box-shadow: 0 6px 20px rgba(99,102,241,0.4); }
.editor-save-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Editor Layout */
.editor-layout { display: flex; flex: 1; min-height: 0; }

/* Editor Sidebar */
.editor-sidebar {
    width: 360px;
    min-width: 360px;
    background: var(--wp-dark-2);
    border-right: 1px solid rgba(255,255,255,0.06);
    overflow-y: auto;
    height: calc(100vh - 53px);
    position: sticky;
    top: 53px;
    -webkit-overflow-scrolling: touch;
}

/* Section Buttons */
.editor-sections {
    display: flex; flex-wrap: wrap; gap: 4px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.2);
    position: sticky; top: 0; z-index: 10;
}
.editor-section-btn {
    padding: 6px 10px; border-radius: 7px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.55);
    font-family: var(--wp-font);
    font-size: 11px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; gap: 4px;
    white-space: nowrap;
}
.editor-section-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.editor-section-btn.active { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.3); color: #a5b4fc; }
.editor-section-btn i { font-size: 10px; }

/* Editor Panels */
.editor-panel { display: none; padding: 16px; }
.editor-panel.active { display: block; }
.editor-panel h4 { font-size: 15px; font-weight: 700; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.editor-panel h5 { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.6); margin: 16px 0 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.editor-panel .form-group { margin-bottom: 14px; }
.editor-panel label { display: block; font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.55); margin-bottom: 5px; }
.editor-panel input[type="text"],
.editor-panel input[type="url"],
.editor-panel input[type="number"],
.editor-panel textarea,
.editor-panel select {
    width: 100%; padding: 9px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px; color: #fff;
    font-family: var(--wp-font); font-size: 13px;
    outline: none; transition: border-color 0.2s;
}
.editor-panel input:focus, .editor-panel textarea:focus, .editor-panel select:focus {
    border-color: rgba(99,102,241,0.4);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.08);
}
.editor-panel input::placeholder, .editor-panel textarea::placeholder { color: rgba(255,255,255,0.2); }
.editor-panel input[type="color"] {
    width: 46px; height: 36px; padding: 2px; border-radius: 7px;
    cursor: pointer; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
}
.editor-panel select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' fill-opacity='.4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px;
}
.editor-panel select option { background: var(--wp-dark-2); color: #fff; }

/* Image Upload */
.image-upload-area {
    width: 100%; min-height: 100px;
    border: 2px dashed rgba(255,255,255,0.1);
    border-radius: 10px; cursor: pointer;
    overflow: hidden; position: relative;
    transition: border-color 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.image-upload-area:hover { border-color: rgba(99,102,241,0.4); }
.image-upload-area img { width: 100%; height: 100px; object-fit: cover; }
.upload-placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; color: rgba(255,255,255,0.3); font-size: 12px; padding: 16px; }
.upload-placeholder i { font-size: 24px; }

.image-upload-small {
    display: inline-flex; align-items: center;
    padding: 5px 10px; border-radius: 7px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer; transition: all 0.2s;
    overflow: hidden; font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 5px;
}
.image-upload-small:hover { border-color: rgba(99,102,241,0.3); }
.image-upload-small img { width: 36px; height: 36px; object-fit: cover; border-radius: 5px; }

/* Editor Item Cards */
.editor-item-card, .editor-service-card, .editor-testimonial-card {
    padding: 12px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 9px; margin-bottom: 8px; position: relative;
}
.editor-item-card input, .editor-service-card input, .editor-service-card textarea,
.editor-testimonial-card input, .editor-testimonial-card textarea, .editor-testimonial-card select {
    width: 100%; padding: 7px 10px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px; color: #fff; font-family: var(--wp-font); font-size: 12px; margin-bottom: 5px; outline: none;
}
.remove-item {
    position: absolute; top: 7px; right: 7px;
    background: rgba(239,68,68,0.15); border: none; color: #fca5a5;
    width: 26px; height: 26px; border-radius: 6px; cursor: pointer;
    font-size: 10px; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.remove-item:hover { background: rgba(239,68,68,0.3); }

/* Add Item Button */
.btn-add-item {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; padding: 9px;
    background: rgba(99,102,241,0.08); border: 1px dashed rgba(99,102,241,0.3);
    border-radius: 9px; color: #a5b4fc; font-weight: 600;
    font-family: var(--wp-font); font-size: 12px;
    cursor: pointer; transition: all 0.2s; margin-top: 8px;
}
.btn-add-item:hover { background: rgba(99,102,241,0.15); }

/* Gallery Editor */
.gallery-grid-editor { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.gallery-thumb { position: relative; border-radius: 7px; overflow: hidden; aspect-ratio: 1; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.remove-gallery {
    position: absolute; top: 3px; right: 3px;
    width: 20px; height: 20px; background: rgba(239,68,68,0.85);
    border: none; border-radius: 50%; color: #fff; font-size: 9px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* Product Editor Card */
.editor-product-card {
    padding: 14px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 9px; margin-bottom: 10px; position: relative;
}
.editor-product-card .product-img-section { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.editor-product-card .product-thumb { width: 55px; height: 55px; border-radius: 7px; object-fit: cover; background: rgba(255,255,255,0.05); cursor: pointer; }
.editor-product-card .product-thumb-placeholder {
    width: 55px; height: 55px; border-radius: 7px; background: rgba(255,255,255,0.05);
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.2); font-size: 18px; cursor: pointer;
    border: 1px dashed rgba(255,255,255,0.1);
}
.product-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.product-fields.full { grid-template-columns: 1fr; }
.editor-product-card input, .editor-product-card textarea, .editor-product-card select {
    width: 100%; padding: 7px 9px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px; color: #fff; font-family: var(--wp-font); font-size: 12px; outline: none;
}
.editor-product-card textarea { resize: vertical; }

/* Preview Area */
.editor-preview { flex: 1; background: var(--wp-dark-3); overflow: hidden; min-width: 0; }
.preview-frame { width: 100%; height: calc(100vh - 53px); }
.preview-frame iframe { width: 100%; height: 100%; border: none; }

/* Editor Message */
.editor-message { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 500; display: none; }
.editor-message .msg-success {
    display: flex; align-items: center; gap: 7px; padding: 12px 20px;
    background: rgba(16,185,129,0.95); color: #fff; border-radius: 50px;
    font-size: 13px; font-weight: 600; box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}
.editor-message .msg-success a { color: #fff; text-decoration: underline; margin-left: 4px; }

/* ============================================
   RESPONSIVE EDITOR - TABLET
   ============================================ */
@media (max-width: 900px) {
    .editor-layout { flex-direction: column; }
    .editor-sidebar {
        width: 100%; min-width: 100%;
        height: auto; max-height: 50vh;
        position: relative; top: 0;
    }
    .editor-preview { min-height: 45vh; }
    .preview-frame { height: 45vh; }
    .editor-sections { position: relative; }
}

/* ============================================
   RESPONSIVE EDITOR - MOBILE
   ============================================ */
@media (max-width: 600px) {
    .editor-topbar { padding: 8px 12px; }
    .editor-topbar-left h3 { font-size: 12px; }
    .editor-save-btn { padding: 8px 14px; font-size: 12px; }
    .editor-save-btn span.save-text { display: none; }

    .editor-sidebar { max-height: 55vh; }
    .editor-panel { padding: 12px; }
    .editor-sections { gap: 3px; padding: 8px 10px; }
    .editor-section-btn { font-size: 10px; padding: 5px 8px; }

    .gallery-grid-editor { grid-template-columns: repeat(2, 1fr); }
    .product-fields { grid-template-columns: 1fr; }
    .editor-preview { min-height: 40vh; }
    .preview-frame { height: 40vh; }
}

@media (max-width: 380px) {
    .editor-section-btn i { display: none; }
    .editor-panel { padding: 10px 8px; }
}
