/**
 * NFP Add to Cart Widget Styles
 *
 * @package NFP_Product_Page
 * @since 1.0.0
 */

/* Main Container */
.nfp-add-to-cart-widget {
    margin: 0;
    padding: 0;
    width: 100%;
}

.nfp-add-to-cart-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
}

/* Layout variants */
.nfp-add-to-cart-layout-inline .nfp-add-to-cart-controls {
    flex-direction: row;
    align-items: center;
}

.nfp-add-to-cart-layout-inline .nfp-quantity-control {
    flex: 0 0 auto;
}

.nfp-add-to-cart-layout-inline .nfp-add-to-cart-button {
    flex: 1 1 auto;
    margin-left: 0;
}

.nfp-add-to-cart-layout-stacked .nfp-add-to-cart-controls {
    flex-direction: column;
    align-items: stretch;
}

.nfp-add-to-cart-layout-stacked .nfp-quantity-control {
    width: 100%;
    margin-bottom: 8px;
}

.nfp-add-to-cart-layout-stacked .nfp-add-to-cart-button {
    width: 100%;
}

/* Add to Cart Controls */
.nfp-add-to-cart-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

/* Quantity Controls */
.nfp-quantity-control {
    display: flex;
    align-items: center;
    border: none;
    border-radius: 0;
    overflow: hidden;
    height: 100%;
    box-shadow: none;
}

.nfp-quantity-decrease, 
.nfp-quantity-increase {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-width: 24px;
    width: 30px;
    min-height: 31px;
    height: 100%;
    border: 1px solid #000 !important;
    background-color: #000;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    font-weight: 400;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    text-align: center;
}

/* Ensure the symbols are perfectly centered */
.nfp-quantity-decrease::before,
.nfp-quantity-increase::before {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.nfp-quantity-decrease:hover, 
.nfp-quantity-increase:hover {
    background-color: #333;
}

.nfp-quantity-input {
    height: 32px !important;
    text-align: center;
    font-size: 14px;
    width: 45px;
    padding: 2px 5px !important;
    border: 1px solid #000 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-radius: 0 !important;
    -moz-appearance: textfield;
    background-color: #fff;
    margin: 0 !important;
    box-shadow: none !important;
}

.nfp-quantity-input::-webkit-inner-spin-button,
.nfp-quantity-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.nfp-quantity-input:focus {
    outline: none;
    box-shadow: none !important;
}

/* Add to Cart Button */
.nfp-add-to-cart-button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #C50F0F;
    color: #ffffff;
    border: none;
    border-radius: 0;
    font-size: 14px;
    font-weight: 500;
    padding: 0 15px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 32px;
    width: 100%;
}
.nfp-add-to-cart-button:hover {
    background-color: #b00d0d;
}

.nfp-add-to-cart-button.disabled {
    background-color: #c9c9c9;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Loading Animation */
.nfp-add-to-cart-button.loading {
    position: relative;
    color: transparent;
}

.nfp-add-to-cart-button.loading:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #ffffff;
    animation: nfp-spin 0.8s linear infinite;
}

/* Added to cart animation */
.nfp-add-to-cart-button.added {
    background-color: #10c410;
}

/* Hover animation support */
.elementor-animation-grow {
    transition-duration: 0.3s;
    transition-property: transform;
}

.elementor-animation-grow:hover {
    transform: scale(1.1);
}

.elementor-animation-shrink {
    transition-duration: 0.3s;
    transition-property: transform;
}

.elementor-animation-shrink:hover {
    transform: scale(0.9);
}

.elementor-animation-pulse {
    transition-property: transform;
}

.elementor-animation-pulse:hover {
    animation-name: elementor-animation-pulse;
    animation-duration: 1s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes elementor-animation-pulse {
    25% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(0.9);
    }
}

/* Animation keyframes */
@keyframes nfp-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    .nfp-add-to-cart-controls {
        gap: 8px;
    }
    
    /* Override for inline layout on mobile */
    .nfp-add-to-cart-layout-inline .nfp-add-to-cart-controls {
        flex-direction: row;
    }
    
    .nfp-add-to-cart-layout-inline .nfp-quantity-control {
        width: auto;
        margin-bottom: 0;
    }
    
    .nfp-quantity-input {
        flex: 0 0 40px;
        width: 40px;
    }
}

/* For smaller mobile screens */
@media (max-width: 480px) {
    .nfp-add-to-cart-button {
        padding: 0 15px;
    }
    
    .nfp-quantity-control {
        width: auto;
        display: flex;
    }
    
    .nfp-quantity-decrease, 
    .nfp-quantity-increase {
        flex: 0 0 30px;
        min-height: 30px;
    }
    
    .nfp-quantity-input {
        flex: 0 0 40px;
        height: 30px !important;
    }
} 