﻿/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* HIDE OLD */
.acs-new-checkout-wrapper,
.acs-final-wrapper,
.acs-clean-wrapper,
.acs-pro-wrapper,
.acs-modern-form-container {
    display: none !important;
}

/* HIDE WOOCOMMERCE DEFAULT ELEMENTS */
.single-product .price,
.single-product .single_variation_wrap .price,
.single-product .woocommerce-variation-price,
.single-product .single_add_to_cart_button,
.single-product .quantity,
.single-product .reset_variations,
.single-product div.product form.cart,
.single-product .cart,
.single-product .woocommerce-variation-add-to-cart {
    display: none !important;
}

/* HIDE CUSTOM TITLE ABOVE FORM */
.acs-product-title {
    display: none !important;
}

/* Ensure Custom Form Variations are Visible */
.single-product div.product .acs-form-wrapper form.cart,
.single-product div.product .acs-form-wrapper .variations_form,
.acs-form-wrapper form.cart,
.acs-form-wrapper .variations_form {
    display: block !important;
}

.single-product div.product .acs-form-wrapper .woocommerce-variation-add-to-cart,
.acs-form-wrapper .woocommerce-variation-add-to-cart {
    display: block !important;
}

/* Hide buttons inside custom variations if needed (we have our own submit) */
.single-product div.product .acs-form-wrapper .single_add_to_cart_button,
.acs-form-wrapper .single_add_to_cart_button {
    display: none !important;
}

/* SHOW ONLY VARIATIONS TABLE */
.single-product .variations {
    display: table !important;
    width: 100%;
    margin-bottom: 0 !important;
}

/* WRAPPER */
.acs-form-wrapper {
    width: 100%;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Cairo', Arial, sans-serif;
    direction: rtl;
}

/* TITLE */
.acs-title {
    font-size: 20px;
    font-weight: 700;
    color: #1F2937;
    text-align: center;
    margin-bottom: 20px;
}

/* CARD */
.acs-card {
    background: #FFF;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* VARIATIONS WRAPPER */
.acs-variations-wrapper {
    margin-bottom: 20px;
    padding: 16px;
    background: #F9FAFB;
    border-radius: 8px;
}

.acs-variations-wrapper .variations {
    border: none !important;
}

.acs-variations-wrapper .variations tr {
    border-bottom: 1px solid #E5E7EB;
}

.acs-variations-wrapper .variations td,
.acs-variations-wrapper .variations th {
    padding: 12px 8px;
    text-align: right;
}

.acs-variations-wrapper .variations label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.acs-variations-wrapper .variations select {
    width: 100%;
    padding: 10px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-size: 14px;
    background: #FFF;
}

/* ROW */
.acs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 6px;
}

.acs-row>div {
    margin-bottom: 0 !important;
}

/* FIELD */
.acs-field,
.acs-field-half {
    position: relative;
    margin-bottom: 6px;
}

.acs-field-half {
    width: calc(50% - 6px);
    display: inline-block;
}

/* ICON ON LEFT */
.acs-icon-left {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    z-index: 10;
    pointer-events: none;
}

/* INPUT - TEXT ON RIGHT */
.acs-input {
    width: 100%;
    padding: 14px 14px 14px 46px;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    direction: rtl;
}

.acs-dark {
    background: #3F4A5C;
    border: none;
    color: #FFF;
}

.acs-dark::placeholder {
    color: rgba(255, 255, 255, 0.95) !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

.acs-light {
    background: #FFF;
    border: 1px solid #E5E7EB;
    color: #1F2937;
}

.acs-light::placeholder {
    color: rgba(31, 41, 55, 0.75) !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

.acs-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* DELIVERY TYPE */
.acs-delivery-type {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 6px;
}

.acs-radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #FFF;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.acs-radio-label:hover {
    border-color: #3B82F6;
}

.acs-radio-label input[type="radio"] {
    display: none;
}

.acs-radio-label input[type="radio"]:checked+span,
.acs-radio-label:has(input[type="radio"]:checked) {
    background: #EFF6FF;
    border-color: #3B82F6;
    color: #1E40AF;
}

/* ACTIONS */
.acs-actions {
    display: flex;
    gap: 10px;
    margin: 6px 0;
}

/* BUTTONS */
.acs-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.acs-purple {
    flex: 1;
    background: #0EA5E9;
    color: #FFF;
}

.acs-purple:hover {
    background: #0284C7;
}

.acs-green {
    background: #0EA5E9;
    color: #FFF;
    margin-bottom: 6px;
}

.acs-green:hover {
    background: #0284C7;
}

/* QTY */
.acs-qty {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    overflow: hidden;
    background: #FFF;
}

.acs-qty-btn {
    width: 44px;
    height: 48px;
    border: none;
    background: #0EA5E9;
    color: #FFF;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.acs-qty-btn:hover {
    background: #0284C7;
}

.acs-qty input {
    width: 60px;
    height: 48px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    background: #FFF;
}

/* PAYMENT SECTION */
.acs-payment-section {
    display: flex;
    gap: 8px;
    margin: 6px 0;
}

.acs-payment-btn {
    flex: 1;
    padding: 14px 20px;
    background: #FFF;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: #4B5563;
    transition: all 0.2s;
    text-align: center;
}

.acs-payment-btn:hover {
    border-color: #0EA5E9;
}

.acs-payment-btn.active {
    background: #0EA5E9;
    border-color: #0EA5E9;
    color: #FFF;
}

/* CHARGILY PANEL */
.acs-chargily-panel {
    background: #F0FDF4;
    border: 2px solid #86EFAC;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 6px;
}

.acs-chargily-notice {
    text-align: center;
    font-size: 13px;
    color: #166534;
    margin-bottom: 14px;
    font-weight: 600;
}

.acs-chargily-method {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #FFF;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.acs-chargily-method:hover {
    background: #F0FDF4;
}

.acs-chargily-method.active {
    background: #DCFCE7;
    border: 1px solid #86EFAC;
}

.acs-method-icon {
    font-size: 24px;
}

.acs-method-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #1F2937;
}

.acs-method-check {
    font-size: 18px;
    color: #10B981;
}

.acs-chargily-footer {
    text-align: center;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #86EFAC;
    font-size: 12px;
    color: #166534;
}

/* SUMMARY */
.acs-summary {
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
}

.acs-summary-head {
    padding: 14px 18px;
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.acs-summary-head:hover {
    background: #F3F4F6;
}

.acs-toggle-icon {
    transition: transform 0.3s;
    font-size: 12px;
}

.acs-toggle-icon.rotated {
    transform: rotate(-180deg);
}

.acs-summary-body {
    padding: 16px 18px;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.acs-summary-body.collapsed {
    max-height: 0;
    padding: 0 18px;
}

.acs-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dotted #E5E7EB;
    font-size: 14px;
}

.acs-summary-row:last-child {
    border: none;
}

.acs-total {
    margin-top: 8px;
    padding-top: 14px !important;
    border-top: 2px solid #0EA5E9 !important;
    font-weight: 700;
    font-size: 17px;
    color: #0EA5E9;
}

/* MSG */
.acs-msg {
    margin-top: 16px;
    padding: 14px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: none;
}

.acs-msg.success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #34D399;
}

.acs-msg.error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #F87171;
}

/* MOBILE */
@media (max-width: 640px) {
    .acs-form-wrapper {
        padding: 10px !important;
        width: 100% !important;
    }

    .acs-card {
        padding: 15px !important;
        width: 100% !important;
        min-width: 0 !important;
    }
    
    .acs-row {
        grid-template-columns: 1fr !important;
        display: block !important;
    }

    .acs-field-half {
        width: 100% !important;
        display: block !important;
        float: none !important;
    }

    .acs-actions {
        flex-direction: column;
    }

    .acs-payment-section {
        flex-direction: column;
    }

    .acs-delivery-type {
        grid-template-columns: 1fr;
    }

    /* Prevent iOS zoom */
    .acs-input, 
    .acs-btn,
    select {
        font-size: 16px !important; 
    }
    
    .acs-logo img {
        max-width: 150px !important;
    }
}

/* SMART SWATCHES */
/* SMART SWATCHES */
.acs-swatch-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.acs-swatch-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: #FFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #4B5563;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.acs-swatch-option:hover {
    border-color: #9CA3AF;
    background: #FFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.acs-swatch-option.selected {
    background: #0EA5E9;
    border-color: #0EA5E9;
    color: #FFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.acs-swatch-option.disabled {
    opacity: 0.5;
    background: #F3F4F6;
    color: #D1D5DB;
    cursor: not-allowed;
    border-color: #F3F4F6;
    box-shadow: none;
    transform: none !important;
}

/* SHAPES */
.acs-shape-square .acs-swatch-option {
    border-radius: 4px;
}

.acs-shape-rounded .acs-swatch-option {
    border-radius: 8px;
}

.acs-shape-circle .acs-swatch-option {
    border-radius: 50px;
}

/* SIZES - Button Type */
.acs-size-small .acs-swatch-option {
    padding: 6px 14px;
    font-size: 13px;
}

.acs-size-medium .acs-swatch-option {
    padding: 10px 20px;
    font-size: 14px;
}

.acs-size-large .acs-swatch-option {
    padding: 14px 28px;
    font-size: 16px;
}

/* COLOR & IMAGE TYPES - Premium Look */
.acs-swatch-color,
.acs-swatch-image {
    padding: 2px !important;
    /* Minimal padding for border effect */
    border: 1px solid #E5E7EB;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.acs-swatch-color:hover,
.acs-swatch-image:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #D1D5DB;
    z-index: 10;
}

.acs-color-blob {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    /* Inner shadow for depth */
}

.acs-swatch-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

/* Sizes for Color/Image */
.acs-size-small .acs-swatch-color,
.acs-size-small .acs-swatch-image {
    width: 32px;
    height: 32px;
}

.acs-size-medium .acs-swatch-color,
.acs-size-medium .acs-swatch-image {
    width: 42px;
    height: 42px;
}

.acs-size-large .acs-swatch-color,
.acs-size-large .acs-swatch-image {
    width: 52px;
    height: 52px;
}

/* SELECTED STATE - Ring Effect */
.acs-swatch-color.selected,
.acs-swatch-image.selected {
    border-color: transparent;
    transform: scale(1.05);
    /* Ring Effect: 2px white gap, 3px primary color ring */
    box-shadow: 0 0 0 2px #fff, 0 0 0 5px #0EA5E9, 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* TOOLTIPS for Non-Text Swatches */
.acs-tooltip-target {
    position: relative;
}

.acs-tooltip-target::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #1F2937;
    color: #FFF;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

.acs-tooltip-target::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    border: 6px solid transparent;
    border-top-color: #1F2937;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    z-index: 20;
}

.acs-tooltip-target:hover::after,
.acs-tooltip-target:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-12px);
    /* Lift up slightly */
}

.acs-tooltip-target:hover::before {
    transform: translateX(-50%) translateY(-6px);
}

/* ERROR FEEDBACK: SHAKE */
@keyframes acsShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.acs-shake-error {
    animation: acsShake 0.5s cubic-bezier(.36,.07,.19,.97) both !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4) !important;
}