/* Bramy Polska Konfigurator - Frontend Styles */

/* Form Containers */
.bpk-main-form-container,
.bpk-pre-form-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 30px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.bpk-main-form-container h3,
.bpk-pre-form-container h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
}

/* Form Rows */
.bpk-form-row {
    margin-bottom: 20px;
}

.bpk-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.bpk-form-row input[type="number"],
.bpk-form-row select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.bpk-form-row input[type="number"]:focus,
.bpk-form-row select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.bpk-form-row select {
    cursor: pointer;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
}

/* Submit Button */
.bpk-submit-btn {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bpk-submit-btn:hover {
    background: linear-gradient(135deg, #005177 0%, #003f5c 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 115, 170, 0.3);
}

.bpk-submit-btn:active {
    transform: translateY(0);
}

.bpk-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Search Results */
.bpk-search-results {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.bpk-search-results h3 {
    margin-bottom: 30px;
    color: #333;
    text-align: center;
    font-size: 28px;
    font-weight: 600;
}

.bpk-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Product Item */
.bpk-product-item {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.bpk-product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #0073aa;
}

.bpk-product-image {
    position: relative;
    overflow: hidden;
    background: #f8f8f8;
}

.bpk-product-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.bpk-product-item:hover .bpk-product-image img {
    transform: scale(1.05);
}

.bpk-product-info {
    padding: 20px;
}

.bpk-product-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
}

.bpk-product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.bpk-product-title a:hover {
    color: #0073aa;
}

.bpk-product-price {
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 700;
    color: #e47911;
}

.bpk-product-attributes {
    margin-bottom: 20px;
}

.bpk-attribute {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.bpk-attribute strong {
    color: #333;
}

.bpk-product-actions {
    text-align: center;
}

.bpk-product-actions .button {
    display: inline-block;
    padding: 12px 25px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.bpk-product-actions .button:hover {
    background: #005177;
    transform: translateY(-2px);
}

/* No Results */
.bpk-no-results {
    text-align: center;
    font-size: 18px;
    color: #666;
    padding: 40px 20px;
    background: #f8f8f8;
    border-radius: 8px;
    border: 1px dashed #ccc;
}

/* Back Button */
.bpk-search-again {
    text-align: center;
    margin-top: 30px;
}

.bpk-back-btn {
    display: inline-block;
    padding: 12px 25px;
    background: #666;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.bpk-back-btn:hover {
    background: #555;
    color: white;
    text-decoration: none;
}

/* Debug Information */
.bpk-debug {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    font-family: monospace;
    font-size: 12px;
}

.bpk-debug h4,
.bpk-debug h5 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #856404;
}

.bpk-debug pre {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 3px;
    overflow-x: auto;
    font-size: 11px;
}

/* Loading State */
.bpk-loading {
    text-align: center;
    padding: 40px 20px;
}

.bpk-loading::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: bpk-spin 1s linear infinite;
}

@keyframes bpk-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .bpk-main-form-container,
    .bpk-pre-form-container {
        margin: 10px;
        padding: 20px;
    }
    
    .bpk-products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .bpk-search-results {
        margin: 10px;
        padding: 15px;
    }
    
    .bpk-search-results h3 {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .bpk-main-form-container h3,
    .bpk-pre-form-container h3 {
        font-size: 20px;
    }
    
    .bpk-form-row input[type="number"],
    .bpk-form-row select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .bpk-submit-btn {
        font-size: 14px;
        padding: 12px 15px;
    }
}

/* Print Styles */
@media print {
    .bpk-submit-btn,
    .bpk-back-btn,
    .bpk-debug {
        display: none;
    }
    
    .bpk-product-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
