/**
 * Tally Gang Sheet - Frontend Widget Styles
 * These are placeholder styles - the main styling comes from the React widget bundle
 */

/* Widget Container */
.tally-widget-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* TDTF Wrapper - Main widget container */
.tdtf-wrapper {
    max-width: 100%;
}

.tdtf-card {
    font-size: 14px;
    line-height: 1.5;
}

/* Spinner Animation */
@keyframes tdtf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tdtf-spinner {
    display: inline-block;
    width: 3rem;
    height: 3rem;
    border: 0.25rem solid rgba(0, 0, 0, 0.1);
    border-right-color: currentColor;
    border-radius: 50%;
    animation: tdtf-spin 0.75s linear infinite;
}

/* Modal Styles */
.tdtf-modal {
    z-index: 999999 !important;
}

.tdtf-modal .modal-content {
    border-radius: 12px;
}

.tdtf-modal .modal-backdrop {
    z-index: 999998 !important;
}

.tdtf-modal-large-style .modal-dialog {
    max-width: 95vw;
    margin: 1rem auto;
}

.tdtf-wide-modal {
    max-width: 95vw !important;
}

/* Hide default quantity input when Tally is active */
.tally-widget-container + .quantity {
    display: none;
}

/* Cart Preview Image */
.tally-cart-preview {
    max-width: 100px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tally-cart-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.tally-cart-thumbnails img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

/* Gang Sheet Thumbnail */
.tally-gang-sheet-thumbnail {
    max-width: 70px;
    height: auto;
    border-radius: 4px;
}

/* Quick Calculator Shortcode */
.tally-calculator {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    max-width: 400px;
    background: #fff;
}

.tally-calculator h4 {
    margin-top: 0;
    margin-bottom: 15px;
}

.tally-calc-inputs {
    display: grid;
    gap: 10px;
    margin-bottom: 15px;
}

.tally-calc-inputs label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 14px;
}

.tally-calc-inputs input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.tally-calc-result {
    font-size: 1.2em;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
}

.tally-calc-price {
    color: #2ecc71;
    font-weight: bold;
}

/* Order Item Meta */
.tally-order-item-meta {
    margin: 10px 0;
}

.tally-order-item-meta img {
    display: block;
    margin-bottom: 10px;
}

.tally-order-item-meta p {
    margin: 5px 0;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .tdtf-modal-large-style .modal-dialog {
        max-width: 100vw;
        margin: 0;
    }

    .tally-calculator {
        max-width: 100%;
    }
}

/* Theme Compatibility - Common overrides */
.woocommerce-product-details__short-description + .tally-widget-container {
    margin-top: 30px;
}

/* Storefront theme compatibility */
.storefront .tally-widget-container {
    clear: both;
}

/* Astra theme compatibility */
.ast-woo-single .tally-widget-container {
    margin: 25px 0;
}

/* OceanWP theme compatibility */
.owp-content-area .tally-widget-container {
    margin: 20px 0;
}

/* Print styles */
@media print {
    .tally-widget-container,
    .tdtf-modal {
        display: none !important;
    }
}
