/**
 * Easy COD Checkout - Styles des templates
 * Contient les styles spécifiques pour chaque template de popup
 */

/* ======== ANIMATIONS COMMUNES ======== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ======== TEMPLATE PAR DÉFAUT ======== */
/* Le template par défaut conserve les styles de base */
.template-default {
    /* Styles déjà définis dans le CSS principal */
    transition: all 0.3s ease-in-out;
}

.template-default.loaded {
    animation: fadeIn 0.5s ease-in-out;
}

.template-default-title {
    color: #000000;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.template-default-button {
    background-color: #090909;
    color: white;
    transition: background-color 0.3s ease;
}

.template-default-button:hover {
    background-color: #151616;
}

/* ======== MOBILE RESPONSIVE STYLES FOR DEFAULT TEMPLATE ======== */

/* Mobile optimizations for default template */
@media (max-width: 768px) {
    .template-default {
        padding: 12px;
        margin: 5px;
    }
    
    .template-default-title {
        font-size: 18px;
        margin-bottom: 15px;
        padding-bottom: 8px;
    }
    
    .template-default .easy-cod-product-image-container {
        margin-bottom: 15px;
    }
    
    .template-default .easy-cod-product-image-container img {
        max-height: 150px;
        border-radius: 6px;
    }
    
    .template-default .easy-cod-popup-form label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .template-default .easy-cod-popup-form input[type="text"],
    .template-default .easy-cod-popup-form input[type="tel"],
    .template-default .easy-cod-popup-form input[type="email"],
    .template-default .easy-cod-popup-form textarea {
        padding: 12px;
        margin-bottom: 12px;
        font-size: 16px;
        border-radius: 6px;
    }
    
    .template-default-button {
        background-color: #000000 !important;
        color: white;
        padding: 14px 20px;
        font-size: 16px;
        border-radius: 6px;
        width: 100%;
        margin-top: 10px;
        border: none;
        font-weight: 600;
    }
    
    .template-default-button:hover {
        background-color: #333333 !important;
    }
    
    .template-default .easy-cod-order-info {
        padding: 12px;
        margin-bottom: 15px;
        border-radius: 6px;
        font-size: 14px;
    }
    
    .template-default .easy-cod-price-wrapper {
        margin-bottom: 15px;
        text-align: center;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .template-default {
        padding: 10px;
        margin: 2px;
    }
    
    .template-default-title {
        font-size: 16px;
        margin-bottom: 12px;
        padding-bottom: 6px;
    }
    
    .template-default .easy-cod-product-image-container img {
        max-height: 120px;
    }
    
    .template-default .easy-cod-popup-form input[type="text"],
    .template-default .easy-cod-popup-form input[type="tel"],
    .template-default .easy-cod-popup-form input[type="email"],
    .template-default .easy-cod-popup-form textarea {
        padding: 10px;
        margin-bottom: 10px;
        font-size: 16px;
    }
    
    .template-default-button {
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .template-default .easy-cod-order-info {
        padding: 10px;
        margin-bottom: 12px;
        font-size: 13px;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .template-default {
        padding: 8px;
    }
    
    .template-default-title {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    .template-default .easy-cod-product-image-container img {
        max-height: 100px;
    }
    
    .template-default .easy-cod-popup-form input[type="text"],
    .template-default .easy-cod-popup-form input[type="tel"],
    .template-default .easy-cod-popup-form input[type="email"],
    .template-default .easy-cod-popup-form textarea {
        padding: 8px;
        margin-bottom: 8px;
        font-size: 16px;
    }
    
    .template-default-button {
        padding: 10px 14px;
        font-size: 14px;
    }
}

/* ======== TEMPLATE MODERNE ======== */
.template-modern {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(241, 241, 241, 0.1);
    padding: 15px;
    background: linear-gradient(to bottom, #ffffff, #f9f9f9);
    transition: all 0.3s ease-in-out;
    max-width: 95%;
    margin: 10px auto;
}

.template-modern-title {
    color: #020303;
    font-weight: 600;
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.5s ease-in-out;
}

.template-modern-title.animated {
    opacity: 1;
    transform: translateY(0);
}

.template-modern-image {
    margin-bottom: 25px;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.5s ease-in-out;
}

.template-modern-image.animated {
    opacity: 1;
    transform: scale(1);
}

.template-modern-image img {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.template-modern-image img:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.template-modern-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease-in-out;
}

.template-modern-info.animated {
    opacity: 1;
    transform: translateY(0);
}

.template-modern-product-title {
    color: #0d0e0e;
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 600;
}

.template-modern-price-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
}

.template-modern-fields {
    display: grid;
    grid-gap: 15px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease-in-out;
}

.template-modern-fields.animated {
    opacity: 1;
    transform: translateY(0);
}

.template-modern-field {
    position: relative;
}

.template-modern-label {
    font-weight: 500;
    color: #fffafa;
    margin-bottom: 5px;
    font-size: 14px;
    transition: color 0.3s ease;
}

.template-modern-input {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 16px;
    transition: all 0.3s ease;
    width: 100%;
}

.template-modern-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    outline: none;
}

/* Bubbly button styles */
@keyframes topBubbles {
    0%{
        background-position: 5% 90%, 10% 90%, 10% 90%, 15% 90%, 25% 90%, 25% 90%, 40% 90%, 55% 90%, 70% 90%;
    }
    50% {
        background-position: 0% 80%, 0% 20%, 10% 40%, 20% 0%, 30% 30%, 22% 50%, 50% 50%, 65% 20%, 90% 30%;
    }
    100% {
        background-position: 0% 70%, 0% 10%, 10% 30%, 20% -10%, 30% 20%, 22% 40%, 50% 40%, 65% 10%, 90% 20%;
        background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
    }
}

@keyframes bottomBubbles {
    0%{
        background-position: 10% -10%, 30% 10%, 55% -10%, 70% -10%, 85% -10%, 70% -10%, 70% 0%;
    }
    50% {
        background-position: 0% 80%, 20% 80%, 45% 60%, 60% 100%, 75% 70%, 95% 60%, 105% 0%;
    }
    100% {
        background-position: 0% 90%, 20% 90%, 45% 70%, 60% 110%, 75% 80%, 95% 70%, 110% 10%;
        background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
    }
}

.template-modern-button {
    position: relative;
    display: inline-block;
    font-family: 'Helvetica', 'Arial', sans-serif;
    font-size: 1em;
    padding: 15px 25px;
    margin: 10px 0;
    -webkit-appearance: none;
    appearance: none;
    background-color: #000000;
    color: #ffffff;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    position: relative;
    transition: transform ease-in 0.1s, box-shadow ease-in 0.25s;
    box-shadow: 0 2px 25px rgba(0, 0, 0, 0.5);
    width: 100%;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    overflow: visible;
    z-index: 1;
}

.template-modern-button:focus {
    outline: 0;
}

.template-modern-button:before, 
.template-modern-button:after {
    position: absolute;
    content: '';
    display: block;
    width: 140%;
    height: 100%;
    left: -20%;
    z-index: -1000;
    transition: all ease-in-out 0.5s;
    background-repeat: no-repeat;
}

.template-modern-button:before {
    display: none;
    top: -75%;
    background-image:  
        radial-gradient(circle, #000000 20%, transparent 20%),
        radial-gradient(circle, transparent 20%, #000000 20%, transparent 30%),
        radial-gradient(circle, #000000 20%, transparent 20%), 
        radial-gradient(circle, #000000 20%, transparent 20%),
        radial-gradient(circle, transparent 10%, #000000 15%, transparent 20%),
        radial-gradient(circle, #000000 20%, transparent 20%),
        radial-gradient(circle, #000000 20%, transparent 20%),
        radial-gradient(circle, #000000 20%, transparent 20%),
        radial-gradient(circle, #000000 20%, transparent 20%);
    background-size: 10% 10%, 20% 20%, 15% 15%, 20% 20%, 18% 18%, 10% 10%, 15% 15%, 10% 10%, 18% 18%;
}

.template-modern-button:after {
    display: none;
    bottom: -75%;
    background-image:  
        radial-gradient(circle, #000000 20%, transparent 20%), 
        radial-gradient(circle, #000000 20%, transparent 20%),
        radial-gradient(circle, transparent 10%, #000000 15%, transparent 20%),
        radial-gradient(circle, #000000 20%, transparent 20%),
        radial-gradient(circle, #000000 20%, transparent 20%),
        radial-gradient(circle, #000000 20%, transparent 20%),
        radial-gradient(circle, #000000 20%, transparent 20%);
    background-size: 15% 15%, 20% 20%, 18% 18%, 20% 20%, 15% 15%, 10% 10%, 20% 20%;
}

.template-modern-button.animate:before,
.template-modern-button.animate:after {
    display: block;
}

.template-modern-button.animate:before {
    animation: topBubbles ease-in-out 0.75s forwards;
}

.template-modern-button.animate:after {
    animation: bottomBubbles ease-in-out 0.75s forwards;
}

.template-modern-button:active {
    transform: scale(0.9);
    background-color: #000000;
    box-shadow: 0 2px 25px rgba(0, 0, 0, 0.2);
}

.template-modern-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.template-modern-button.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ======== TEMPLATE MINIMAL ======== */
@import url("https://fonts.googleapis.com/css2?family=Raleway:wght@400;700&display=swap");

.template-minimal {
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 30px;
    background-color: #ffffff;
    max-width: 450px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.template-minimal.fade-in {
    opacity: 1;
}

.template-minimal-title {
    color: #000;
    font-weight: 300;
    font-size: 22px;
    margin-bottom: 25px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: none;
}

.template-minimal-image {
    margin-bottom: 25px;
    text-align: center;
}

.template-minimal-image img {
    border: none;
    border-radius: 0;
    padding: 0;
    max-height: 180px;
    transition: opacity 0.3s ease;
}

.template-minimal-image img:hover {
    opacity: 0.9;
    transform: none;
}

.template-minimal-info {
    margin-bottom: 25px;
    text-align: center;
}

.template-minimal-product-title {
    color: #333;
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 5px;
}

.template-minimal-price-wrapper {
    font-size: 18px;
    color: #000;
}

.template-minimal-fields {
    margin-bottom: 25px;
}

.template-minimal-field {
    margin-bottom: 20px;
}

.template-minimal-label {
    font-weight: 400;
    color: #666;
    margin-bottom: 8px;
    font-size: 14px;
    display: block;
}

.template-minimal-input {
    border: none;
    border-bottom: 1px solid #ddd;
    border-radius: 0;
    padding: 10px 0;
    font-size: 15px;
    transition: border-color 0.3s ease;
    width: 100%;
    background-color: transparent;
}

.template-minimal-input.focused {
    border-color: #000;
}

.template-minimal-label {
    transition: all 0.3s ease;
}

.template-minimal-label.active {
    transform: translateY(-5px);
    font-size: 12px;
    color: #000;
}

.template-minimal-input:focus {
    border-color: #000;
    outline: none;
}

.template-minimal-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    color: #000000;
    text-decoration: none;
    text-transform: uppercase;
    transition: 0.5s;
    letter-spacing: 4px;
    overflow: hidden;
    background: transparent;
    border: 1px solid #000000;
    cursor: pointer;
    width: 100%;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    border-radius: 4px;
    font-size: 16px;
    gap: 10px;
    z-index: 1;
}

.template-minimal-button:hover {
    background: #000000;
    color: #ffffff;
    box-shadow: 0 0 5px #000000, 0 0 25px #000000, 0 0 50px #000000, 0 0 200px #000000;
    -webkit-box-reflect: below 1px linear-gradient(transparent, #0005);
}

.template-minimal-button span {
    position: absolute;
    display: block;
    background: #000000;
}

.template-minimal-button span:nth-child(1) {
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #000000);
    animation: animate1 1.5s linear infinite;
}

@keyframes animate1 {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.template-minimal-button span:nth-child(2) {
    top: -100%;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, transparent, #000000);
    animation: animate2 1.5s linear infinite;
    animation-delay: 0.375s;
}

@keyframes animate2 {
    0% { top: -100%; }
    50%, 100% { top: 100%; }
}

.template-minimal-button span:nth-child(3) {
    bottom: 0;
    right: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(270deg, transparent, #000000);
    animation: animate3 1.5s linear infinite;
    animation-delay: 0.75s;
}

@keyframes animate3 {
    0% { right: -100%; }
    50%, 100% { right: 100%; }
}

.template-minimal-button span:nth-child(4) {
    bottom: -100%;
    left: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(0deg, transparent, #000000);
    animation: animate4 1.5s linear infinite;
    animation-delay: 1.125s;
}

@keyframes animate4 {
    0% { bottom: -100%; }
    50%, 100% { bottom: 100%; }
}

.template-minimal-button .logoIcon {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 2;
}

.template-minimal-button .button-text {
    position: relative;
    z-index: 2;
}

@keyframes borderPulse {
    0% {
        transform: scale(0.98);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.03);
        opacity: 1;
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.9);
    }
    100% {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

.template-minimal-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.template-minimal-button:active::before {
    transform: scale(0.98);
    opacity: 0.9;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Loading state */
.template-minimal-button.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.template-minimal-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    border-top-color: #000000;
    animation: spin 0.8s ease-in-out infinite;
    z-index: 2;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ======== RESPONSIVE STYLES FOR MINIMAL TEMPLATE ======== */

/* Tablet and smaller devices */
@media (max-width: 768px) {
    .template-minimal {
        padding: 20px;
        max-width: 90%;
    }
    
    .template-minimal-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .template-minimal .easy-cod-product-image-container img {
        max-height: 140px;
        border-radius: 6px;
    }
    
    .template-minimal .easy-cod-popup-form label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .template-minimal .easy-cod-popup-form input[type="text"],
    .template-minimal .easy-cod-popup-form input[type="tel"],
    .template-minimal .easy-cod-popup-form input[type="email"],
    .template-minimal .easy-cod-popup-form textarea {
        padding: 12px;
        margin-bottom: 12px;
        font-size: 16px;
        border-radius: 4px;
    }
    
    .template-minimal-button {
        padding: 14px 20px;
        font-size: 16px;
        margin-top: 10px;
    }
    
    .template-minimal .easy-cod-order-info {
        padding: 12px;
        margin-bottom: 15px;
        font-size: 14px;
    }
    
    .template-minimal .easy-cod-price-wrapper {
        margin-bottom: 15px;
    }
    
    .template-minimal-info {
        margin-bottom: 20px;
    }
}

/* Mobile devices */
@media (max-width: 480px) {
    .template-minimal {
        padding: 15px;
        max-width: 95%;
    }
    
    .template-minimal-title {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .template-minimal .easy-cod-product-image-container img {
        max-height: 120px;
    }
    
    .template-minimal .easy-cod-popup-form label {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    .template-minimal .easy-cod-popup-form input[type="text"],
    .template-minimal .easy-cod-popup-form input[type="tel"],
    .template-minimal .easy-cod-popup-form input[type="email"],
    .template-minimal .easy-cod-popup-form textarea {
        padding: 10px;
        margin-bottom: 10px;
        font-size: 15px;
    }
    
    .template-minimal-button {
        height: 42px;
        font-size: 14px;
        padding: 8px 14px;
    }
    
    .template-minimal-button .logoIcon {
        width: 16px;
        height: 16px;
    }
    
    .template-minimal-info {
        margin-bottom: 15px;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .template-minimal {
        padding: 10px;
        margin: 0;
        border-radius: 0;
    }
    
    .template-minimal-title {
        font-size: 16px;
        margin-bottom: 10px;
        letter-spacing: 1px;
    }
    
    .template-minimal .easy-cod-product-image-container {
        margin-bottom: 8px;
        text-align: center;
    }
    
    .template-minimal .easy-cod-product-image-container img {
        max-height: 80px;
        max-width: 80px;
        border-radius: 4px;
    }
    
    .template-minimal .easy-cod-popup-form label {
        font-size: 12px;
        margin-bottom: 3px;
        font-weight: 500;
    }
    
    .template-minimal .easy-cod-popup-form input[type="text"],
    .template-minimal .easy-cod-popup-form input[type="tel"],
    .template-minimal .easy-cod-popup-form input[type="email"],
    .template-minimal .easy-cod-popup-form textarea {
        padding: 8px 6px;
        margin-bottom: 6px;
        font-size: 14px;
        border-radius: 3px;
        line-height: 1.2;
    }
    
    .template-minimal .easy-cod-popup-form textarea {
        min-height: 60px;
        resize: vertical;
    }
    
    .template-minimal-button {
        height: 40px;
        font-size: 14px;
        padding: 8px 12px;
        margin-top: 6px;
    }
    
    .template-minimal-button .logoIcon {
        width: 14px;
        height: 14px;
    }
    
    .template-minimal .easy-cod-order-info {
        padding: 6px;
        margin-bottom: 8px;
        font-size: 11px;
        line-height: 1.3;
        border-radius: 3px;
    }
    
    .template-minimal .easy-cod-price-wrapper {
        margin-bottom: 8px;
        font-size: 14px;
    }
    
    .template-minimal-info {
        margin-bottom: 10px;
        font-size: 12px;
    }
}

/* Extra small LCD phones (less than 280px) */
@media (max-width: 280px) {
    .template-minimal {
        padding: 8px;
    }
    
    .template-minimal-title {
        font-size: 14px;
        margin-bottom: 8px;
        letter-spacing: 0.5px;
    }
    
    .template-minimal .easy-cod-product-image-container img {
        max-height: 70px;
        max-width: 70px;
    }
    
    .template-minimal .easy-cod-popup-form label {
        font-size: 11px;
        margin-bottom: 2px;
    }
    
    .template-minimal .easy-cod-popup-form input[type="text"],
    .template-minimal .easy-cod-popup-form input[type="tel"],
    .template-minimal .easy-cod-popup-form input[type="email"],
    .template-minimal .easy-cod-popup-form textarea {
        padding: 6px 5px;
        margin-bottom: 5px;
        font-size: 13px;
    }
    
    .template-minimal-button {
        height: 38px;
        font-size: 13px;
        padding: 6px 10px;
        margin-top: 5px;
    }
    
    .template-minimal-button .logoIcon {
        width: 12px;
        height: 12px;
    }
    
    .template-minimal .easy-cod-price-wrapper {
        font-size: 13px;
    }
}

/* ======== TEMPLATE MODERNE - VARIANTS ======== */

/* Variant 1: Slide Up */
.template-modern.slide-up {
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* Variant 2: Fade In with Scale */
.template-modern.fade-scale {
    animation: fadeInScale 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Variant 3: Bounce In */
.template-modern.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Variant 4: Flip In */
.template-modern.flip-in {
    perspective: 1000px;
    animation: flipIn 0.8s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    transform-origin: 50% 50%;
}

/* ======== ANIMATIONS SUPPLÉMENTAIRES ======== */
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); opacity: 1; }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

@keyframes flipIn {
    from { transform: perspective(1000px) rotateY(90deg); opacity: 0; }
    to { transform: perspective(1000px) rotateY(0); opacity: 1; }
}

/* ======== EFFETS DE BOUTONS ======== */
/* Effet 1: Remplissage */
.btn-fill {
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: color 0.3s ease;
}

.btn-fill:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: rgba(255,255,255,0.2);
    transition: width 0.3s ease;
    z-index: -1;
}

.btn-fill:hover:before {
    width: 100%;
}

/* Effet 2: Pulsation */
.btn-pulse {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-pulse:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease, opacity 0.6s ease;
    opacity: 0;
    z-index: -1;
}

.btn-pulse:hover:after {
    width: 300px;
    height: 300px;
    opacity: 1;
}

/* Effet 3: Soulignement */
.btn-underline {
    position: relative;
    overflow: hidden;
}

.btn-underline:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.btn-underline:hover:after {
    width: 80%;
}

/* Enhanced Modern Template animations */
.template-modern.bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.template-modern.slide-in-bottom {
    animation: slideInFromBottom 0.5s ease-out;
}

.template-modern.fade-scale {
    animation: fadeInScale 0.4s ease-out;
}

/* Shimmer loading effect */
.template-modern-image.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Enhanced button effects */
.template-modern-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.template-modern-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.6s, height 0.6s;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.template-modern-button:active::before {
    width: 300px;
    height: 300px;
}

.template-modern-button span {
    position: relative;
    z-index: 1;
}

/* Floating animation for images */
.template-modern-image.floating {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Gradient text effect */
.template-modern-title.gradient-text {
    background: linear-gradient(45deg, #3498db, #9b59b6, #e74c3c);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Enhanced input focus effects */
.template-modern-input {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.template-modern-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.15);
}

/* Micro-interactions */
.template-modern-field {
    transition: transform 0.2s ease;
}

.template-modern-field:hover {
    transform: translateX(5px);
}

/* Extra small devices */
@media (max-width: 480px) {
    .easy-cod-popup-container {
        width: 98vw;
        margin: 5px;
        padding: 15px 12px;
        border-radius: 12px;
    }
    
    .template-modern {
        padding: 15px 10px;
    }
    
    .template-modern-title {
        font-size: 18px;
    }
    
    .template-modern-product-title {
        font-size: 16px;
    }
    
    .template-modern-input {
        padding: 12px 14px;
        font-size: 16px;
    }
    
    .template-modern-button {
        padding: 14px 18px;
        font-size: 15px;
    }
}

/* Landscape orientation optimizations */
@media (max-height: 600px) and (orientation: landscape) {
    .easy-cod-popup-container {
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .template-modern-image img {
        max-height: 100px;
    }
    
    .template-modern-info {
        padding: 10px;
        margin-bottom: 15px;
    }
}

/* ======== TOUCH AND ACCESSIBILITY ENHANCEMENTS ======== */

/* Touch-friendly spacing */
@media (max-width: 768px) {
    .template-modern-field {
        margin-bottom: 20px;
    }
    
    .template-modern-input {
        min-height: 48px; /* iOS accessibility guidelines */
        -webkit-tap-highlight-color: rgba(52, 152, 219, 0.3);
    }
    
    .template-modern-button {
        min-height: 48px;
        -webkit-tap-highlight-color: rgba(52, 152, 219, 0.3);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .template-modern {
        border: 2px solid;
    }
    
    .template-modern-input {
        border-width: 2px;
    }
    
    .template-modern-button {
        border: 2px solid;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .template-modern {
        background: linear-gradient(to bottom, #2c3e50, #34495e);
        color: #ecf0f1;
    }
    
    .template-modern-title {
        color: #3498db;
    }
    
    .template-modern-input {
        background: #34495e;
        border-color: #4a6741;
        color: #ecf0f1;
    }
    
    .template-modern-info {
        background-color: #34495e;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .template-modern *,
    .template-modern *::before,
    .template-modern *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ======== ENHANCED MOBILE OPTIMIZATIONS FOR SMALL LCD PHONES ======== */

/* Very small LCD phones (240px - 320px) */
@media (max-width: 320px) {
    .template-default {
        padding: 6px;
        margin: 0;
    }
    
    .template-default-title {
        font-size: 14px;
        margin-bottom: 8px;
        padding-bottom: 4px;
        line-height: 1.2;
    }
    
    .template-default .easy-cod-product-image-container {
        margin-bottom: 8px;
        text-align: center;
    }
    
    .template-default .easy-cod-product-image-container img {
        max-height: 80px;
        max-width: 80px;
        border-radius: 4px;
    }
    
    .template-default .easy-cod-popup-form label {
        font-size: 12px;
        margin-bottom: 3px;
        font-weight: 500;
    }
    
    .template-default .easy-cod-popup-form input[type="text"],
    .template-default .easy-cod-popup-form input[type="tel"],
    .template-default .easy-cod-popup-form input[type="email"],
    .template-default .easy-cod-popup-form textarea {
        padding: 8px 6px;
        margin-bottom: 6px;
        font-size: 14px;
        border-radius: 4px;
        line-height: 1.2;
    }
    
    .template-default .easy-cod-popup-form textarea {
        min-height: 60px;
        resize: vertical;
    }
    
    .template-default-button {
        padding: 10px 12px;
        font-size: 14px;
        margin-top: 6px;
        border-radius: 4px;
        font-weight: 600;
    }
    
    .template-default .easy-cod-order-info {
        padding: 6px;
        margin-bottom: 8px;
        font-size: 11px;
        line-height: 1.3;
        border-radius: 4px;
    }
    
    .template-default .easy-cod-price-wrapper {
        margin-bottom: 8px;
        font-size: 14px;
    }
    
    /* Compact close button for small screens */
    .easy-cod-popup-close {
        width: 34px !important;
        height: 34px !important;
        font-size: 18px !important;
        top: 8px !important;
        right: 8px !important;
        background: #000000 !important;
        color: #ffffff !important;
        border: 2px solid #000000 !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    }
    
    .easy-cod-popup-close:hover,
    .easy-cod-popup-close:active {
        background: #000000 !important;
        transform: scale(0.95) !important;
    }
}

/* Extra small LCD phones (less than 280px) */
@media (max-width: 280px) {
    .template-default {
        padding: 4px;
    }
    
    .template-default-title {
        font-size: 13px;
        margin-bottom: 6px;
        padding-bottom: 3px;
    }
    
    .template-default .easy-cod-product-image-container img {
        max-height: 60px;
        max-width: 60px;
    }
    
    .template-default .easy-cod-popup-form label {
        font-size: 11px;
        margin-bottom: 2px;
    }
    
    .template-default .easy-cod-popup-form input[type="text"],
    .template-default .easy-cod-popup-form input[type="tel"],
    .template-default .easy-cod-popup-form input[type="email"],
    .template-default .easy-cod-popup-form textarea {
        padding: 6px 4px;
        margin-bottom: 4px;
        font-size: 13px;
    }
    
    .template-default .easy-cod-popup-form textarea {
        min-height: 50px;
    }
    
    .template-default-button {
        padding: 8px 10px;
        font-size: 13px;
        margin-top: 4px;
    }
    
    .template-default .easy-cod-order-info {
        padding: 4px;
        margin-bottom: 6px;
        font-size: 10px;
    }
    
    .template-default .easy-cod-price-wrapper {
        margin-bottom: 6px;
        font-size: 13px;
    }
}

/* Ultra compact for very small LCD screens (240px and below) */
@media (max-width: 240px) {
    .template-default {
        padding: 3px;
    }
    
    .template-default-title {
        font-size: 12px;
        margin-bottom: 4px;
        padding-bottom: 2px;
    }
    
    .template-default .easy-cod-product-image-container {
        margin-bottom: 4px;
    }
    
    .template-default .easy-cod-product-image-container img {
        max-height: 50px;
        max-width: 50px;
    }
    
    .template-default .easy-cod-popup-form label {
        font-size: 10px;
        margin-bottom: 1px;
    }
    
    .template-default .easy-cod-popup-form input[type="text"],
    .template-default .easy-cod-popup-form input[type="tel"],
    .template-default .easy-cod-popup-form input[type="email"],
    .template-default .easy-cod-popup-form textarea {
        padding: 5px 3px;
        margin-bottom: 3px;
        font-size: 12px;
    }
    
    .template-default .easy-cod-popup-form textarea {
        min-height: 40px;
    }
    
    .template-default-button {
        padding: 6px 8px;
        font-size: 12px;
        margin-top: 3px;
    }
    
    .template-default .easy-cod-order-info {
        padding: 3px;
        margin-bottom: 4px;
        font-size: 9px;
    }
    
    .template-default .easy-cod-price-wrapper {
        margin-bottom: 4px;
        font-size: 12px;
    }
    
    /* Ultra compact close button for very small screens */
    .easy-cod-popup-close {
        width: 30px !important;
        height: 30px !important;
        font-size: 16px !important;
        top: 6px !important;
        right: 6px !important;
        background: #000000 !important;
        color: #ffffff !important;
        border: 2px solid #000000 !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
        box-shadow: 0 2px 6px rgb(0, 0, 0) !important;
    }
    
    .easy-cod-popup-close:hover,
    .easy-cod-popup-close:active {
        background: #000000 !important;
        transform: scale(0.95) !important;
    }
}

/* ======== FORM VALIDATION STATES ======== */
.easy-cod-checkout-form input,
.easy-cod-checkout-form textarea,
.easy-cod-address-textarea {
    transition: all 0.3s ease;
    position: relative;
}

/* Validation colors and feedback */
.easy-cod-checkout-form input.valid,
.easy-cod-checkout-form textarea.valid,
.easy-cod-address-textarea.valid {
    border-color: #2ecc71 !important;
    background-color: rgba(46, 204, 113, 0.05);
    padding-right: 30px;
}

.easy-cod-checkout-form input.invalid,
.easy-cod-checkout-form textarea.invalid,
.easy-cod-address-textarea.invalid {
    border-color: #e74c3c !important;
    background-color: rgba(231, 76, 60, 0.05);
    padding-right: 30px;
}

/* Focus states */
.easy-cod-checkout-form input:focus.valid,
.easy-cod-checkout-form textarea:focus.valid,
.easy-cod-address-textarea:focus.valid {
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2);
}

.easy-cod-checkout-form input:focus.invalid,
.easy-cod-checkout-form textarea:focus.invalid,
.easy-cod-address-textarea:focus.invalid {
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2);
}

/* Validation icons using Dashicons */
.easy-cod-checkout-form .validation-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Dashicons';
    font-size: 18px;
    line-height: 1;
    pointer-events: none;
}

.easy-cod-checkout-form .valid + .validation-icon::after {
    content: "\f147";
    color: #2ecc71;
}

.easy-cod-checkout-form .invalid + .validation-icon::after {
    content: "\f158";
    color: #e74c3c;
}

/* Field error messages */
.easy-cod-checkout-form .field-error {
    display: none;
    font-size: 13px;
    color: #e74c3c;
    margin-top: 5px;
    padding: 5px 10px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 3px;
    animation: fadeIn 0.3s ease;
}

.easy-cod-checkout-form input.invalid ~ .field-error,
.easy-cod-checkout-form textarea.invalid ~ .field-error {
    display: block;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .easy-cod-checkout-form .validation-icon {
        right: 8px;
        font-size: 16px;
    }
    
    .easy-cod-checkout-form .field-error {
        font-size: 12px;
    }
}
