/* ============================================
   Gift'in Sur Mesure - Custom Order Form
   Author: Find'in Solution
   ============================================ */

/* --- Section --- */
.giftin-sm-section {
    padding: 80px 0 100px;
    background: linear-gradient(180deg, #ffffff 0%, #fdf6f5 50%, #fff5f3 100%);
    position: relative;
    overflow: hidden;
}

.giftin-sm-section::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,85,70,0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.giftin-sm-section::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255,85,70,0.04) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.giftin-sm-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* --- Header --- */
.giftin-sm-header {
    text-align: center;
    margin-bottom: 50px;
}

.giftin-sm-title {
    font-family: 'Poppins', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: #2d2d2d;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.giftin-sm-title span {
    color: #ff5546;
    position: relative;
}

.giftin-sm-title span::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 3px;
    background: #ff5546;
    border-radius: 2px;
    opacity: 0.3;
}

.giftin-sm-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 17px;
    color: #888;
    font-weight: 400;
    margin: 0;
}

/* --- Progress Bar --- */
.giftin-sm-progress {
    margin-bottom: 40px;
}

.giftin-sm-progress-bar {
    height: 4px;
    background: #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.giftin-sm-progress-fill {
    height: 100%;
    width: 12.5%;
    background: linear-gradient(90deg, #ff5546, #ff7a6e);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.giftin-sm-steps-indicator {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.giftin-sm-step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: default;
    transition: all 0.3s ease;
}

.giftin-sm-step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e8e8e8;
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.giftin-sm-step-dot.active .giftin-sm-step-number {
    background: #ff5546;
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 85, 70, 0.35);
    transform: scale(1.1);
}

.giftin-sm-step-dot.completed .giftin-sm-step-number {
    background: #4caf50;
    color: #fff;
}

.giftin-sm-step-label {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    color: #bbb;
    font-weight: 500;
    transition: color 0.3s ease;
}

.giftin-sm-step-dot.active .giftin-sm-step-label,
.giftin-sm-step-dot.completed .giftin-sm-step-label {
    color: #555;
}

/* --- Form & Steps --- */
.giftin-sm-form {
    position: relative;
}

.giftin-sm-steps-wrapper {
    overflow: hidden;
    position: relative;
    min-height: 400px;
}

.giftin-sm-step {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    transform: translateX(60px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    visibility: hidden;
}

.giftin-sm-step.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    position: relative;
    visibility: visible;
}

.giftin-sm-step.exit-left {
    opacity: 0;
    transform: translateX(-60px);
}

.giftin-sm-step-title {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.giftin-sm-step-title .material-icons {
    color: #ff5546;
    font-size: 26px;
}

/* --- Group Cards (Step 1) --- */
.giftin-sm-groups {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.giftin-sm-group-card {
    background: #fff;
    border-radius: 12px;
    padding: 22px 26px;
    cursor: pointer;
    border: 2px solid #f0f0f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.giftin-sm-group-card:hover {
    border-color: #ffcdc8;
    box-shadow: 0 8px 30px rgba(255, 85, 70, 0.08);
    transform: translateY(-2px);
}

.giftin-sm-group-card.expanded {
    border-color: #ff5546;
    box-shadow: 0 8px 30px rgba(255, 85, 70, 0.12);
}

.giftin-sm-group-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fff0ee, #ffe8e5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.giftin-sm-group-card:hover .giftin-sm-group-icon,
.giftin-sm-group-card.expanded .giftin-sm-group-icon {
    background: linear-gradient(135deg, #ff5546, #ff7a6e);
}

.giftin-sm-group-icon .material-icons {
    font-size: 24px;
    color: #ff5546;
    transition: color 0.3s ease;
}

.giftin-sm-group-card:hover .giftin-sm-group-icon .material-icons,
.giftin-sm-group-card.expanded .giftin-sm-group-icon .material-icons {
    color: #fff;
}

.giftin-sm-group-label {
    font-family: 'Poppins', sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px;
}

.giftin-sm-group-count {
    font-size: 13px;
    color: #999;
}

.giftin-sm-group-arrow {
    position: absolute;
    right: 22px;
    top: 30px;
    color: #ccc;
    transition: all 0.3s ease;
    font-size: 28px;
}

.giftin-sm-group-card.expanded .giftin-sm-group-arrow {
    transform: rotate(180deg);
    color: #ff5546;
}

/* --- Subcategories (pills) --- */
.giftin-sm-subcategories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0;
    opacity: 0;
}

.giftin-sm-group-card.expanded .giftin-sm-subcategories {
    max-height: 300px;
    margin-top: 18px;
    opacity: 1;
}

.giftin-sm-subcategory-pill {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 50px;
    border: 2px solid #e8e8e8;
    background: #fff;
    color: #555;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
}

.giftin-sm-subcategory-pill:hover {
    border-color: #ffcdc8;
    color: #ff5546;
    background: #fff5f3;
}

.giftin-sm-subcategory-pill.selected {
    border-color: #ff5546;
    background: #ff5546;
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 85, 70, 0.3);
    transform: scale(1.02);
}

/* --- Step Error --- */
.giftin-sm-step-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 15px;
    min-height: 20px;
    font-weight: 500;
}

/* --- Upload Zones (Step 2) --- */
.giftin-sm-uploads {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.giftin-sm-uploads.single-upload {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.giftin-sm-upload-zone {
    position: relative;
}

.giftin-sm-upload-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.giftin-sm-upload-area:hover {
    border-color: #ff5546;
    background: #fff5f3;
}

.giftin-sm-upload-area.drag-over {
    border-color: #ff5546;
    background: #ffefed;
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 85, 70, 0.15);
}

.giftin-sm-upload-icon {
    font-size: 48px !important;
    color: #ddd;
    margin-bottom: 12px;
    transition: color 0.3s ease;
}

.giftin-sm-upload-area:hover .giftin-sm-upload-icon {
    color: #ff5546;
}

.giftin-sm-upload-label {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #444;
    margin: 0 0 6px;
}

.giftin-sm-upload-hint {
    font-size: 13px;
    color: #999;
    margin: 0 0 4px;
}

.giftin-sm-upload-formats {
    font-size: 11px;
    color: #bbb;
    margin: 0;
}

.giftin-sm-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* --- Upload Preview --- */
.giftin-sm-upload-preview {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: #f5f5f5;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #4caf50;
}

.giftin-sm-upload-preview img {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
}

.giftin-sm-remove-file {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.9);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.giftin-sm-remove-file:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

.giftin-sm-remove-file .material-icons {
    font-size: 18px;
}

.giftin-sm-file-name {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    font-size: 11px;
    color: #666;
    background: rgba(255,255,255,0.9);
    padding: 4px 8px;
    border-radius: 6px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Selected Product Badge --- */
.giftin-sm-selected-product {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff0ee;
    color: #ff5546;
    padding: 8px 16px;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
}

/* --- Floating Fields --- */
.giftin-sm-field-group {
    margin-bottom: 20px;
}

.giftin-sm-floating-field {
    position: relative;
}

.giftin-sm-input,
.giftin-sm-textarea {
    width: 100%;
    padding: 18px 16px 8px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    color: #333;
    background: #fff;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.giftin-sm-input:focus,
.giftin-sm-textarea:focus {
    border-color: #ff5546;
    box-shadow: 0 0 0 3px rgba(255, 85, 70, 0.1);
}

.giftin-sm-input.error,
.giftin-sm-textarea.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.giftin-sm-floating-field label {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    color: #aaa;
    pointer-events: none;
    transition: all 0.25s ease;
    background: transparent;
}

.giftin-sm-textarea ~ label {
    top: 18px;
    transform: none;
}

.giftin-sm-input:focus ~ label,
.giftin-sm-input:not(:placeholder-shown) ~ label,
.giftin-sm-textarea:focus ~ label,
.giftin-sm-textarea:not(:placeholder-shown) ~ label {
    top: 6px;
    transform: none;
    font-size: 11px;
    color: #ff5546;
    background: #fff;
    padding: 0 4px;
}

.giftin-sm-field-error {
    display: block;
    color: #e74c3c;
    font-size: 12px;
    margin-top: 6px;
    min-height: 16px;
    font-weight: 500;
}

/* --- Checkbox --- */
.giftin-sm-checkbox-group {
    margin-top: 24px;
}

.giftin-sm-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.giftin-sm-checkbox-label input[type="checkbox"] {
    display: none;
}

.giftin-sm-checkmark {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid #ddd;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    position: relative;
    margin-top: 1px;
}

.giftin-sm-checkbox-label input:checked ~ .giftin-sm-checkmark {
    background: #ff5546;
    border-color: #ff5546;
}

.giftin-sm-checkbox-label input:checked ~ .giftin-sm-checkmark::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* --- Summary (Step 4) --- */
.giftin-sm-summary {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    margin-bottom: 30px;
}

.giftin-sm-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.giftin-sm-summary-row:last-child {
    border-bottom: none;
}

.giftin-sm-summary-label {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 100px;
}

.giftin-sm-summary-value {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    text-align: right;
    word-break: break-word;
    max-width: 60%;
}

.giftin-sm-summary-images {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.giftin-sm-summary-images img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #f0f0f0;
}

.giftin-sm-summary-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e8e8e8, transparent);
    margin: 10px 0;
}

/* --- Submit Button --- */
.giftin-sm-submit-area {
    text-align: center;
}

.giftin-sm-submit-btn {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    padding: 16px 48px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #ff5546, #ff7a6e);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(255, 85, 70, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.giftin-sm-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 85, 70, 0.45);
}

.giftin-sm-submit-btn:active {
    transform: translateY(0);
}

.giftin-sm-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.giftin-sm-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: giftin-sm-spin 0.7s linear infinite;
}

@keyframes giftin-sm-spin {
    to { transform: rotate(360deg); }
}

/* --- Navigation Buttons --- */
.giftin-sm-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
}

.giftin-sm-nav-btn {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    outline: none;
}

.giftin-sm-btn-prev {
    background: #f5f5f5;
    color: #777;
}

.giftin-sm-btn-prev:hover {
    background: #eee;
    color: #555;
}

.giftin-sm-btn-next {
    background: linear-gradient(135deg, #ff5546, #ff7a6e);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 85, 70, 0.3);
    margin-left: auto;
}

.giftin-sm-btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 85, 70, 0.4);
}

.giftin-sm-btn-next .material-icons,
.giftin-sm-btn-prev .material-icons {
    font-size: 20px;
}

/* --- Global Error --- */
.giftin-sm-global-error {
    background: #fdeaea;
    color: #e74c3c;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 20px;
    text-align: center;
}

/* --- Success Overlay --- */
.giftin-sm-success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 12px;
    animation: giftin-sm-fadeIn 0.4s ease;
}

@keyframes giftin-sm-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.giftin-sm-success-content {
    text-align: center;
    padding: 40px;
}

.giftin-sm-success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}

.giftin-sm-checkmark-svg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #4caf50;
    stroke-miterlimit: 10;
    animation: giftin-sm-fill 0.4s ease-in-out 0.4s forwards, giftin-sm-scaleUp 0.3s ease-in-out 0.9s both;
}

.giftin-sm-checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke: #4caf50;
    fill: none;
    animation: giftin-sm-stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.giftin-sm-checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-width: 3;
    animation: giftin-sm-stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes giftin-sm-stroke {
    100% { stroke-dashoffset: 0; }
}

@keyframes giftin-sm-scaleUp {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}

@keyframes giftin-sm-fill {
    100% { box-shadow: inset 0 0 0 40px rgba(76, 175, 80, 0.08); }
}

.giftin-sm-success-title {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #4caf50;
    margin-bottom: 12px;
}

.giftin-sm-success-message {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.giftin-sm-btn-new {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 50px;
    border: 2px solid #ff5546;
    background: transparent;
    color: #ff5546;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.giftin-sm-btn-new:hover {
    background: #ff5546;
    color: #fff;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .giftin-sm-section {
        padding: 50px 0 70px;
    }

    .giftin-sm-title {
        font-size: 26px;
    }

    .giftin-sm-subtitle {
        font-size: 14px;
    }

    .giftin-sm-uploads {
        grid-template-columns: 1fr;
    }

    .giftin-sm-step-label {
        font-size: 10px;
    }

    .giftin-sm-step-number {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .giftin-sm-summary-row {
        flex-direction: column;
        gap: 4px;
    }

    .giftin-sm-summary-value {
        text-align: left;
        max-width: 100%;
    }

    .giftin-sm-submit-btn {
        width: 100%;
        justify-content: center;
    }

    .giftin-sm-nav {
        gap: 10px;
    }

    .giftin-sm-nav-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .giftin-sm-group-card {
        padding: 16px 18px;
    }
}

@media (max-width: 480px) {
    .giftin-sm-container {
        padding: 0 15px;
    }

    .giftin-sm-title {
        font-size: 22px;
    }

    .giftin-sm-upload-area {
        padding: 30px 15px;
        min-height: 160px;
    }

    .giftin-sm-summary {
        padding: 18px;
    }
}
