/* ====================================================
   Root Variables
==================================================== */


/* General option classes */
.cod-form-sections.hide-field-icons .input-icon {
    display: none;
}

.cod-form-sections.bold-icons .field-icon i {
    font-weight: bold;
}

.cod-form-sections.hide-field-labels .field-label {
    display: none;
}

.cod-form-sections.rtl-support {
    direction: rtl;
}


.field-label {
    /* Apply them */
    font-size: var(--field-label-font-size) !important;
    font-weight: var(--field-label-font-weight) !important;
    color: var(--label-color) !important;
}


body.rtl .e-con {
    padding: 0 !important;
}

body {
    -webkit-text-size-adjust: 100%;
    /* Prevent text resizing in iOS */
    text-size-adjust: 100%;
    /* Ensure the text doesn't resize */
}

.e-con>.e-con-inner {
    padding: 0 !important;
}

.cod-form-sections input,
.cod-form-sections textarea,
.cod-form-sections select {
    font-size: 16px;
    border: none;
    outline: none;
    width: 100%;
    /* Ensure the font size is at least 16px */
}

/* ====================================================
    RTL Styling
 ==================================================== */
.rtl-form input,
.rtl-form select,
.rtl-form input::placeholder,
.rtl-form select {
    text-align: right;
    direction: rtl;
}

/* ====================================================
    COD Section Header
 ==================================================== */
.cod-form-header {
    color: #353535;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 0;
    padding: 10px 15px;
    background-color: #cccccc63;
    border-radius: var(--field-border-radius);
}


/* ==================================================
   5. form Section
================================================== */
.form-header {
    text-align: center;
}

.form-title {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--form-title-font-size);
    font-weight: var(--form-title-font-weight);
    color: var(--label-color);
    margin-bottom: 10px;
}

.form-title::before,
.form-title::after {
    content: "";
    flex: 1;
    border-bottom: 2px solid var(--label-color);
    /* balanced gray */
}

.form-title::before {
    margin-right: 15px;
}

.form-title::after {
    margin-left: 15px;
}

.form-subtitle {
    color: #666;
    font-size: var(--form-subtitle-font-size);
        font-weight: var(--form-subtitle-font-weight);
}

/* ====================================================
    Form Layouts
 ==================================================== */

.cod-form-sections {
    display: flex;
    flex-direction: column;
    gap: var(--field-spacing);
    max-width: 450px;
    margin: 0 auto;
    /* box-shadow: 0px 2px 11px 1px rgba(0, 0, 0, 0.22); */
    box-sizing: border-box;
    background-color: var(--form-bg-color);
    padding: 15px;
    border-radius: var(--field-border-radius);
    line-height: 1.6;
}

.cod-form-sections.rtl {
    direction: rtl;
}

.cod-form-sections.ltr {
    direction: ltr;
}

.cod-form-sections.rtl input,
.cod-form-sections.rtl select {
    direction: rtl;
    background-position: left 10px top 50%;
    border: none;
    outline: none;
    background-color: transparent;
    width: 100%;
}

.cod-form-sections.ltr input,
.cod-form-sections.ltr select {
    direction: ltr;
    background-position: right 10px top 50%;
    outline: none;
    border: none;
    background-color: transparent;
    width: 100%;
    height: 48px;
}

.cod-form-personal-info {
    display: flex;
    flex-direction: column;
    gap: var(--field-spacing);
}

.cod-form-personal-info input,
.cod-form-personal-info select,
.cod-form-personal-info label,
.cod-form-personal-info button {
    /* border: none !important;
    padding: 0 !important; */
    margin: 0 !important;
}

.field-wrapper {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
    gap: 5px;
}

.required-asterisk {
    color: red;
}



.input-container {
    height: auto;
    min-height: 50px;
    width: 100%;
    border-radius: var(--field-border-radius);
    display: flex;
    align-items: center;
    border: 1px solid var(--field-border-color);
    padding: var(--field-padding);
    gap: 4px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    /* Add this line */
    max-width: 100%;
    overflow: auto;
}

.input-container:focus-within {
    border: 1px solid var(--cta-bg-color);
    box-shadow: 0 0 6px rgba(0, 123, 255, 0.4);
    /* adjust blur & color */

}

.input-container.input-error {
    border-color: #d32f2f !important;
    animation: shake 0.5s ease;
}

.hidden {
    display: none;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}


.input-container.input-error+.error-message {
    display: block;
}

.error-message {
    color: #d32f2f;
    font-size: 12px;
    margin-top: 4px;
    display: none;
    font-weight: 600;
}


.input-icon {
    aspect-ratio: 1 / 1;
    /* ensures square */
    width: 100%;
    /* take available width */
    max-width: 48px;
    /* optional: limit size */
    background: #dfdfdf;
    color: #353535;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}


.cod-form-sections select,
.cod-form-sections textarea,
.cod-form-sections input:is([type=url], [type=tel], [type=text], [type=time], [type=date], [type=datetime], [type=datetime-local], [type=email], [type=number], [type=search], [type=password]),
.cod-form-sections fieldset .wc-stripe-elements-field,
.cod-form-sections .ff-inherit-theme-style .ff-el-form-control:not([size]):not([multiple]) {
    height: calc(100% - -40%) !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 8px !important;
}

/* Change the white to any color */
.cod-form-sections input:-webkit-autofill,
.cod-form-sections input:-webkit-autofill:hover,
.cod-form-sections input:-webkit-autofill:focus,
.cod-form-sections input:-webkit-autofill:active {
    background-color: transparent;
    -webkit-box-shadow: 0 0 0 30px white inset !important;
}

/* ====================================================
    Quantity Input
 ==================================================== */
.cod_form_quantity {
    flex: 1;
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e1e5e9;
    border-radius: var(--field-border-radius);
    padding: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cod_form_quantity:hover {
    border-color: var(--cta-bg-color);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.cod_form_quantity:focus-within {
    border-color: var(--cta-bg-color);
    box-shadow: 0 0 0 3px var(--cta-bg-color-opacity);
}

.quantity-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    aspect-ratio: 1/1;
    background: #f8f9fa;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.quantity-button:hover:not(:disabled) {
    background: var(--cta-bg-color);
    color: white;
    transform: translateY(-1px);
}

.quantity-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.quantity-input {
    text-align: center;
    border: none !important;
    background: transparent;
    font-size: 16px !important;
    font-weight: 600;
    color: #212529;
    margin: 0 8px;
    outline: none;
    padding: 0 !important;
}





/* Add these styles to your existing CSS for price update animations */
.price-update {
    animation: priceHighlight 0.5s ease;
}

@keyframes priceHighlight {
    0% {
        background-color: transparent;
        transform: scale(1);
    }

    50% {
        background-color: var(--cta-bg-color-opacity, rgba(0, 123, 255, 0.1));
        transform: scale(1.02);
    }

    100% {
        background-color: transparent;
        transform: scale(1);
    }
}



/* ====================================================
    Order Summary Accordion
 ==================================================== */
.cod-form-summary {
    border: 1px solid #ccccccad;
    border-radius: var(--field-border-radius);
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease-in-out;
}

.cod-form-summary:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.summaryAccordion {
    background-color: #ebebeb;
    padding: 12px 18px;
    /* border-top-left-radius: inherit;
     border-top-right-radius: inherit; */
    border-radius: inherit;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
    color: #333;
    transition: background 0.3s ease-in-out;
}

.summaryAccordion span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

.summary-accordion-content {
    height: 0;
    overflow: hidden;
    transition: height 0.4s ease-out, opacity 0.3s ease-out, padding 0.3s ease-out;
    opacity: 0;
    padding: 0 18px;
}

.summary-accordion-content.show {
    height: auto;
    opacity: 1;
    padding: 15px 18px;
}

.summaryCaret {
    display: flex;
    transition: transform 0.3s ease;
}

.summaryCaret.up {
    transform: rotate(180deg);
}

/* ====================================================
    Order Summary Content
 ==================================================== */
.order-summary {
    background: #fff;
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: var(--field-spacing);
    font-size: 14px;
    color: #444;
    line-height: 1.6;
}

.order-summary p {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    font-weight: 500;
}

.order-summary strong {
    color: #222;
}

.order-summary span {
    font-weight: 600;
    color: #111;
}

/* ====================================================
    Responsive Styles
 ==================================================== */
@media (max-width: 768px) {
    .order-now-title {
        font-size: 17px;
    }

    .seen-tag {
        padding: 3px 10px;
        /* Slightly reduced padding on mobile */
        font-size: 13px;
        max-width: 150px;
        /* Reduced max-width for mobile */
    }

    .cod-form-sections.ltr .seen-tag {
        left: 0px;
        transform: translateX(50%);
    }
}

@media (max-width: 480px) {
    .seen-tag {
        padding: 2px 8px;
        font-size: 12px;
        max-width: 120px;
    }

    .order-now-title {
        font-size: 16px;
    }
}


/* ====================================================
    Product Showcase Section - Horizontal Layout
 ==================================================== */
.cod-form-product-details {
    display: flex;
    flex-direction: column;
    gap: var(--field-spacing);
    border-radius: var(--field-border-radius);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.product-title {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin: 0;
    line-height: 120%;
    flex: 1;
}

.product-rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    border-radius: var(--field-border-radius);
}

.stars-container {
    display: flex;
    gap: 2px;
    align-items: center;
}

.stars-container .ph-fill.ph-star {
    font-size: 18px;
    color: #ddd;
    transition: transform 0.2s ease;
}

/* Full stars */
.stars-container .ph-fill.ph-star.full-star {
    color: #dd5500
}

/* Partial stars with gradient */
.cod-form-sections.ltr .stars-container .ph-fill.ph-star.partial-star {
    background: linear-gradient(90deg, #dd5500 var(--fill-percentage), #ddd var(--fill-percentage));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Partial stars with gradient */
.cod-form-sections.rtl .stars-container .ph-fill.ph-star.partial-star {
    background: linear-gradient(-90deg, #dd5500 var(--fill-percentage), #ddd var(--fill-percentage));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Empty stars */
.stars-container .ph-fill.ph-star.empty-star {
    color: #ddd;
}

/* Optional hover effect */
.stars-container:hover .ph-fill.ph-star {
    transform: scale(1.1);
}

.rating-number {
    font-size: 14px;
    font-weight: bolder;
    color: #333;
}


.product-pricing-row {
    display: flex;
    align-items: center;
    gap: var(--field-spacing);
}

.sale-price {
    font-size: 22px;
    font-weight: 700;
    color: #333;;
}

.sale-price .price, .sale-price .currency  {
    color: #333;
    ;
}

.regular-price {
    font-size: 22px;
    color: #a5a9a9 !important;
    text-decoration: line-through;
}

.regular-price .price, .regular-price .currency {

    color: #a5a9a9 !important;
 
}

.comparing_badge_price{
    font-size: 13px;
        line-height: 1;
        color: #ffffff;
        background: var(--brand-color);
        font-weight: 400;
        /* padding: 6px; */
        padding: .4rem 1rem;
        direction: ltr !important;
}

/* RTL Adjustments */
.cod-form-sections.rtl .product-header {
    direction: rtl;
}

.cod-form-sections.rtl .product-category {
    margin-left: 0;
    margin-right: 12px;
}

.cod-form-sections.rtl .product-rating-row,
.cod-form-sections.rtl .product-pricing-row {
    direction: rtl;
}

/* ===== PRODUCT IMAGE GALLERY - Enhanced Professional Version ===== */

/* Main product image container */
.main-product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Force square aspect ratio */
    border-radius: var(--global-border-radius, 12px);
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(0, 0, 0, 0.02) 100%);
    pointer-events: none;
    z-index: 1;
}

.main-product-image img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(1) contrast(1);
}

/* Hover effects for main image */
.main-product-image:hover {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.main-product-image:hover img {
    transform: scale(1.03);
    filter: brightness(1.02) contrast(1.05);
}

/* Zoom cursor indicator */
.main-product-image[data-zoom="true"] {
    cursor: zoom-in;
}

.main-product-image[data-zoom="true"]:hover::after {
    content: '🔍';
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 2;
    animation: zoomPulse 2s infinite;
}

@keyframes zoomPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Gallery container */
.product-image-gallery {
    display: flex;
    gap: 12px;
    margin-bottom: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 0 16px 0;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.product-image-gallery::-webkit-scrollbar {
    height: 4px;
}

.product-image-gallery::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

.product-image-gallery::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    transition: background 0.3s ease;
}

.product-image-gallery::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Thumbnail positioning variations */
.product-image-gallery[data-thumbnail-position="top"] {
    order: -1;
    margin-bottom: 0;
    margin-top: 1.5rem;
}

.product-image-gallery[data-thumbnail-position="left"] {
    flex-direction: column;
    width: 100px;
    height: auto;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.product-image-gallery[data-thumbnail-position="right"] {
    flex-direction: column;
    width: 100px;
    height: auto;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    order: 1;
}

/* Individual thumbnail styles */
.product-image {
    position: relative;
    min-width: 85px;
    width: 85px;
    height: 85px;
    aspect-ratio: 1 / 1;
    /* Ensure perfect square */
    border-radius: var(--global-border-radius);
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: all 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.95) contrast(1);
}

/* Thumbnail hover effects */
.product-image:hover {
    border-color: var(--brand-color-opacity);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.product-image:hover::before {
    background: rgba(0, 0, 0, 0.1);
}

.product-image:hover img {
    transform: scale(1.05);
    filter: brightness(1) contrast(1.1);
}

/* Active thumbnail state */
.product-image.active {
    border-color: var(--brand-color);
    box-shadow: 0 4px 20px rgba(var(--brand-color-rgb, 59, 130, 246), 0.3);
    transform: translateY(-2px);
}

.product-image.active::before {
    background: rgba(var(--brand-color-rgb, 59, 130, 246), 0.1);
}

.product-image.active img {
    filter: brightness(1.05) contrast(1.1);
}

/* Loading states */
.product-image img[loading="lazy"] {
    opacity: 0;
    animation: fadeInImage 0.5s ease forwards;
}

@keyframes fadeInImage {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Skeleton loading animation */
.product-image.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .product-image-gallery {
        gap: 8px;
        padding: 6px 0 12px 0;
    }

    .product-image {
        min-width: 70px;
        width: 70px;
        height: 70px;
        aspect-ratio: 1 / 1;
        border-radius: 8px;
    }

    .main-product-image {
        border-radius: 8px;
    }

    .product-image-gallery[data-thumbnail-position="left"],
    .product-image-gallery[data-thumbnail-position="right"] {
        width: 80px;
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .product-image {
        min-width: 60px;
        width: 60px;
        height: 60px;
        aspect-ratio: 1 / 1;
        /* Perfect square even on small screens */
    }

    .product-image-gallery[data-thumbnail-position="left"],
    .product-image-gallery[data-thumbnail-position="right"] {
        flex-direction: row;
        width: 100%;
        height: auto;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
    }
}

/* Accessibility improvements */
.product-image:focus {
    outline: 2px solid var(--brand-color, #3b82f6);
    outline-offset: 2px;
}

.main-product-image:focus {
    outline: 2px solid var(--brand-color, #3b82f6);
    outline-offset: 2px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {

    .product-image,
    .product-image img,
    .main-product-image,
    .main-product-image img {
        transition: none;
    }

    .main-product-image:hover img {
        transform: none;
    }

    .product-image:hover img {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .product-image {
        border-width: 2px;
        border-color: #000;
    }

    .product-image.active {
        border-color: var(--brand-color, #0066cc);
        border-width: 3px;
    }
}




/* ====================================================
   RTL Support for Variations
==================================================== */
.cod-form-sections.rtl .variation-buttons-container {
    direction: rtl;
}

.cod-form-sections.rtl .variation-swatches-container {
    direction: rtl;
}

.cod-form-sections.rtl .variation-label {
    text-align: right;
}

.cod-form-sections.rtl .variation-select {
    text-align: right;
    direction: rtl;
}


/* ====================================================
   Accessibility Improvements
==================================================== */




.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip: rect(0, 0, 0, 0);
    overflow: hidden;
}
.error-message {
    color: red;
    font-size: 12px;
    margin-top: 5px;
}




/* Spinner animation */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

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

/* Field error styling */
.field-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
    display: block;
    font-weight: 500;
}

/* Error styling for fields */
.error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2) !important;
}

/* Form message styles */
.form-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-weight: 500;
}

.form-message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Price update animation */
.price-updated {
    animation: priceUpdate 0.3s ease-in-out;
}

@keyframes priceUpdate {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
        color: #27ae60;
    }

    100% {
        transform: scale(1);
    }
}

/* Loading state styles */
.loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

/* Disabled form state */
.form-disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Submission blocked styles */
.submission-blocked {
    opacity: 0.5;
    pointer-events: none;
}

.submission-blocked::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 0, 0, 0.1);
    z-index: 1000;
}

/* Media query for smaller screens (Mobile responsiveness) */
@media (max-width: 768px) {
    #pxu-toast-container {
        top: 20px;
        right: auto;
        /* Remove the right alignment */
        left: 50%;
        /* Move it to the center */
        transform: translateX(-50%);
        /* Offset by 50% of its width to perfectly center it */
        bottom: auto;
    }
}

.file-input-container {
    width: 100%;
}



/* Container */
.file-upload-wrapper {
    position: relative;
    width: 100%;
    
    font-family: sans-serif;
}

/* Hide the real file input */
.file-upload-wrapper input[type="file"] {
    display: none;
}

/* Label styling (custom button / drop area) */
.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--field-border-color) !important;
    border-radius: 12px !important;
    padding: 40px 20px !important;
    text-align: center;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s;
    background: #f9f9f9 !important;
}

.file-upload-label:hover .file-upload-icon {
    color: var(--cta-bg-color);
    transform: scale(1.1) rotate(5deg);
    /* slightly bigger + rotated */
    transition: transform 0.2s ease, color 0.2s ease;
    /* smooth effect */
}

.file-upload-icon {
    font-size: 40px !important;
    margin-bottom: 10px !important;
}

.file-upload-text {
    font-size: 16px !important;
    color: #333 !important;
}

/* form area */
.file-upload-form {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.file-upload-form img {
    max-width: 80px;
    max-height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
}

/* Drag over effect */
.file-upload-wrapper.dragover .file-upload-label {
    background: #e6f7ff !important;
    border-color: var(--cta-bg-color) !important;
}



:root {


    /* Button Layout & Animation */
    --button-height: 60px;
    --animation-duration: 0.3s;
    --loading-spinner-size: 20px;
}

/* Button Container */
.form-submit-button-container {
    display: flex;
    align-items: stretch;
    gap: var(--field-spacing);
    margin-bottom: 20px;
}

/* Main Button Styles */
.form-submit-button {
    position: relative !important;
    padding: 0 !important;
    background: var(--cta-bg-color) !important;
    color: var(--cta-text-color) !important;
    border: 2px solid var(--cta-border-color) !important;
    border-radius: var(--field-border-radius) !important;
    cursor: pointer;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all var(--animation-duration) cubic-bezier(0.4, 0, 0.2, 1);
    min-height: var(--button-height);
    font-family: inherit;
    outline: none;
    user-select: none;
}

/* Button Content Container */
.button-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 17px 20px;
    width: 100%;
    height: 100%;
    transition: all var(--animation-duration) ease;
    position: relative;
    z-index: 2;
}

/* Icon Styles */
.button-icon {
    width: 20px;
    height: 20px;
    transition: all var(--animation-duration) ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--cta-text-color);
}

.button-icon i {
    color: inherit;
    font-size: inherit;
}

.button-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Text Container */
.button-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    line-height: 1.2;
}

/* Primary Text */
.button-primary-text {
    font-size: var(--cta-text-font-size) !important;
    font-weight: 700 !important;
    color: var(--cta-text-color) !important;
    transition: all var(--animation-duration) ease;
    margin: 0;
}

/* Subtitle Text */
.button-subtitle {
    font-size: var(--cta-subtitle-font-size) !important;
    font-weight: 400 !important;
    color: var(--cta-subtitle-color) !important;
    opacity: 0.9;
    transition: all var(--animation-duration) ease;
    margin: 0;
}

/* Hover Effects */
.form-submit-button:hover:not(:disabled):not(.loading) {
    background: color-mix(in srgb, var(--cta-bg-color) 85%, black 15%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.form-submit-button:hover:not(:disabled):not(.loading) .button-icon {
    transform: scale(1.1) rotate(5deg);
}

.form-submit-button:hover:not(:disabled):not(.loading) .button-primary-text {
    transform: translateY(-1px);
}

/* Active/Press Effect */
.form-submit-button:active:not(:disabled):not(.loading) {
    transform: translateY(0px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Background Animation Effect */
.form-submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transition: left 0.6s ease;
    z-index: 1;
}

.form-submit-button:hover:not(:disabled):not(.loading)::before {
    left: 100%;
}

/* Loading Spinner */
.form-submit-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--loading-spinner-size);
    height: var(--loading-spinner-size);
    margin-top: calc(var(--loading-spinner-size) / -2);
    margin-left: calc(var(--loading-spinner-size) / -2);
    border: 2px solid transparent;
    border-top-color: var(--cta-text-color);
    border-right-color: var(--cta-text-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity var(--animation-duration) ease;
    z-index: 3;
}

/* Loading State */
.form-submit-button.loading {
    cursor: not-allowed;
    opacity: 0.8;
    pointer-events: none;
}

.form-submit-button.loading::after {
    opacity: 1;
}

.form-submit-button.loading .button-content {
    opacity: 0;
}

/* Success State */
.form-submit-button.success {
    background: #28a745 !important;
    border-color: #1e7e34 !important;
    transform: scale(1.02);
}

.form-submit-button.success .button-icon {
    animation: successPulse 0.6s ease-out;
}

/* Error State */
.form-submit-button.error {
    background: #dc3545 !important;
    border-color: #bd2130 !important;
    animation: shake 0.5s ease-in-out;
}

/* Disabled State */
.form-submit-button:disabled:not(.loading) {
    cursor: not-allowed;
    opacity: 0.6;
    background: #6c757d !important;
    border-color: #5a6268 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Animation Classes */
.form-submit-button.animate-pulse {
    animation: ctaPulse 2s infinite;
}

.form-submit-button.animate-bounce {
    animation: ctaBounce 2s infinite;
}

.form-submit-button.animate-shake {
    animation: ctaShake 0.5s infinite;
}

.form-submit-button.animate-glow {
    animation: ctaGlow 2s infinite;
}

.form-submit-button.animate-slide {
    animation: ctaSlide 3s infinite;
}

/* Keyframe Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes successPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes ctaPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes ctaBounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

@keyframes ctaShake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-2px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(2px);
    }
}

@keyframes ctaGlow {

    0%,
    100% {
        box-shadow: 0 0 5px var(--cta-bg-color);
    }

    50% {
        box-shadow: 0 0 20px var(--cta-bg-color), 0 0 30px var(--cta-bg-color);
    }
}

@keyframes ctaSlide {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

