/* Stamps Selection Modal */
#stamps-annotation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    display: none; /* hidden by default */
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#stamps-annotation-modal.active {
    display: flex;
}

.stamps-modal-header {
    width: 100%;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #111;
    color: white;
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

.stamps-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.stamps-modal-controls {
    display: flex;
    gap: 15px;
}

.stamps-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.stamps-btn:hover {
    background: #2980b9;
}

.stamps-btn.danger {
    background: #e74c3c;
}
.stamps-btn.danger:hover {
    background: #c0392b;
}

.stamps-btn.success {
    background: #2ecc71;
}
.stamps-btn.success:hover {
    background: #27ae60;
}

/* Canvas Container */
.stamps-canvas-container {
    position: relative;
    max-width: 95vw;
    max-height: 80vh;
    margin-top: 60px; /* space for header */
}

.stamps-canvas-container img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

#stamps-draw-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* Piwigo Inject Button */
.stamps-inject-btn {
    position: absolute;
    top: 10px;
    right: 60px; /* next to close button usually */
    z-index: 1000;
}

/* Cart / Floating Action Button */
#stamps-cart-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #2ecc71;
    color: white;
    padding: 15px 25px;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 99999;
    font-weight: bold;
    display: none;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s, background 0.2s;
}

#stamps-cart-fab:hover {
    transform: scale(1.05);
    background: #27ae60;
}

#stamps-cart-fab.visible {
    display: flex;
}

.stamps-badge {
    background: white;
    color: #2ecc71;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Checkout Modal */
#stamps-checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.8);
    z-index: 9999999;
    display: none;
    align-items: center;
    justify-content: center;
}

#stamps-checkout-modal.active {
    display: flex;
}

.stamps-checkout-content {
    background: white;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 8px;
    padding: 25px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.stamps-checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stamps-checkout-header h2 {
    margin: 0;
    color: #333;
}

.stamps-checkout-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.stamps-checkout-items {
    margin-bottom: 20px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.stamps-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.stamps-item-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.stamps-item-info {
    flex-grow: 1;
    margin: 0 15px;
    font-size: 14px;
    color: #555;
}

.stamps-form-group {
    margin-bottom: 15px;
}

.stamps-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.stamps-form-group input,
.stamps-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
}

.stamps-checkout-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}
