.azpodh-wrap {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fafafa;
    max-width: 800px;
}
.azpodh-wrap h3 { margin: 0 0 12px; font-size: 18px; }

/* ── Toolbar ── */
.azpodh-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}
.azpodh-btn {
    padding: 7px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background .15s;
}
.azpodh-btn:hover { background: #f0f0f0; }
.azpodh-btn-primary {
    background: #2196F3;
    color: #fff;
    border-color: #1976D2;
}
.azpodh-btn-primary:hover { background: #1976D2; }
.azpodh-btn-danger { color: #d32f2f; border-color: #d32f2f; }
.azpodh-btn-danger:hover { background: #ffebee; }

.azpodh-sep {
    width: 1px;
    height: 28px;
    background: #ddd;
    margin: 0 4px;
}

.azpodh-select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}

.azpodh-toolbar input[type="color"] {
    width: 36px;
    height: 32px;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

.azpodh-color-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

/* ── Customer Form ── */
.azpodh-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
    padding: 14px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}
.azpodh-field { display: flex; flex-direction: column; gap: 4px; }
.azpodh-field label {
    font-size: 12px; font-weight: 700; color: #555;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.azpodh-field-input {
    padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px;
    font-size: 14px; font-family: inherit;
    transition: border-color .2s;
}
.azpodh-field-input:focus {
    outline: none; border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33,150,243,0.15);
}
.azpodh-field-file {
    padding: 6px; border: 1px dashed #aaa; border-radius: 6px;
    font-size: 13px; cursor: pointer; background: #fafafa;
}
.azpodh-field-file:hover { border-color: #2196F3; background: #f0f7ff; }
.azpodh-field-inline { flex-direction: row; align-items: center; gap: 8px; }
.azpodh-input-row {
    display: flex; gap: 6px;
}
.azpodh-input-row .azpodh-field-input { flex: 1; min-width: 0; }
.azpodh-font-select {
    padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px;
    font-size: 13px; background: #fff; min-width: 120px; max-width: 150px;
    cursor: pointer; appearance: auto; -webkit-appearance: menulist;
    height: auto; line-height: 1.4;
}
.azpodh-font-select:focus { outline: none; border-color: #2196F3; }
.azpodh-field-inline input[type="color"] {
    width: 40px; height: 32px; border: 1px solid #ccc;
    border-radius: 6px; cursor: pointer; padding: 2px;
}

.azpodh-advanced { margin-bottom: 12px; }
.azpodh-advanced summary {
    cursor: pointer; font-size: 13px; color: #888;
    padding: 6px 0; user-select: none;
}
.azpodh-advanced summary:hover { color: #555; }

/* ── Canvas ── */
.azpodh-canvas-wrap {
    position: relative;
    text-align: center;
    margin: 0 auto 15px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: block;
    max-width: 750px;
    width: 100%;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
/* Fabric.js creates .canvas-container with inline width/height — make responsive */
.azpodh-canvas-wrap .canvas-container {
    max-width: 100% !important;
    /* Aspect ratio 1:1 trick via padding-bottom when height fails */
}
.azpodh-canvas-wrap canvas {
    display: block;
    max-width: 100% !important;
    height: auto !important;
}

/* Loading overlay */
.azpodh-loading {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.7);
    z-index: 10;
}
.azpodh-spinner {
    width: 40px; height: 40px;
    border: 4px solid #ddd;
    border-top-color: #2196F3;
    border-radius: 50%;
    animation: azpodh-spin 0.8s linear infinite;
}
@keyframes azpodh-spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 800px) {
    .azpodh-wrap { padding: 10px; max-width: 100%; }
    .azpodh-canvas-wrap { max-width: 100%; }
    .azpodh-canvas-wrap .canvas-container {
        width: 100% !important;
        max-width: 100% !important;
    }
    .azpodh-canvas-wrap canvas {
        width: 100% !important;
        height: auto !important;
    }
    /* Upper canvas (Fabric uses 2 canvases stacked) */
    .azpodh-canvas-wrap .upper-canvas {
        width: 100% !important;
        height: auto !important;
    }
    .azpodh-form { grid-template-columns: 1fr; padding: 10px; }
    .azpodh-toolbar { gap: 4px; padding: 6px; flex-wrap: wrap; }
    .azpodh-btn { padding: 5px 10px; font-size: 12px; }
}
