/**
 * SE-Builder Add to Cart Widget Styles
 */

/* Widget Container */
.se-add-to-cart {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Quantity Selector */
.se-atc-quantity {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

.se-atc-qty-minus,
.se-atc-qty-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #4b5563;
}

.se-atc-qty-minus:hover,
.se-atc-qty-plus:hover {
    background: #e5e7eb;
}

.se-atc-qty-minus:active,
.se-atc-qty-plus:active {
    background: #d1d5db;
}

.se-atc-qty-input {
    width: 3rem;
    text-align: center;
    border: none;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    background: white;
    -moz-appearance: textfield;
}

.se-atc-qty-input::-webkit-outer-spin-button,
.se-atc-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.se-atc-qty-input:focus {
    outline: none;
}

/* Hide quantity selector when configured */
.se-add-to-cart[data-show-quantity="false"] .se-atc-quantity {
    display: none;
}

/* Add to Cart Button */
.se-atc-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Button Style Variants - Data Attribute (backwards compatible) */
.se-add-to-cart[data-button-style="primary"] .se-atc-button,
.se-atc-button.se-atc-primary {
    background: var(--color-primary, #3b82f6);
    color: white;
}

.se-add-to-cart[data-button-style="primary"] .se-atc-button:hover,
.se-atc-button.se-atc-primary:hover {
    background: var(--color-primary-dark, #2563eb);
}

.se-add-to-cart[data-button-style="secondary"] .se-atc-button,
.se-atc-button.se-atc-secondary {
    background: #6b7280;
    color: white;
}

.se-add-to-cart[data-button-style="secondary"] .se-atc-button:hover,
.se-atc-button.se-atc-secondary:hover {
    background: #4b5563;
}

.se-add-to-cart[data-button-style="success"] .se-atc-button,
.se-atc-button.se-atc-success-style {
    background: #10b981;
    color: white;
}

.se-add-to-cart[data-button-style="success"] .se-atc-button:hover,
.se-atc-button.se-atc-success-style:hover {
    background: #059669;
}

.se-add-to-cart[data-button-style="danger"] .se-atc-button,
.se-atc-button.se-atc-danger {
    background: #ef4444;
    color: white;
}

.se-add-to-cart[data-button-style="danger"] .se-atc-button:hover,
.se-atc-button.se-atc-danger:hover {
    background: #dc2626;
}

.se-add-to-cart[data-button-style="warning"] .se-atc-button,
.se-atc-button.se-atc-warning {
    background: #f59e0b;
    color: white;
}

.se-add-to-cart[data-button-style="warning"] .se-atc-button:hover,
.se-atc-button.se-atc-warning:hover {
    background: #d97706;
}

.se-add-to-cart[data-button-style="dark"] .se-atc-button,
.se-atc-button.se-atc-dark {
    background: #1f2937;
    color: white;
}

.se-add-to-cart[data-button-style="dark"] .se-atc-button:hover,
.se-atc-button.se-atc-dark:hover {
    background: #111827;
}

.se-add-to-cart[data-button-style="outline"] .se-atc-button,
.se-atc-button.se-atc-outline {
    background: transparent;
    color: var(--color-primary, #3b82f6);
    border: 2px solid var(--color-primary, #3b82f6);
}

.se-add-to-cart[data-button-style="outline"] .se-atc-button:hover,
.se-atc-button.se-atc-outline:hover {
    background: var(--color-primary, #3b82f6);
    color: white;
}

.se-add-to-cart[data-button-style="ghost"] .se-atc-button,
.se-atc-button.se-atc-ghost {
    background: transparent;
    color: #1f2937;
}

.se-add-to-cart[data-button-style="ghost"] .se-atc-button:hover,
.se-atc-button.se-atc-ghost:hover {
    background: #f3f4f6;
}

/* Button Size Variants */
.se-add-to-cart[data-button-size="sm"] .se-atc-button,
.se-atc-button.se-atc-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.se-add-to-cart[data-button-size="lg"] .se-atc-button,
.se-atc-button.se-atc-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Button Shape Variants */
.se-add-to-cart[data-button-shape="square"] .se-atc-button,
.se-atc-button.se-atc-square {
    border-radius: 0;
}

.se-add-to-cart[data-button-shape="pill"] .se-atc-button,
.se-atc-button.se-atc-pill {
    border-radius: 9999px;
}

/* Button States */
.se-atc-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.se-atc-button.se-atc-success {
    background: #10b981 !important;
    color: white !important;
    border-color: #10b981 !important;
}

/* Icon and Spinner */
.se-atc-icon,
.se-atc-spinner {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.se-atc-spinner {
    animation: se-atc-spin 1s linear infinite;
}

@keyframes se-atc-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Message Toast */
.se-atc-message {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    margin-bottom: 0.5rem;
    animation: se-atc-fade-in 0.2s ease;
    z-index: 10;
}

.se-atc-message-success {
    background: #10b981;
    color: white;
}

.se-atc-message-error {
    background: #ef4444;
    color: white;
}

@keyframes se-atc-fade-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(0.5rem);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .se-add-to-cart {
        flex-direction: column;
        align-items: stretch;
    }
    
    .se-atc-quantity {
        justify-content: center;
    }
    
    .se-atc-button {
        width: 100%;
    }
}

/* ========================================
   WhatsApp Order Widget Styles
   ======================================== */

/* Widget Container */
.se-whatsapp-order {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Quantity Selector - inherit from add-to-cart */
.se-whatsapp-order .se-wa-quantity {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

.se-whatsapp-order .se-wa-qty-minus,
.se-whatsapp-order .se-wa-qty-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #4b5563;
}

.se-whatsapp-order .se-wa-qty-minus:hover,
.se-whatsapp-order .se-wa-qty-plus:hover {
    background: #e5e7eb;
}

.se-whatsapp-order .se-wa-qty-minus:active,
.se-whatsapp-order .se-wa-qty-plus:active {
    background: #d1d5db;
}

.se-whatsapp-order .se-wa-qty-input {
    width: 3rem;
    text-align: center;
    border: none;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    background: white;
    -moz-appearance: textfield;
}

.se-whatsapp-order .se-wa-qty-input::-webkit-outer-spin-button,
.se-whatsapp-order .se-wa-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.se-whatsapp-order .se-wa-qty-input:focus {
    outline: none;
}

/* Hide quantity selector when configured */
.se-whatsapp-order[data-show-quantity="false"] .se-wa-quantity {
    display: none;
}

/* WhatsApp Order Button */
.se-wa-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

/* WhatsApp Default Style */
.se-whatsapp-order[data-button-style="whatsapp"] .se-wa-button,
.se-wa-button.se-wa-whatsapp {
    background: #25D366;
    color: white;
}

.se-whatsapp-order[data-button-style="whatsapp"] .se-wa-button:hover,
.se-wa-button.se-wa-whatsapp:hover {
    background: #128C7E;
}

/* WhatsApp Dark Style */
.se-whatsapp-order[data-button-style="whatsapp-dark"] .se-wa-button,
.se-wa-button.se-wa-whatsapp-dark {
    background: #128C7E;
    color: white;
}

.se-whatsapp-order[data-button-style="whatsapp-dark"] .se-wa-button:hover,
.se-wa-button.se-wa-whatsapp-dark:hover {
    background: #075E54;
}

/* Primary Style */
.se-whatsapp-order[data-button-style="primary"] .se-wa-button,
.se-wa-button.se-wa-primary {
    background: var(--color-primary, #3b82f6);
    color: white;
}

.se-whatsapp-order[data-button-style="primary"] .se-wa-button:hover,
.se-wa-button.se-wa-primary:hover {
    background: var(--color-primary-dark, #2563eb);
}

/* Success Style */
.se-whatsapp-order[data-button-style="success"] .se-wa-button,
.se-wa-button.se-wa-success {
    background: #10b981;
    color: white;
}

.se-whatsapp-order[data-button-style="success"] .se-wa-button:hover,
.se-wa-button.se-wa-success:hover {
    background: #059669;
}

/* Dark Style */
.se-whatsapp-order[data-button-style="dark"] .se-wa-button,
.se-wa-button.se-wa-dark {
    background: #1f2937;
    color: white;
}

.se-whatsapp-order[data-button-style="dark"] .se-wa-button:hover,
.se-wa-button.se-wa-dark:hover {
    background: #111827;
}

/* Outline Style */
.se-whatsapp-order[data-button-style="outline"] .se-wa-button,
.se-wa-button.se-wa-outline {
    background: transparent;
    color: #25D366;
    border: 2px solid #25D366;
}

.se-whatsapp-order[data-button-style="outline"] .se-wa-button:hover,
.se-wa-button.se-wa-outline:hover {
    background: #25D366;
    color: white;
}

/* Button Size Variants */
.se-whatsapp-order[data-button-size="sm"] .se-wa-button,
.se-wa-button.se-wa-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.se-whatsapp-order[data-button-size="lg"] .se-wa-button,
.se-wa-button.se-wa-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Button Shape Variants */
.se-whatsapp-order[data-button-shape="square"] .se-wa-button,
.se-wa-button.se-wa-square {
    border-radius: 0;
}

.se-whatsapp-order[data-button-shape="pill"] .se-wa-button,
.se-wa-button.se-wa-pill {
    border-radius: 9999px;
}

/* WhatsApp Icon */
.se-wa-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* Hide icon when configured */
.se-whatsapp-order[data-show-icon="false"] .se-wa-icon {
    display: none;
}

/* ===================================
   ICON ONLY MODE
   =================================== */

/* Add to Cart Icon Only */
.se-add-to-cart[data-icon-only="true"] .se-atc-text {
    display: none;
}

.se-add-to-cart[data-icon-only="true"] .se-atc-button,
.se-atc-button.se-atc-icon-only {
    padding: 0.75rem;
    border-radius: 50%;
    width: 48px;
    height: 48px;
}

.se-add-to-cart[data-icon-only="true"][data-button-size="small"] .se-atc-button,
.se-add-to-cart[data-icon-only="true"] .se-atc-button.se-atc-sm {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
}

.se-add-to-cart[data-icon-only="true"][data-button-size="large"] .se-atc-button,
.se-add-to-cart[data-icon-only="true"] .se-atc-button.se-atc-lg {
    padding: 1rem;
    width: 56px;
    height: 56px;
}

.se-add-to-cart[data-icon-only="true"] .se-atc-button .se-atc-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* WhatsApp Order Icon Only */
.se-whatsapp-order[data-icon-only="true"] .se-wa-text {
    display: none;
}

.se-whatsapp-order[data-icon-only="true"] .se-wa-button,
.se-wa-button.se-wa-icon-only {
    padding: 0.75rem;
    border-radius: 50%;
    width: 48px;
    height: 48px;
}

.se-whatsapp-order[data-icon-only="true"][data-button-size="small"] .se-wa-button,
.se-whatsapp-order[data-icon-only="true"] .se-wa-button.se-wa-sm {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
}

.se-whatsapp-order[data-icon-only="true"][data-button-size="large"] .se-wa-button,
.se-whatsapp-order[data-icon-only="true"] .se-wa-button.se-wa-lg {
    padding: 1rem;
    width: 56px;
    height: 56px;
}

.se-whatsapp-order[data-icon-only="true"] .se-wa-button .se-wa-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Responsive */
@media (max-width: 480px) {
    .se-whatsapp-order {
        flex-direction: column;
        align-items: stretch;
    }
    
    .se-whatsapp-order .se-wa-quantity {
        justify-content: center;
    }
    
    .se-wa-button {
        width: 100%;
    }
    
    /* Keep icon-only buttons circular on mobile */
    .se-whatsapp-order[data-icon-only="true"] .se-wa-button,
    .se-add-to-cart[data-icon-only="true"] .se-atc-button {
        width: 48px;
    }
}

/* ===================================
   BUY NOW WIDGET STYLES
   =================================== */

/* Widget Container */
.se-buy-now {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Quantity Selector (hidden by default) */
.se-bn-quantity {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

.se-bn-quantity.hidden {
    display: none;
}

.se-bn-qty-minus,
.se-bn-qty-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #4b5563;
}

.se-bn-qty-minus:hover,
.se-bn-qty-plus:hover {
    background: #e5e7eb;
}

.se-bn-qty-input {
    width: 3rem;
    text-align: center;
    border: none;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    background: white;
    -moz-appearance: textfield;
}

.se-bn-qty-input::-webkit-outer-spin-button,
.se-bn-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Hide quantity selector when configured */
.se-buy-now[data-show-quantity="false"] .se-bn-quantity {
    display: none;
}

/* Buy Now Button */
.se-bn-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--color-primary, #3b82f6);
    color: white;
}

.se-bn-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.se-bn-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Button Style Variants */
.se-buy-now[data-button-style="primary"] .se-bn-button,
.se-bn-button.se-bn-primary {
    background: var(--color-primary, #3b82f6);
    color: white;
}

.se-buy-now[data-button-style="primary"] .se-bn-button:hover,
.se-bn-button.se-bn-primary:hover {
    background: var(--color-primary-dark, #2563eb);
}

.se-buy-now[data-button-style="secondary"] .se-bn-button,
.se-bn-button.se-bn-secondary {
    background: #6b7280;
    color: white;
}

.se-buy-now[data-button-style="secondary"] .se-bn-button:hover,
.se-bn-button.se-bn-secondary:hover {
    background: #4b5563;
}

.se-buy-now[data-button-style="success"] .se-bn-button,
.se-bn-button.se-bn-success {
    background: #10b981;
    color: white;
}

.se-buy-now[data-button-style="success"] .se-bn-button:hover,
.se-bn-button.se-bn-success:hover {
    background: #059669;
}

.se-buy-now[data-button-style="danger"] .se-bn-button,
.se-bn-button.se-bn-danger {
    background: #ef4444;
    color: white;
}

.se-buy-now[data-button-style="danger"] .se-bn-button:hover,
.se-bn-button.se-bn-danger:hover {
    background: #dc2626;
}

.se-buy-now[data-button-style="warning"] .se-bn-button,
.se-bn-button.se-bn-warning {
    background: #f59e0b;
    color: white;
}

.se-buy-now[data-button-style="warning"] .se-bn-button:hover,
.se-bn-button.se-bn-warning:hover {
    background: #d97706;
}

.se-buy-now[data-button-style="dark"] .se-bn-button,
.se-bn-button.se-bn-dark {
    background: #1f2937;
    color: white;
}

.se-buy-now[data-button-style="dark"] .se-bn-button:hover,
.se-bn-button.se-bn-dark:hover {
    background: #111827;
}

/* Icon Only Mode */
.se-buy-now[data-icon-only="true"] .se-bn-button {
    padding: 0.75rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.se-buy-now[data-icon-only="true"] .se-bn-button .se-bn-text {
    display: none;
}

/* Spinner */
.se-bn-spinner {
    animation: spin 1s linear infinite;
}

.se-bn-spinner.hidden {
    display: none;
}

/* Button Sizes */
.se-buy-now[data-button-size="sm"] .se-bn-button {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.se-buy-now[data-button-size="lg"] .se-bn-button {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Button Shapes */
.se-buy-now[data-button-shape="square"] .se-bn-button {
    border-radius: 0;
}

.se-buy-now[data-button-shape="rounded"] .se-bn-button {
    border-radius: 0.5rem;
}

.se-buy-now[data-button-shape="pill"] .se-bn-button {
    border-radius: 9999px;
}

/* Responsive */
@media (max-width: 480px) {
    .se-buy-now {
        flex-direction: column;
        align-items: stretch;
    }
    
    .se-buy-now .se-bn-quantity {
        justify-content: center;
    }
    
    .se-bn-button {
        width: 100%;
    }
    
    .se-buy-now[data-icon-only="true"] .se-bn-button {
        width: 48px;
    }
}