/* ══════════════════════════════════════════
   CARTA DIGITAL — Panel público CSS
   ══════════════════════════════════════════ */

/* ── LOGIN ── */
.cdp-login-wrap {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.cdp-login-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}

.cdp-login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.cdp-login-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
}

.cdp-login-logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.4rem;
    border: none;
    padding: 0;
}

.cdp-login-logo p {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

.cdp-alert {
    background: #fff0f0;
    border: 1px solid #fcc;
    color: #c00;
    border-radius: 6px;
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
}

/* ── FIELDS ── */
.cdp-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 1rem;
}

.cdp-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #333;
}

.cdp-field input[type="text"],
.cdp-field input[type="url"],
.cdp-field input[type="password"],
.cdp-field input[type="email"],
.cdp-field textarea,
.cdp-field select {
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 7px;
    font-size: 0.9rem;
    color: #1a1a1a;
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    font-family: inherit;
}

.cdp-field input:focus,
.cdp-field textarea:focus {
    outline: none;
    border-color: #D4A853;
    box-shadow: 0 0 0 3px rgba(212,168,83,0.15);
    background: #fff;
}

.cdp-field textarea { resize: vertical; min-height: 60px; }
.cdp-field small { font-size: 11px; color: #888; }

.cdp-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

/* ── BUTTONS ── */
.cdp-btn-primary {
    width: 100%;
    background: #D4A853;
    color: #0E0C09;
    border: none;
    border-radius: 7px;
    padding: 11px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
    letter-spacing: 0.02em;
}
.cdp-btn-primary:hover { background: #c49a42; }
.cdp-btn-primary:active { transform: scale(0.98); }

.cdp-btn-outline {
    background: transparent;
    color: #555;
    border: 1px solid #d0d0d0;
    border-radius: 7px;
    padding: 8px 14px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.cdp-btn-outline:hover { border-color: #D4A853; color: #D4A853; }

.cdp-btn-ghost {
    background: transparent;
    color: #888;
    border: none;
    padding: 8px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s;
}
.cdp-btn-ghost:hover { color: #333; }

.cdp-btn-xs {
    background: transparent;
    color: #555;
    border: 1px solid #d8d8d8;
    border-radius: 5px;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    font-family: inherit;
}
.cdp-btn-xs:hover { border-color: #D4A853; color: #D4A853; }
.cdp-btn-xs.cdp-btn-danger { border-color: #fcc; color: #c00; }
.cdp-btn-xs.cdp-btn-danger:hover { background: #fff0f0; }

.cdp-btn-add {
    display: block;
    width: 100%;
    background: transparent;
    border: 1px dashed #d0d0d0;
    border-radius: 7px;
    padding: 10px;
    font-size: 0.85rem;
    color: #888;
    cursor: pointer;
    margin-top: 0.8rem;
    transition: all 0.2s;
    font-family: inherit;
}
.cdp-btn-add:hover { border-color: #D4A853; color: #D4A853; background: #fffbf2; }

/* ── PANEL WRAPPER ── */
.cdp-panel {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 0 4rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── PANEL HEADER ── */
.cdp-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.cdp-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cdp-icon { font-size: 1.6rem; }

.cdp-panel-title strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}

.cdp-panel-title span {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.cdp-panel-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── TABS ── */
.cdp-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 1.5rem;
}

.cdp-tab {
    padding: 0.7rem 1.2rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.85rem;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    font-family: inherit;
    margin-bottom: -1px;
}

.cdp-tab.active {
    color: #D4A853;
    border-bottom-color: #D4A853;
}

.cdp-tab:hover { color: #555; }

/* ── SECTION ── */
.cdp-section {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.2rem;
}

.cdp-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 1.2rem;
    padding: 0;
    border: none;
}

.cdp-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #444;
    margin: 0 0 1rem;
    padding: 0;
    border: none;
}

.cdp-section-password {
    background: #fafafa;
    border-style: dashed;
}

/* ── CATEGORY TABS ── */
.cdp-cat-header {
    margin-bottom: 1.2rem;
}

.cdp-cat-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cdp-cat-tab {
    padding: 5px 14px;
    border: 1px solid #d8d8d8;
    background: #fafafa;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
    font-family: inherit;
}

.cdp-cat-tab:hover { border-color: #D4A853; color: #D4A853; }
.cdp-cat-tab.active { background: #D4A853; border-color: #D4A853; color: #0E0C09; font-weight: 600; }
.cdp-cat-tab-add { border-style: dashed; }

/* ── CATEGORY SETTINGS ── */
.cdp-cat-settings {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.cdp-cat-name-input {
    flex: 1;
    min-width: 160px;
    padding: 7px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
}

/* ── PRODUCT ROWS ── */
.cdp-products-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0.5rem;
}

.cdp-product-row {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s;
}

.cdp-product-row:hover { border-color: #d8d8d8; }

.cdp-product-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

.cdp-product-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #eee;
}

.cdp-product-thumb-empty {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    border: 1px solid #eee;
    color: #bbb;
}

.cdp-product-info {
    flex: 1;
    min-width: 0;
}

.cdp-product-info strong {
    display: block;
    font-size: 0.9rem;
    color: #1a1a1a;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cdp-product-info span {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.cdp-product-price {
    font-size: 1rem;
    font-weight: 700;
    color: #D4A853;
    white-space: nowrap;
    margin-right: 4px;
}

.cdp-star {
    color: #D4A853;
    font-size: 0.9rem;
    margin-right: 4px;
}

/* ── PRODUCT EDIT FORM ── */
.cdp-product-edit {
    padding: 1rem 1.2rem;
    background: #fafafa;
    border-top: 1px solid #eee;
}

/* ── ADD FORM ── */
.cdp-add-form {
    background: #fffbf2;
    border: 1px solid #f0d88a;
    border-radius: 8px;
    padding: 1.2rem;
    margin-top: 0.5rem;
}

.cdp-add-form h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #a07a20;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 1rem;
    padding: 0;
    border: none;
}

/* ── LOADING ── */
.cdp-loading {
    text-align: center;
    padding: 3rem;
    color: #888;
    font-size: 0.9rem;
}

.cdp-empty {
    text-align: center;
    padding: 2rem;
    color: #aaa;
    font-style: italic;
    font-size: 0.85rem;
}

/* ── TOAST ── */
.cdp-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1a1a1a;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
    z-index: 9999;
    pointer-events: none;
    white-space: nowrap;
}

.cdp-toast.show { transform: translateX(-50%) translateY(0); }
.cdp-toast.error { background: #c00; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    .cdp-field-row { grid-template-columns: 1fr; }
    .cdp-panel-header { flex-direction: column; align-items: flex-start; }
    .cdp-product-info span { display: none; }
    .cdp-section { padding: 1rem; }
}

/* ── CATEGORY BACKGROUND IMAGE SECTION ── */
.cdp-cat-bg-section {
    background: #f7f7f5;
    border: 1px solid #e8e8e4;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.cdp-cat-bg-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.7rem;
    letter-spacing: 0.02em;
}

.cdp-bg-preview {
    margin-top: 0.7rem;
    height: 110px;
    border-radius: 7px;
    background-color: #1a1208;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    transition: background-image 0.4s ease;
}

.cdp-bg-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(5,4,2,.4), rgba(5,4,2,.6));
}

.cdp-bg-preview-label {
    position: relative;
    z-index: 1;
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 1.3rem;
    color: #f0c97a;
    text-align: center;
    pointer-events: none;
}

.cdp-bg-preview-empty {
    font-size: 0.75rem;
    color: rgba(245,240,232,0.35);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.cdp-btn-primary-xs {
    background: #D4A853;
    color: #0E0C09;
    border: 1px solid #D4A853;
    border-radius: 5px;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    font-weight: 600;
    transition: background 0.2s;
}
.cdp-btn-primary-xs:hover { background: #c49a42; }
