/**
 * B2B Add to Cart Shortcode Styles
 *
 * @package TuttoCapsule_Sync
 */

.tc-add-to-cart-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 100%;
}

/* Notice */
.tc-atc-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background-color: #fef3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    font-size: 14px;
    line-height: 1.4;
}

.tc-atc-notice svg {
    flex-shrink: 0;
}

/* Quantity selector */
.tc-atc-quantity {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    background: #fff !important;
    border: 1px solid #d0d0d0 !important;
    border-radius: 30px !important;
    padding: 3px !important;
    width: auto !important;
    max-width: 140px !important;
    margin: 0 auto !important;
    box-shadow: none !important;
}

.tc-add-to-cart-wrapper .tc-qty-btn,
.tc-qty-btn.tc-qty-minus,
.tc-qty-btn.tc-qty-plus {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #f5f5f5 !important;
    border: none !important;
    border-radius: 50% !important;
    color: #555 !important;
    font-size: 18px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
    user-select: none !important;
    box-shadow: none !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
}

.tc-add-to-cart-wrapper .tc-qty-btn:hover,
.tc-qty-btn.tc-qty-minus:hover,
.tc-qty-btn.tc-qty-plus:hover {
    background: #e8e8e8 !important;
    color: #333 !important;
}

.tc-add-to-cart-wrapper .tc-qty-btn:active,
.tc-qty-btn.tc-qty-minus:active,
.tc-qty-btn.tc-qty-plus:active {
    background: #ddd !important;
}

.tc-add-to-cart-wrapper .tc-qty-btn:disabled,
.tc-qty-btn.tc-qty-minus:disabled,
.tc-qty-btn.tc-qty-plus:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
}

.tc-qty-btn span {
    line-height: 1 !important;
    display: block !important;
}

.tc-add-to-cart-wrapper .tc-qty-input,
input.tc-qty-input {
    width: 50px !important;
    height: 30px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #333 !important;
    -moz-appearance: textfield !important;
    box-shadow: none !important;
}

.tc-add-to-cart-wrapper .tc-qty-input::-webkit-outer-spin-button,
.tc-add-to-cart-wrapper .tc-qty-input::-webkit-inner-spin-button,
input.tc-qty-input::-webkit-outer-spin-button,
input.tc-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

.tc-add-to-cart-wrapper .tc-qty-input:focus,
input.tc-qty-input:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Stock availability */
.tc-atc-stock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    width: 100%;
}

.tc-atc-stock svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    display: inline-block;
    position: relative;
    top: -1px;
}

.tc-atc-stock span {
    display: inline;
    vertical-align: middle;
    line-height: 1.2;
}

.tc-atc-stock.tc-stock-instock {
    color: #2e7d32;
}

.tc-atc-stock.tc-stock-instock svg {
    stroke: #2e7d32;
}

.tc-atc-stock.tc-stock-outofstock {
    color: #c62828;
}

.tc-atc-stock.tc-stock-outofstock svg {
    stroke: #c62828;
}

/* Low stock warning */
.tc-atc-stock.tc-stock-low {
    color: #e65100;
}

.tc-atc-stock.tc-stock-low svg {
    stroke: #e65100;
}

/* Error message */
.tc-atc-error {
    padding: 10px 15px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
    font-size: 14px;
    text-align: center;
}

/* Add to cart button */
.tc-atc-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #c9713d 0%, #a85a2a 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
}

.tc-atc-button:hover {
    background: linear-gradient(135deg, #b86535 0%, #954f24 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 113, 61, 0.3);
}

.tc-atc-button:active {
    transform: translateY(0);
}

.tc-atc-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.tc-atc-button.tc-loading {
    pointer-events: none;
}

.tc-atc-button.tc-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.tc-atc-spinner {
    animation: tc-spin 1s linear infinite;
}

@keyframes tc-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* View cart button */
.tc-view-cart-button {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: transparent;
    border: 2px solid #c9713d;
    border-radius: 8px;
    color: #c9713d;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tc-view-cart-button:hover {
    background: #c9713d;
    color: #fff;
}

/* Unavailable state */
.tc-atc-unavailable {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #6c757d;
    text-align: center;
    font-size: 14px;
}

/* Variable product fallback */
.tc-variable-product .tc-atc-variable-notice {
    padding: 12px 16px;
    background: #e9ecef;
    border-radius: 8px;
    color: #495057;
    font-size: 14px;
    text-align: center;
    margin-bottom: 15px;
}

/* Error state for input */
.tc-qty-input.tc-error {
    color: #dc3545;
}

.tc-atc-quantity.tc-error {
    border-color: #dc3545;
    animation: tc-shake 0.5s ease;
}

@keyframes tc-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Package price */
.tc-package-price {
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
}

.tc-package-price .woocommerce-Price-amount {
    font-weight: inherit;
    color: inherit;
}

/* Responsive */
@media (max-width: 480px) {
    .tc-add-to-cart-wrapper .tc-qty-btn,
    .tc-qty-btn.tc-qty-minus,
    .tc-qty-btn.tc-qty-plus {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        max-width: 28px !important;
        min-height: 28px !important;
        max-height: 28px !important;
        font-size: 16px !important;
    }

    .tc-add-to-cart-wrapper .tc-qty-input,
    input.tc-qty-input {
        width: 40px !important;
        height: 28px !important;
        font-size: 14px !important;
    }

    .tc-atc-button {
        padding: 14px 20px;
        font-size: 15px;
    }

    .tc-atc-notice {
        font-size: 13px;
        padding: 10px 12px;
    }
}
