.polaroid-order-wrapper,
.polaroid-order-wrapper * {
    box-sizing: border-box;
}

.polaroid-order-wrapper {
    max-width: 900px;
    margin: 24px auto;
    padding: 20px;
    border-radius: 28px;
    background: linear-gradient(145deg, #f5f7fb, #ffffff);
    box-shadow:
        0 18px 40px rgba(15, 23, 42, 0.12),
        0 0 0 1px rgba(148, 163, 184, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

.polaroid-order-success {
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: 16px;
    background: rgba(52, 199, 89, 0.08);
    border: 1px solid rgba(52, 199, 89, 0.35);
    color: #065f46;
    font-size: 14px;
}

.polaroid-field-group {
    margin-bottom: 14px;
}

.polaroid-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 4px;
}

.polaroid-label-strong {
    margin-top: 6px;
    margin-bottom: 8px;
    color: #475569;
}

.polaroid-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 14px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.polaroid-input:focus {
    border-color: #0f6fff;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(15, 111, 255, 0.2);
}

.polaroid-select-wrapper {
    display: inline-flex;
    align-items: center;
    position: relative;
    width: 100%;
}

.polaroid-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 9px 34px 9px 14px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 14px;
    color: #0f172a;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.polaroid-select:focus {
    border-color: #0f6fff;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(15, 111, 255, 0.2);
}

.polaroid-select-wrapper::after {
    content: "▾";
    position: absolute;
    right: 12px;
    font-size: 11px;
    color: #94a3b8;
    pointer-events: none;
}

.polaroid-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin: 12px 0 24px 0;
}

.polaroid-image-thumb {
    position: relative;
    border-radius: 18px;
    background: #0f172a;
    overflow: hidden;
    cursor: pointer;
    transform: translateY(0);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.28);
    transition: transform 0.16s ease, box-shadow 0.16s ease, outline 0.16s ease;
    display: none; /* alapból rejtve, JS adja hozzá a polaroid-visible-t */
}

.polaroid-image-thumb.polaroid-visible {
    display: block;
}

.polaroid-image-thumb img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.polaroid-image-thumb:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.35);
}

.polaroid-image-thumb.selected {
    outline: 2px solid #0f6fff;
    box-shadow: 0 16px 34px rgba(15, 111, 255, 0.5);
}

.polaroid-image-folder-label {
    position: absolute;
    left: 8px;
    top: 8px;
    background: rgba(15, 23, 42, 0.7);
    color: #e5e7eb;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    backdrop-filter: blur(8px);
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.polaroid-image-order-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(15, 111, 255, 0.98);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(15, 111, 255, 0.6);
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.polaroid-image-thumb.selected .polaroid-image-order-badge {
    opacity: 1;
    transform: scale(1);
}

.polaroid-submit-row {
    margin-top: 26px;
}

.polaroid-submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #0f6fff, #4f9bff);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 14px 26px rgba(15, 111, 255, 0.45);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.polaroid-submit-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(15, 111, 255, 0.6);
    filter: brightness(1.03);
}

.polaroid-submit-button:active {
    transform: translateY(1px);
    box-shadow: 0 8px 16px rgba(15, 111, 255, 0.45);
}

/* Popup modal */

.polaroid-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.polaroid-modal {
    width: 100%;
    max-width: 360px;
    background: #ffffff;
    border-radius: 24px;
    padding: 20px 20px 16px 20px;
    box-shadow:
        0 20px 45px rgba(15, 23, 42, 0.45),
        0 0 0 1px rgba(148, 163, 184, 0.2);
    text-align: center;
}

.polaroid-modal-check {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    margin: 0 auto 10px auto;
    background: radial-gradient(circle at 30% 30%, #a7f3d0, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    box-shadow: 0 10px 18px rgba(22, 163, 74, 0.5);
}

.polaroid-modal-title {
    margin: 0 0 6px 0;
    font-size: 17px;
    font-weight: 600;
    color: #111827;
}

.polaroid-modal-text {
    margin: 0 0 14px 0;
    font-size: 14px;
    color: #4b5563;
}

.polaroid-modal-close {
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    background: #0f6fff;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 10px 18px rgba(15, 111, 255, 0.45);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.polaroid-modal-close:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(15, 111, 255, 0.6);
    filter: brightness(1.04);
}

.polaroid-modal-close:active {
    transform: translateY(1px);
    box-shadow: 0 8px 15px rgba(15, 111, 255, 0.5);
}

@media (max-width: 640px) {
    .polaroid-order-wrapper {
        border-radius: 20px;
        padding: 16px;
        margin: 16px;
    }

    .polaroid-images-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .polaroid-modal {
        margin: 0 16px;
    }
}
