/**
 * WC Custom Product Designer - Colorful & Responsive CSS v1.0.3
 */

/* Wrapper - Highlighted with gradient border */
.wcpd-wrapper {
    background: linear-gradient(135deg, #fefefe 0%, #f8f9ff 100%) !important;
    border: 2px solid #e0e7ff !important;
    border-radius: 12px !important;
    padding: 18px !important;
    margin: 16px 0 !important;
    box-sizing: border-box !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.08) !important;
    position: relative !important;
    overflow: hidden !important;
}

.wcpd-wrapper::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899) !important;
}

/* Title */
.wcpd-wrapper .wcpd-title {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #4338ca !important;
    margin: 0 0 16px 0 !important;
    padding: 0 0 12px 0 !important;
    border-bottom: 1px dashed #c7d2fe !important;
    line-height: 1.4 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

/* Upload Section - Highlighted */
.wcpd-wrapper .wcpd-upload-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    border: 2px dashed #f59e0b !important;
    border-radius: 10px !important;
    padding: 14px !important;
    margin-bottom: 16px !important;
}

.wcpd-wrapper .wcpd-upload-label {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #92400e !important;
    margin-bottom: 10px !important;
    display: block !important;
}

.wcpd-wrapper .wcpd-req {
    color: #dc2626 !important;
    margin-left: 2px !important;
}

.wcpd-wrapper .wcpd-max {
    color: #b45309 !important;
    font-weight: 500 !important;
    font-size: 12px !important;
    margin-left: 4px !important;
}

/* Upload Row */
.wcpd-wrapper .wcpd-upload-row {
    display: flex !important;
    gap: 12px !important;
    align-items: flex-start !important;
    flex-wrap: wrap !important;
}

/* Dropzone - Colorful */
.wcpd-wrapper .wcpd-dropzone,
.wcpd-wrapper #wcpd-dropzone {
    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;
    height: 70px !important;
    min-height: 70px !important;
    max-height: 70px !important;
    border: 2px dashed #f59e0b !important;
    border-radius: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    cursor: pointer !important;
    background: #fffbeb !important;
    transition: all 0.2s !important;
    padding: 6px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.wcpd-wrapper .wcpd-dropzone:hover,
.wcpd-wrapper #wcpd-dropzone:hover {
    background: #fef3c7 !important;
    border-color: #d97706 !important;
    transform: scale(1.02) !important;
}

.wcpd-wrapper .wcpd-dropzone svg,
.wcpd-wrapper #wcpd-dropzone svg {
    width: 18px !important;
    height: 18px !important;
    color: #d97706 !important;
}

.wcpd-wrapper .wcpd-dropzone span,
.wcpd-wrapper #wcpd-dropzone span {
    font-size: 9px !important;
    color: #92400e !important;
    text-align: center !important;
    font-weight: 500 !important;
}

/* Preview Images */
.wcpd-wrapper .wcpd-preview-images {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    flex: 1 !important;
}

.wcpd-wrapper .wcpd-image-item {
    position: relative !important;
    width: 55px !important;
    height: 55px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background: #fff !important;
    border: 2px solid #fbbf24 !important;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3) !important;
}

.wcpd-wrapper .wcpd-image-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.wcpd-wrapper .wcpd-spinner {
    width: 16px !important;
    height: 16px !important;
    border: 2px solid #fde68a !important;
    border-top-color: #f59e0b !important;
    border-radius: 50% !important;
    animation: wcpd-spin 0.8s linear infinite !important;
}

@keyframes wcpd-spin {
    to {
        transform: rotate(360deg);
    }
}

.wcpd-wrapper .wcpd-remove-image {
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    width: 18px !important;
    height: 18px !important;
    background: #dc2626 !important;
    border: none !important;
    border-radius: 50% !important;
    color: #fff !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0 !important;
    transition: opacity 0.2s !important;
}

.wcpd-wrapper .wcpd-image-item:hover .wcpd-remove-image {
    opacity: 1 !important;
}

/* Fields Grid */
.wcpd-wrapper .wcpd-fields-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
}

.wcpd-wrapper .wcpd-field-full {
    grid-column: 1 / -1 !important;
}

/* Field - Each with unique color */
.wcpd-wrapper .wcpd-field {
    display: flex !important;
    flex-direction: column !important;
    background: #f0fdf4 !important;
    border: 1px solid #86efac !important;
    border-radius: 8px !important;
    padding: 10px !important;
    transition: all 0.2s !important;
}

.wcpd-wrapper .wcpd-field:hover {
    border-color: #22c55e !important;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15) !important;
}

/* Alternate field colors */
.wcpd-wrapper .wcpd-field:nth-child(2) {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
}

.wcpd-wrapper .wcpd-field:nth-child(2):hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15) !important;
}

.wcpd-wrapper .wcpd-field:nth-child(3) {
    background: #fdf4ff !important;
    border-color: #e879f9 !important;
}

.wcpd-wrapper .wcpd-field:nth-child(3):hover {
    border-color: #d946ef !important;
    box-shadow: 0 2px 8px rgba(217, 70, 239, 0.15) !important;
}

.wcpd-wrapper .wcpd-field:nth-child(4),
.wcpd-wrapper .wcpd-field-full {
    background: #fff7ed !important;
    border-color: #fdba74 !important;
}

.wcpd-wrapper .wcpd-field:nth-child(4):hover,
.wcpd-wrapper .wcpd-field-full:hover {
    border-color: #f97316 !important;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.15) !important;
}

.wcpd-wrapper .wcpd-field-label {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 6px !important;
}

/* Input */
.wcpd-wrapper .wcpd-input {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    background: #fff !important;
    transition: all 0.2s !important;
    box-sizing: border-box !important;
}

.wcpd-wrapper .wcpd-input:focus {
    outline: none !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

.wcpd-wrapper .wcpd-textarea {
    resize: vertical !important;
    min-height: 60px !important;
}

/* Color picker */
.wcpd-wrapper .wcpd-color-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: #fff !important;
    padding: 8px !important;
    border-radius: 6px !important;
    border: 1px solid #d1d5db !important;
}

.wcpd-wrapper .wcpd-color {
    width: 40px !important;
    height: 32px !important;
    padding: 2px !important;
    border: 2px solid #d1d5db !important;
    border-radius: 6px !important;
    cursor: pointer !important;
}

.wcpd-wrapper .wcpd-color-hex {
    font-size: 12px !important;
    font-family: monospace !important;
    font-weight: 600 !important;
    color: #374151 !important;
}

/* Error state */
.wcpd-wrapper .wcpd-dropzone.wcpd-has-error,
.wcpd-wrapper #wcpd-dropzone.wcpd-has-error {
    border-color: #dc2626 !important;
    background: #fef2f2 !important;
}

.wcpd-wrapper .wcpd-field.wcpd-has-error {
    border-color: #dc2626 !important;
    background: #fef2f2 !important;
}

/* Toast */
.wcpd-toast {
    position: fixed !important;
    bottom: 80px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    z-index: 999999 !important;
    animation: wcpd-toast-in 0.3s ease !important;
}

.wcpd-toast-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
}

.wcpd-toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
}

@keyframes wcpd-toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== TABLET ===== */
@media (max-width: 768px) {
    .wcpd-wrapper {
        margin: 12px 0 !important;
        padding: 14px !important;
    }

    .wcpd-wrapper .wcpd-fields-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}

/* ===== MOBILE ===== */
@media (max-width: 480px) {
    .wcpd-wrapper {
        margin: 8px 0 !important;
        padding: 12px !important;
        border-radius: 10px !important;
        border-width: 1px !important;
    }

    .wcpd-wrapper .wcpd-title {
        font-size: 14px !important;
        margin-bottom: 12px !important;
    }

    .wcpd-wrapper .wcpd-upload-section {
        padding: 12px !important;
        margin-bottom: 12px !important;
    }

    .wcpd-wrapper .wcpd-upload-row {
        flex-direction: row !important;
        flex-wrap: wrap !important;
    }

    .wcpd-wrapper .wcpd-dropzone,
    .wcpd-wrapper #wcpd-dropzone {
        width: 70px !important;
        min-width: 70px !important;
        max-width: 70px !important;
        height: 60px !important;
        min-height: 60px !important;
        max-height: 60px !important;
    }

    .wcpd-wrapper .wcpd-image-item {
        width: 50px !important;
        height: 50px !important;
    }

    .wcpd-wrapper .wcpd-fields-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .wcpd-wrapper .wcpd-field {
        padding: 8px !important;
    }

    .wcpd-wrapper .wcpd-input {
        padding: 8px 10px !important;
        font-size: 14px !important;
    }

    .wcpd-toast {
        bottom: 100px !important;
        left: 10px !important;
        right: 10px !important;
        transform: none !important;
    }

    @keyframes wcpd-toast-in {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}