/* Backing Selector (still dropdown) */
select[name="backing"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
    transition: border-color 0.3s ease;
}

select[name="backing"]:focus {
    outline: none;
    border-color: #5B3FF9;
}/* Antigro Product Selector Form */
.antigro-product-selector {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.selector-section {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.selector-section h3 {
    color: #5B3FF9;
    font-size: 18px;
    margin: 0 0 20px 0;
    font-weight: 600;
}

/* Material Grid */
.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.material-option {
    cursor: pointer;
    position: relative;
}

.material-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.material-tile {
    background: #F7F8FA;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.material-tile img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 10px;
    background: #fff;
    padding: 2px;
    border: 1px solid #e0e0e0;
    object-fit: cover;
}

.material-tile span {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    line-height: 1.2;
}

.material-option input[type="radio"]:checked + .material-tile,
.material-option.selected .material-tile {
    background: #5B3FF9;
    color: #fff;
    border-color: #5B3FF9;
}

.material-option input[type="radio"]:checked + .material-tile span,
.material-option.selected .material-tile span {
    color: #fff;
}

.material-option:hover .material-tile {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Shape Options */
.shape-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.shape-option {
    cursor: pointer;
    position: relative;
}

.shape-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.shape-tile {
    background: #F7F8FA;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 20px 15px;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.shape-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 10px;
    background: #d0d0d0;
    transition: background 0.3s ease;
}

.shape-icon.circle {
    border-radius: 50%;
}

.shape-icon.square {
    border-radius: 4px;
}

.shape-icon.rectangle {
    width: 70px;
    height: 40px;
    border-radius: 4px;
}

.shape-icon.custom {
    position: relative;
    background: transparent;
    border: 3px dashed #d0d0d0;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

.shape-tile span {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    line-height: 1.2;
}

.shape-option input[type="radio"]:checked + .shape-tile,
.shape-option.selected .shape-tile {
    background: #5B3FF9;
    border-color: #5B3FF9;
}

.shape-option input[type="radio"]:checked + .shape-tile span,
.shape-option.selected .shape-tile span {
    color: #fff;
}

.shape-option input[type="radio"]:checked + .shape-tile .shape-icon,
.shape-option.selected .shape-tile .shape-icon {
    background: rgba(255,255,255,0.3);
}

.shape-option input[type="radio"]:checked + .shape-tile .shape-icon.custom,
.shape-option.selected .shape-tile .shape-icon.custom {
    border-color: rgba(255,255,255,0.6);
    background: transparent;
}

.shape-option:hover .shape-tile {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Size and Quantity Selectors - REMOVED OLD DROPDOWN STYLES */

/* Size Options Grid */
.size-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.size-option {
    cursor: pointer;
    position: relative;
}

.size-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.size-tile {
    background: #F7F8FA;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 20px 15px;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.size-tile span {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.size-option input[type="radio"]:checked + .size-tile,
.size-option.selected .size-tile {
    background: #5B3FF9;
    border-color: #5B3FF9;
}

.size-option input[type="radio"]:checked + .size-tile span,
.size-option.selected .size-tile span {
    color: #fff;
}

.size-option:hover .size-tile {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Quantity Options Grid */
.quantity-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.quantity-option {
    cursor: pointer;
    position: relative;
}

.quantity-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.quantity-tile {
    background: #F7F8FA;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 15px 10px;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.quantity-tile .qty-number {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.quantity-tile .qty-price {
    font-size: 13px;
    color: #666;
    margin-bottom: 2px;
}

.quantity-tile .qty-discount {
    font-size: 11px;
    color: #10B981;
    font-weight: 500;
}

.quantity-option input[type="radio"]:checked + .quantity-tile,
.quantity-option.selected .quantity-tile {
    background: #5B3FF9;
    border-color: #5B3FF9;
}

.quantity-option input[type="radio"]:checked + .quantity-tile .qty-number,
.quantity-option input[type="radio"]:checked + .quantity-tile .qty-price,
.quantity-option.selected .quantity-tile .qty-number,
.quantity-option.selected .quantity-tile .qty-price {
    color: #fff;
}

.quantity-option input[type="radio"]:checked + .quantity-tile .qty-discount,
.quantity-option.selected .quantity-tile .qty-discount {
    color: #B4E7FF;
}

.quantity-option:hover .quantity-tile {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Custom Size Input */
#custom-size-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

#custom-size-input input {
    flex: 1;
    padding: 10px;
    border: 2px solid #E5E7EB;
    border-radius: 6px;
    font-size: 14px;
}

#custom-size-input input.error {
    border-color: #EF4444;
}

#custom-size-input span {
    font-weight: 600;
    color: #6B7280;
}

.size-info,
.quantity-info {
    font-size: 12px;
    color: #6B7280;
    margin-top: 8px;
}

/* Custom Quantity Input */
#custom-quantity-section input {
    width: 100%;
    padding: 10px;
    border: 2px solid #E5E7EB;
    border-radius: 6px;
    font-size: 14px;
}

#custom-quantity-section input.error {
    border-color: #EF4444;
}

/* Price Display */
.price-display {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 15px;
    position: relative;
}

.price-display .label {
    font-size: 14px;
    opacity: 0.9;
}

#display-quantity {
    font-size: 16px;
    font-weight: 500;
}

.total-price {
    font-size: 32px;
    font-weight: 700;
}

.discount-info {
    width: 100%;
    font-size: 14px;
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.2);
    margin-top: 10px;
    opacity: 0.9;
}

/* Start Design Button */
#start-design-btn {
    background: #5B3FF9;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(91, 63, 249, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#start-design-btn:hover {
    background: #4A2FE8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91, 63, 249, 0.4);
}

#start-design-btn:disabled {
    background: #9CA3AF;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-arrow {
    transition: transform 0.3s ease;
}

#start-design-btn:hover .btn-arrow {
    transform: translateX(5px);
}

/* Antigro Modal */
.antigro-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 1400px;
    height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content iframe {
    width: 100%;
    height: 100%;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-modal:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Loading State */
.antigro-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Message boxes */
.antigro-success,
.antigro-error,
.antigro-warning {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.antigro-success {
    background: #10B981;
    color: #fff;
}

.antigro-success::before {
    content: '✓';
    background: #fff;
    color: #10B981;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.antigro-error {
    background: #EF4444;
    color: #fff;
}

.antigro-error::before {
    content: '✗';
    background: #fff;
    color: #EF4444;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.antigro-warning {
    background: #F59E0B;
    color: #fff;
}

.antigro-warning::before {
    content: '!';
    background: #fff;
    color: #F59E0B;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .material-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .shape-options {
        flex-direction: column;
    }
    
    .shape-option {
        width: 100%;
    }
    
    .price-display {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    #start-design-btn {
        font-size: 16px;
        padding: 14px 30px;
    }
}

/* WooCommerce Cart Integration */
.antigro-cart-thumbnail {
    max-width: 80px;
    height: auto;
    border-radius: 4px;
}

.edit-design-btn {
    background: #5B3FF9;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.edit-design-btn:hover {
    background: #4A2FE8;
}