/* Add to Cart Widget Styles */

/* High specificity overrides to ensure styles apply */
.elementor-widget-add_to_cart .mystik-add-to-cart-wrapper,
.mystik-add-to-cart-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 100%;
}

/* Remove extra padding from form elements */
.mystik-add-to-cart-wrapper .mystik-cart-form {
    margin: 0;
    padding: 0;
}

.mystik-add-to-cart-wrapper .mystik-cart-form > * {
    margin-bottom: 0;
}

/* Product Price */
.mystik-product-price {
    font-size: 24px;
    font-weight: 600;
    color: #333333;
    margin: 0 0 10px 0;
    padding: 0;
}

.mystik-product-price .price {
    color: #333333;
    display: inline-block;
    margin: 0;
    padding: 0;
}

.mystik-product-price .price del {
    color: #999999;
    font-weight: 400;
    margin-right: 10px;
}

.mystik-product-price .price ins {
    text-decoration: none;
    color: #e74c3c;
    font-weight: 600;
}

/* Variations Wrapper */
.mystik-variations-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 15px 0;
    padding: 0;
}

.mystik-variation-select {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mystik-variation-select label {
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    margin: 0;
    padding: 0;
}

.mystik-variation-select-field {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: #ffffff;
    color: #333333;
    transition: border-color 0.3s ease;
    margin: 0;
}

.mystik-variation-select-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Quantity Wrapper */
.mystik-quantity-wrapper {
    display: flex;
    align-items: center;
    margin: 0 0 15px 0;
    padding: 0;
}

.mystik-quantity-input {
    width: 80px;
    height: 45px;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    text-align: center;
    transition: border-color 0.3s ease;
    background: #ffffff;
    color: #333333;
    margin: 0;
}

.mystik-quantity-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Add to Cart Button */
.mystik-add-to-cart-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 15px 30px !important;
    background: #ad8330 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    min-height: 50px !important;
    text-align: center !important;
    line-height: 1.4 !important;
    font-family: inherit !important;
    margin: 0 !important;
    gap: 0 !important; /* Remove default gap, use specific spacing */
    box-shadow: 0 2px 8px rgba(173, 131, 48, 0.3) !important;
}

.mystik-add-to-cart-button:hover {
    background: #965a1f !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(173, 131, 48, 0.4) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.mystik-add-to-cart-button:active {
    transform: translateY(0) !important;
    box-shadow: 0 4px 15px rgba(173, 131, 48, 0.3) !important;
}

.mystik-add-to-cart-button:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(173, 131, 48, 0.3) !important;
}

/* Button Icon Styling */
.mystik-add-to-cart-button .icon-left,
.mystik-add-to-cart-button .icon-right {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    transition: all 0.3s ease !important;
}

.mystik-add-to-cart-button .icon-left {
    margin-right: 8px !important;
    margin-left: 0 !important;
}

.mystik-add-to-cart-button .icon-right {
    margin-left: 8px !important;
    margin-right: 0 !important;
}

.mystik-add-to-cart-button .button-text {
    display: inline-block !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Icon specific styling */
.mystik-add-to-cart-button i,
.mystik-add-to-cart-button svg {
    transition: all 0.3s ease !important;
    vertical-align: middle !important;
    line-height: 1 !important;
}

.mystik-add-to-cart-button svg {
    max-width: none !important;
    max-height: none !important;
}

/* Loading State */
.mystik-add-to-cart-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.mystik-add-to-cart-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Success State */
.mystik-add-to-cart-button.added {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.mystik-add-to-cart-button.added:hover {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

/* Disabled State */
.mystik-add-to-cart-button:disabled,
.mystik-add-to-cart-button.disabled {
    background: #cccccc;
    color: #666666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.mystik-add-to-cart-button:disabled:hover,
.mystik-add-to-cart-button.disabled:hover {
    background: #cccccc;
    transform: none;
    box-shadow: none;
}

/* Override WooCommerce default styles */
.mystik-add-to-cart-wrapper .cart .button,
.mystik-add-to-cart-wrapper .single_add_to_cart_button,
.mystik-add-to-cart-wrapper button[type="submit"],
.mystik-add-to-cart-wrapper input[type="submit"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 15px 30px !important;
    background: #ad8330 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    min-height: 50px !important;
    text-align: center !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    box-shadow: 0 2px 8px rgba(173, 131, 48, 0.3) !important;
}

.mystik-add-to-cart-wrapper .cart .button:hover,
.mystik-add-to-cart-wrapper .single_add_to_cart_button:hover,
.mystik-add-to-cart-wrapper button[type="submit"]:hover,
.mystik-add-to-cart-wrapper input[type="submit"]:hover {
    background: #965a1f !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(173, 131, 48, 0.4) !important;
}

.mystik-add-to-cart-wrapper .cart .qty {
    margin: 0 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mystik-add-to-cart-wrapper {
        gap: 12px;
    }
    
    .mystik-add-to-cart-button {
        padding: 12px 25px;
        font-size: 15px;
        min-height: 45px;
    }
    
    .mystik-product-price {
        font-size: 20px;
    }
    
    .mystik-quantity-input {
        width: 70px;
        height: 40px;
        font-size: 14px;
    }
    
    .mystik-variations-wrapper {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .mystik-add-to-cart-button {
        padding: 10px 20px;
        font-size: 14px;
        min-height: 40px;
        width: 100%;
    }
    
    .mystik-quantity-wrapper {
        justify-content: center;
    }
    
    .mystik-variations-wrapper {
        gap: 6px;
    }
}

/* WooCommerce Integration */
.woocommerce .mystik-add-to-cart-wrapper .cart {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0;
    padding: 0;
}

.woocommerce .mystik-add-to-cart-wrapper .cart .mystik-quantity-wrapper {
    margin-bottom: 0;
}

/* Remove default WooCommerce margins and paddings */
.mystik-add-to-cart-wrapper .woocommerce-message,
.mystik-add-to-cart-wrapper .woocommerce-error,
.mystik-add-to-cart-wrapper .woocommerce-info {
    margin: 10px 0 0 0;
    padding: 10px 15px;
}

/* Success Message */
.mystik-add-to-cart-message {
    padding: 10px 15px;
    margin: 10px 0 0 0;
    border-radius: 5px;
    font-size: 14px;
    text-align: center;
}

.mystik-add-to-cart-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mystik-add-to-cart-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Animation Classes */
.mystik-add-to-cart-button.animate-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.mystik-add-to-cart-button.animate-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .mystik-add-to-cart-wrapper {
        gap: 12px;
    }
    
    .mystik-add-to-cart-button {
        padding: 12px 25px;
        font-size: 15px;
        min-height: 45px;
    }
    
    .mystik-product-price {
        font-size: 20px;
    }
    
    .mystik-quantity-input {
        width: 70px;
        height: 40px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .mystik-add-to-cart-button {
        padding: 10px 20px;
        font-size: 14px;
        min-height: 40px;
        width: 100%;
    }
    
    .mystik-quantity-wrapper {
        justify-content: center;
    }
}

/* WooCommerce Integration */
.woocommerce .mystik-add-to-cart-wrapper .cart {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.woocommerce .mystik-add-to-cart-wrapper .cart .mystik-quantity-wrapper {
    margin-bottom: 0;
}

/* Variations Support */
.mystik-add-to-cart-wrapper .variations {
    margin-bottom: 20px;
}

.mystik-add-to-cart-wrapper .variations td {
    padding: 5px 0;
}

.mystik-add-to-cart-wrapper .variations select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: #ffffff;
    color: #333333;
    font-size: 14px;
    width: 100%;
    transition: border-color 0.3s ease;
}

.mystik-add-to-cart-wrapper .variations select:focus {
    outline: none;
    border-color: #667eea;
}

/* Custom Styles for Different Button Styles */
.mystik-add-to-cart-button.style-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.mystik-add-to-cart-button.style-outline:hover {
    background: #667eea;
    color: #ffffff;
}

.mystik-add-to-cart-button.style-minimal {
    background: #f8f9fa;
    color: #333333;
    border: 1px solid #dee2e6;
}

.mystik-add-to-cart-button.style-minimal:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.mystik-add-to-cart-button.style-dark {
    background: #333333;
    color: #ffffff;
}

.mystik-add-to-cart-button.style-dark:hover {
    background: #222222;
}

/* Success Message */
.mystik-add-to-cart-message {
    padding: 10px 15px;
    margin-top: 10px;
    border-radius: 5px;
    font-size: 14px;
    text-align: center;
}

.mystik-add-to-cart-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mystik-add-to-cart-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
