/**
 * Tradeprint Frontend Styles
 *
 * @package Tradeprint_Integration
 */

/* Product Page Custom Fields */
.tradeprint-custom-fields {
    background: #f9f9f9;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
    border: 1px solid #e5e5e5;
}

.tradeprint-custom-fields h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.tradeprint-field {
    margin-bottom: 15px;
}

.tradeprint-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.tradeprint-field input[type="text"],
.tradeprint-field select,
.tradeprint-field textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.tradeprint-field textarea {
    min-height: 100px;
    resize: vertical;
}

.tradeprint-quantity-field {
    margin-top: 20px;
}

.tradeprint-quantity-field select {
    width: 100%;
    max-width: 240px;
}

.tradeprint-quantity-field.loading select {
    opacity: 0.6;
}

.tradeprint-quantity-error {
    margin-top: 10px;
    color: #d63638;
    font-weight: 600;
}

.tradeprint-qty-readonly {
    pointer-events: none;
}

.tradeprint-field .description {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Product Info */
.tradeprint-product-info {
    background: #e8f4f8;
    padding: 15px;
    margin: 15px 0;
    border-radius: 5px;
    border-left: 4px solid #2271b1;
}

.tradeprint-product-info p {
    margin: 5px 0;
}

.tradeprint-notice {
    color: #2271b1;
    font-weight: 600;
}

/* Cart Display */
.woocommerce-cart-form .tradeprint-option {
    font-size: 13px;
    color: #666;
}

.woocommerce-cart-form .tradeprint-option dt {
    font-weight: 600;
}

/* Checkout Display */
.woocommerce-checkout .tradeprint-option {
    font-size: 13px;
    color: #666;
}

/* Price Display */
.tradeprint-price-display-wrapper {
    margin: 20px 0;
}

.tradeprint-price-display {
    background: #f0f6fc;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    border-left: 4px solid #2271b1;
    display: none;
}

.tradeprint-price-placeholder {
    color: #666;
    font-style: italic;
}

.tradeprint-price-label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.tradeprint-price-value {
    font-size: 24px;
    font-weight: bold;
    color: #2271b1;
}

.tradeprint-price-value .loading {
    font-size: 14px;
    font-weight: normal;
    color: #666;
    font-style: italic;
}

.tradeprint-price-value .error {
    font-size: 14px;
    font-weight: normal;
    color: #d63638;
}

/* Image Notice */
.tradeprint-image-notice {
    background: #fff3cd;
    padding: 15px;
    margin: 15px 0;
    border-radius: 5px;
    border-left: 4px solid #f0ad4e;
    font-size: 14px;
    color: #856404;
}

.tradeprint-image-notice strong {
    display: block;
    margin-bottom: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .tradeprint-custom-fields {
        padding: 15px;
    }
    
    .tradeprint-field input[type="text"],
    .tradeprint-field select,
    .tradeprint-field textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .tradeprint-price-value {
        font-size: 20px;
    }
}


/* --- START PRICING GRID ADDITION --- */
.tp-pricing-table { width: 100%; border-collapse: separate; border-spacing: 4px; margin: 20px 0; }
.tp-qty-label { font-weight: bold; background: #f4f4f4; padding: 10px; text-align: center; border: 1px solid #ddd; }

/* The Grid Cells with your specific color #DCC6B6 */
.tp-grid-cell { 
    background-color: #DCC6B6 !important; 
    padding: 12px 5px; 
    text-align: center; 
    cursor: pointer; 
    border: 2px solid transparent;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #333;
}

.tp-grid-cell:hover { background-color: #c5b0a2 !important; }
.tp-grid-cell.active { 
    background-color: #000 !important; 
    color: #fff !important; 
    border-color: #000; 
}

.tp-grid-cell.tp-empty { background-color: #f9f9f9 !important; color: #ccc !important; cursor: not-allowed; }

/* Hide redundant parts from the old layout */
.tradeprint-price-display, .tradeprint-quantity-field { display: none !important; }
.single-product .quantity { display: none !important; }
/* --- END PRICING GRID ADDITION --- */











.tp-pricing-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
}

.tp-grid-cell {
    background: #fff;
    border: 1px solid #eee;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tp-grid-cell:hover:not(.tp-empty) {
    background: #fff9e6;
    border-color: #f1c40f;
}

.tp-grid-cell.selected {
    background: #000 !important;
    color: #fff !important;
    border-color: #000;
}

.tp-empty {
    color: #ccc;
    cursor: not-allowed;
    background: #fafafa;
}
















/* Container spacing */
.tradeprint-options-container {
    margin: 20px 0;
    padding: 15px;
    background: #fdfdfd;
    border: 1px solid #eee;
    border-radius: 4px;
}

/* The Table Styling */
.tp-pricing-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    margin-top: 15px;
}

.tp-pricing-table th {
    background: #333 !important;
    color: #fff;
    padding: 12px 5px;
    font-size: 12px;
    text-transform: uppercase;
    text-align: center;
}

.tp-qty-label {
    background: #f4f4f4;
    font-weight: bold;
    text-align: center;
}

/* The Price Cells */
.tp-grid-cell {
    background: #fff;
    border: 1px solid #ddd;
    padding: 12px 5px;
    text-align: center;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.tp-grid-cell:hover:not(.tp-empty) {
    background: #fff9c4 !important; /* Light yellow hover */
    border-color: #fbc02d;
}

/* The Active Selection - MUST MATCH JS CLICK */
.tp-grid-cell.active {
    background: #2ecc71 !important; /* Green for selected */
    color: #fff !important;
    border-color: #27ae60;
    font-weight: bold;
}

.tp-empty {
    background: #fafafa;
    color: #ccc;
    cursor: not-allowed;
}



.tp-loading-cell {
    color: #bbb;
    font-style: italic;
    background: #fafafa !important;
}

.tp-loader-dots {
    animation: blink 1.4s infinite both;
}

@keyframes blink {
    0% { opacity: .2; }
    20% { opacity: 1; }
    100% { opacity: .2; }
}

/* Pricing Grid Styles */
.tp-pricing-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 15px; 
    font-size: 14px;
}
.tp-pricing-table th { 
    background: #f9f9f9; 
    padding: 12px; 
    border: 1px solid #ddd; 
    text-align: center; 
    font-weight: 600; 
}
.tp-pricing-table td { 
    border: 1px solid #ddd; 
    padding: 12px; 
    text-align: center; 
    cursor: pointer; 
}
.tp-price-cell:hover { 
    background: #e6f7ff; 
    transition: 0.2s; 
}
.tp-price-cell.selected { 
    background: #007cba; 
    color: white; 
    border-color: #005a87; 
}
.tp-qty-cell { 
    background: #fdfdfd; 
    font-weight: bold; 
    color: #333; 
}
.tp-price-empty { 
    color: #ccc; 
    background: #fafafa; 
}

/* STICKY FOOTER STYLES */
#tp-sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 9999;
    padding: 15px 20px;
    box-sizing: border-box;
}

.tp-sticky-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tp-sticky-info {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.tp-price-large {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.tp-price-small {
    font-size: 18px;
    font-weight: 600;
    color: #555;
}

.tp-tax-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
}

.tp-divider {
    color: #ddd;
    font-size: 20px;
    margin: 0 5px;
}

.tp-sticky-action button {
    background-color: #719430; /* Tradeprint Green */
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.tp-sticky-action button:hover {
    background-color: #5e7d26;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .tp-sticky-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    .tp-sticky-action button {
        width: 100%;
    }
}

/* Pricing Grid Styles */
.tp-pricing-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 15px; 
    font-size: 14px;
}
.tp-pricing-table th { 
    background: #f9f9f9; 
    padding: 12px; 
    border: 1px solid #ddd; 
    text-align: center; 
    font-weight: 600; 
}
.tp-pricing-table td { 
    border: 1px solid #ddd; 
    padding: 12px; 
    text-align: center; 
    cursor: pointer; 
}
.tp-price-cell:hover { 
    background: #e6f7ff; 
    transition: 0.2s; 
}
.tp-price-cell.selected { 
    background: #007cba; 
    color: white; 
    border-color: #005a87; 
}
.tp-qty-cell { 
    background: #fdfdfd; 
    font-weight: bold; 
    color: #333; 
}
.tp-price-empty { 
    color: #ccc; 
    background: #fafafa; 
}

/* STICKY FOOTER STYLES (Info Only) */
#tp-sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 9999;
    padding: 15px 20px;
    box-sizing: border-box;
}

.tp-sticky-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center; /* Centered content */
    align-items: center;
}

.tp-sticky-info {
    display: flex;
    align-items: baseline;
    gap: 15px;
}

.tp-price-large {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.tp-price-small {
    font-size: 18px;
    font-weight: 600;
    color: #555;
}

.tp-tax-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    margin-left: 2px;
}

.tp-divider {
    color: #ddd;
    font-size: 20px;
    margin: 0 5px;
}

