/* Add-to-Cart styles (static).
 *
 * Settings-driven values were dropped to their defaults, so this is fully static
 * and enqueued render-blocking in <head> like the other product-card stylesheets.
 * Selectors use the base classes (.atc-btn, .atc-container, .atc-count, .atc-qty,
 * .atc-decrease, .atc-increase, .atc-circle-btn), which are always present on the
 * markup alongside any suffixed classes — so a single unscoped sheet covers every
 * instance (all instances render identically now that settings are defaults).
 */

.atc-container button {
    text-transform: none;
}

.swal-custom-top-20 {
    margin-top: 50px !important;
}

.atc-login-btn {
    flex-direction: row !important;
    font-size: 14px;
    gap: 4px;
}

.atc-container {
    display: flex;
    justify-content: flex-end;
    position: relative;
    font-family: --var(--primary-font-family);
}

.atc-container.show-on-hover .atc-btn {
    width: auto !important;
    min-width: auto;
    transition: all 0.3s ease-in-out;
}

.atc-container.show-on-hover .atc-btn > div,
.atc-container.show-on-hover .atc-btn .atc-pre-icon {
    opacity: 0;
    max-width: 0;
    width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.3s ease-in-out, max-width 0.3s ease-in-out, width 0.3s ease-in-out, margin 0.3s ease-in-out, padding 0.3s ease-in-out;
    display: inline-block;
    vertical-align: middle;
}

.atc-container.show-on-hover .atc-btn .atc-post-icon {
    display: inline-flex;
}

.atc-container.show-on-hover .atc-btn:not(:hover) {
    /* !important so the collapsed (non-hover) state wins over the Elementor
       "Button Gap" control (same specificity), now that this sheet loads in
       <head> before Elementor's CSS instead of inline after it. Matches the
       sibling show-on-hover collapse rules which already use !important. */
    gap: 0 !important;
}

.atc-container.show-on-hover:hover .atc-btn > div,
.atc-container.show-on-hover:hover .atc-btn .atc-pre-icon {
    opacity: 1;
    max-width: 200px;
    width: auto;
    margin: 0;
    padding: 0;
}

/* Responsive: Disable hover effect on tablet when disabled */
@media (max-width: 1024px) and (min-width: 768px) {
    .atc-container[data-show-on-hover-tablet="no"] .atc-btn {
        width: 100% !important;
    }
    .atc-container[data-show-on-hover-tablet="no"] .atc-btn > div,
    .atc-container[data-show-on-hover-tablet="no"] .atc-btn .atc-pre-icon {
        opacity: 1 !important;
        max-width: none !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .atc-container[data-show-on-hover-tablet="no"]:hover .atc-btn > div,
    .atc-container[data-show-on-hover-tablet="no"]:hover .atc-btn .atc-pre-icon {
        opacity: 1 !important;
        max-width: none !important;
        width: auto !important;
    }
}

/* Responsive: Disable hover effect on mobile when disabled */
@media (max-width: 767px) {
    .atc-container[data-show-on-hover-mobile="no"] .atc-btn {
        width: 100% !important;
    }
    .atc-container[data-show-on-hover-mobile="no"] .atc-btn > div,
    .atc-container[data-show-on-hover-mobile="no"] .atc-btn .atc-pre-icon {
        opacity: 1 !important;
        max-width: none !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .atc-container[data-show-on-hover-mobile="no"]:hover .atc-btn > div,
    .atc-container[data-show-on-hover-mobile="no"]:hover .atc-btn .atc-pre-icon {
        opacity: 1 !important;
        max-width: none !important;
        width: auto !important;
    }
}

.atc-btn {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all .2s ease;
    padding: 6px 16px;
    color: var(--primary-text);
    position: relative;
    gap: 2px;
    background-color: var(--primary);
    border-radius: 0;
}

.atc-btn:has(.customize-text) {
    padding: 5px 20px;
    gap: 0px;
}

.atc-btn svg {
    width: 19px;
    height: 19px;
}

.atc-btn:disabled {
    opacity: .6;
}

.atc-btn.loading {
    opacity: .85;
    pointer-events: none;
}

.atc-btn.loading::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: atc-spin 1s linear infinite;
}

.atc-post-icon,
.atc-pre-icon,
.atc-pre-icon-logged-out,
.atc-post-icon-logged-out {
    display: inline-flex;
}

.atc-count.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
    text-indent: -9999px;
    font-size: 0 !important;
    letter-spacing: 0;
}

.atc-count.loading span,
.atc-count.loading * {
    visibility: hidden !important;
    opacity: 0 !important;
}

.atc-count.loading::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid rgba(0, 0, 0, .2);
    border-top-color: #000;
    border-radius: 50%;
    animation: atc-spin 1s linear infinite;
}

.updating .atc-circle-btn {
    pointer-events: none;
}

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

.atc-qty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

.atc-qty.hidden {
    display: none;
}

.hidden {
    display: none;
}

.atc-circle-btn {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.atc-circle-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.atc-decrease {
    background-color: #ffffff;
    border: 1px solid black;
    border-radius: 50%;
    padding: 8px;
}

.atc-decrease svg {
    color: #000000;
}

.atc-increase {
    background-color: var(--primary) !important;
    border: var(--primary);
    border-radius: 50%;
    padding: 8px;
}

.atc-increase svg {
    color: var(--primary-text) !important;
}

.atc-count {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    background-color: #ffffff;
    color: #000000;
    border: 1px solid black;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.atc-count:hover {
    background-color: #f5f5f5;
}

/* Error States */
.atc-error-msg {
    color: var(--error);
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    justify-content: flex-end;
}

.atc-container.has-error .atc-btn {
    border: 1px solid var(--error);
}

.atc-container.has-error .atc-count {
    border-color: var(--error) !important;
}

.atc-container.has-error .atc-circle-btn {
    opacity: 0.7;
}

.atc-qty.has-error {
    border-color: var(--error) !important;
}

/* Customize text styling */
.customize-text {
    display: block;
    font-size: 11px;
    line-height: 1.2;
    margin-top: 0px;
    color: var(--primary-text);
    font-weight: normal;
}

.atc-count-unit {
    padding-left: 4px;
}
