/* DTF Logo Calculator - Frontend Styles */

.dtf-calculator {
    max-width: 600px;
    margin: 30px 0;
    font-family: inherit;
}

.dtf-calculator__title {
    font-size: 1.4em;
    font-weight: 600;
    margin-bottom: 5px;
}

.dtf-calculator__subtitle {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 25px;
}

/* Steps */
.dtf-calculator__step {
    margin-bottom: 25px;
}

.dtf-calculator__step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.dtf-calculator__step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #2c2c2c;
    color: #fff;
    border-radius: 50%;
    font-size: 0.85em;
    font-weight: 600;
    flex-shrink: 0;
}

.dtf-calculator__step-label {
    font-weight: 600;
    font-size: 1em;
}

/* Upload Zone */
.dtf-upload-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    position: relative;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dtf-upload-zone:hover {
    border-color: #999;
    background-color: #fafafa;
}

.dtf-upload-zone--dragover {
    border-color: #2c2c2c;
    background-color: #f0f0f0;
}

.dtf-upload-zone__content {
    pointer-events: none;
}

.dtf-upload-zone__icon {
    color: #999;
    margin-bottom: 10px;
}

.dtf-upload-zone__text {
    font-size: 1em;
    font-weight: 500;
    color: #333;
    margin: 0 0 4px;
}

.dtf-upload-zone__subtext {
    font-size: 0.85em;
    color: #999;
    margin: 0 0 8px;
}

.dtf-upload-zone__info {
    font-size: 0.75em;
    color: #bbb;
    margin: 0;
}

/* Upload Preview */
.dtf-upload-zone__preview {
    position: relative;
    max-width: 100%;
}

.dtf-upload-zone__preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dtf-upload-zone__remove {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e74c3c;
    color: #fff;
    border: 2px solid #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
}

.dtf-upload-zone__remove:hover {
    background: #c0392b;
}

/* Upload Loading */
.dtf-upload-zone__loading {
    text-align: center;
}

.dtf-upload-zone__loading p {
    margin: 10px 0 0;
    color: #666;
    font-size: 0.9em;
}

.dtf-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #eee;
    border-top-color: #2c2c2c;
    border-radius: 50%;
    animation: dtf-spin 0.7s linear infinite;
    margin: 0 auto;
}

@keyframes dtf-spin {
    to { transform: rotate(360deg); }
}

/* Upload Error */
.dtf-upload-zone__error {
    color: #e74c3c;
    font-size: 0.85em;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fef2f2;
    border-radius: 4px;
}

/* Dimensions Info */
.dtf-dimensions-info {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9em;
}

.dtf-dimensions-info__label {
    color: #666;
    margin-right: 4px;
}

.dtf-dimensions-info__value {
    font-weight: 600;
}

/* Manual Dimensions */
.dtf-manual-dims {
    margin-top: 10px;
}

.dtf-manual-dims__toggle a {
    font-size: 0.85em;
    color: #666;
    text-decoration: underline;
}

.dtf-manual-dims__toggle a:hover {
    color: #333;
}

.dtf-manual-dims__fields {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.dtf-manual-dims__field {
    flex: 1;
}

.dtf-manual-dims__field label {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-bottom: 4px;
}

.dtf-manual-dims__field input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
    box-sizing: border-box;
}

.dtf-manual-dims__field input:focus {
    border-color: #2c2c2c;
    outline: none;
}

/* Quantity Field */
.dtf-quantity-field__wrapper {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.dtf-quantity-field__btn {
    width: 40px;
    background: #f5f5f5;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
}

.dtf-quantity-field__btn:hover {
    background: #e5e5e5;
}

.dtf-quantity-field__wrapper input {
    width: 80px;
    text-align: center;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    font-size: 1em;
    padding: 8px;
    -moz-appearance: textfield;
    box-sizing: border-box;
}

.dtf-quantity-field__wrapper input::-webkit-outer-spin-button,
.dtf-quantity-field__wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Results */
.dtf-results {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px 20px;
}

.dtf-results__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.dtf-results__row--note {
    padding: 0 0 8px;
}

.dtf-results__note {
    font-size: 0.8em;
    color: #888;
    font-style: italic;
}

.dtf-results__label {
    color: #555;
    font-size: 0.95em;
}

.dtf-results__value {
    font-weight: 600;
    font-size: 0.95em;
}

.dtf-results__divider {
    height: 1px;
    background: #ddd;
    margin: 4px 0;
}

.dtf-results__row--total {
    padding-top: 12px;
}

.dtf-results__row--total .dtf-results__label {
    font-weight: 600;
    font-size: 1.05em;
    color: #333;
}

.dtf-results__row--total .dtf-results__value {
    font-size: 1.2em;
    color: #2c2c2c;
}

/* Calc Error */
.dtf-calculator__error {
    color: #e74c3c;
    font-size: 0.85em;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fef2f2;
    border-radius: 4px;
}

/* Actions */
.dtf-calculator__actions {
    margin-top: 20px;
}

.dtf-add-to-cart {
    width: 100%;
    padding: 14px 20px !important;
    font-size: 1em !important;
    font-weight: 600 !important;
    text-transform: none !important;
    border-radius: 4px !important;
    cursor: pointer;
    transition: opacity 0.2s;
}

.dtf-add-to-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dtf-add-to-cart.dtf-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Cart Message */
.dtf-cart-message {
    margin-top: 12px;
    padding: 12px 16px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.dtf-cart-message__text {
    color: #065f46;
    font-weight: 500;
}

.dtf-cart-message__link {
    color: #065f46;
    font-weight: 600;
    text-decoration: underline;
    white-space: nowrap;
}

/* DTF Error on Product Page */
.dtf-error {
    color: #e74c3c;
    padding: 12px 16px;
    background: #fef2f2;
    border-radius: 6px;
    margin: 20px 0;
}

/* Hide default add to cart for DTF products */
.dtf-product .single_add_to_cart_button,
.dtf-product .quantity,
.dtf-product form.cart .single_add_to_cart_button {
    display: none !important;
}

/* Responsive */
@media (max-width: 480px) {
    .dtf-calculator {
        max-width: 100%;
    }

    .dtf-dimensions-info {
        flex-direction: column;
        gap: 6px;
    }

    .dtf-upload-zone {
        padding: 20px 15px;
    }

    .dtf-results {
        padding: 12px 14px;
    }

    .dtf-cart-message {
        flex-direction: column;
        text-align: center;
    }
}
