/* ATV Search Styles - Version 3.0 */
.atv-search-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.atv-search-wrap * {
    box-sizing: border-box;
}

/* Search Card */
.atv-search-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    margin-bottom: 30px;
}

.atv-search-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.atv-search-icon {
    font-size: 40px;
    line-height: 1;
}

.atv-search-heading h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
}

.atv-search-heading p {
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 14px;
}

.atv-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.atv-fields label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.atv-fields select {
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
    width: 100%;
}

.atv-fields select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.atv-fields select:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.6;
}

.atv-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.atv-primary {
    padding: 12px 32px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 200px;
}

.atv-primary:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.atv-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.atv-reset {
    padding: 12px 24px;
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.atv-reset:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

/* Selected */
.atv-selected {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 24px;
    color: #1e40af;
    font-size: 14px;
}

/* Categories */
.atv-categories-section {
    margin-bottom: 30px;
}

.atv-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f3f5;
}

.atv-section-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}

.atv-section-title span {
    font-size: 14px;
    color: #6b7280;
}

.atv-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.atv-category {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    color: #1a1a2e;
    transition: all 0.2s;
    text-align: center;
}

.atv-category:hover {
    border-color: #2563eb;
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.atv-category img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

.atv-category.no-image {
    padding: 30px 16px;
}

.atv-category-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.atv-category-count {
    font-size: 12px;
    color: #6b7280;
}

/* Breadcrumbs */
.atv-breadcrumbs {
    padding: 12px 0;
    margin-bottom: 16px;
    font-size: 14px;
    color: #6b7280;
}

.atv-breadcrumbs a {
    color: #2563eb;
    text-decoration: none;
}

.atv-breadcrumbs a:hover {
    text-decoration: underline;
}

.atv-breadcrumbs strong {
    color: #1a1a2e;
}

/* Products Layout - 2 Columns */
.atv-products-wrapper {
    margin-top: 20px;
}

.atv-products-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.atv-products-list {
    flex: 2;
    min-width: 0;
}

.atv-technical-sidebar {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
    position: sticky;
    top: 20px;
}

/* Products Header */
.atv-products-header {
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1a1a2e;
}

.atv-products-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.atv-products-subtitle {
    font-size: 13px;
    color: #6b7280;
    display: block;
    margin-top: 2px;
}

/* Product Items */
.atv-product-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.atv-product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    transition: all 0.2s;
}

.atv-product-item.odd {
    background: #f8f9fa;
}

.atv-product-item.even {
    background: #ffffff;
}

.atv-product-item:hover {
    background: #e8f0fe !important;
    border-left: 3px solid #2563eb;
    padding-left: 11px;
}

.atv-product-item form {
    margin: 0;
    padding: 0;
}

/* Position Number */
.atv-product-position {
    flex: 0 0 32px;
    text-align: center;
}

.atv-position-number {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    display: inline-block;
}

/* Product Image */
.atv-product-image {
    flex: 0 0 55px;
    width: 55px;
    height: 55px;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: border-color 0.2s;
}

.atv-product-image:hover {
    border-color: #2563eb;
}

.atv-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.atv-product-image-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.atv-image-zoom-icon {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.atv-product-image:hover .atv-image-zoom-icon {
    opacity: 1;
}

.atv-product-placeholder {
    font-size: 22px;
    color: #9ca3af;
}

/* Product Details */
.atv-product-details {
    flex: 1;
    min-width: 0;
}

.atv-product-name-link {
    text-decoration: none;
}

.atv-product-name {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a2e;
    line-height: 1.3;
}

.atv-product-name:hover {
    color: #2563eb;
}

.atv-product-sku {
    font-size: 12px;
    color: #6b7280;
    margin-top: 1px;
}

.atv-product-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.atv-product-stock {
    font-size: 11px;
    padding: 1px 10px;
    border-radius: 10px;
    display: inline-block;
    font-weight: 500;
}

.atv-product-stock.in-stock {
    color: #16a34a;
    background: #dcfce7;
}

.atv-product-stock.out-of-stock {
    color: #dc2626;
    background: #fee2e2;
}

.atv-product-qty-available {
    font-size: 11px;
    color: #6b7280;
}

/* Price Column */
.atv-product-price-col {
    flex: 0 0 90px;
    text-align: right;
}

.atv-product-price {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    white-space: nowrap;
}

/* ============================================
   QUANTITY AND ADD TO CART - ORDER: MINUS | INPUT | PLUS | ADDAUGA
   ============================================ */
.atv-product-actions {
    flex: 0 0 210px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.atv-qty-add-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

/* Butoanele Minus și Plus */
.atv-qty-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #f3f4f6;
    color: #374151;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
    user-select: none;
}

.atv-qty-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.atv-qty-btn:active {
    transform: scale(0.92);
}

.atv-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Input cantitate - la mijloc */
.atv-qty-input {
    width: 48px;
    height: 32px;
    padding: 2px 4px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    background: #fff;
    -moz-appearance: textfield;
    color: #1a1a2e;
}

.atv-qty-input::-webkit-outer-spin-button,
.atv-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.atv-qty-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buton Adaugă în coș - ultimul */
.atv-add-to-cart-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 5px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    margin-left: 2px;
}

.atv-add-to-cart-btn:hover {
    background: #1d4ed8;
    transform: scale(1.02);
}

.atv-add-to-cart-btn:active {
    transform: scale(0.96);
}

.atv-add-to-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.atv-add-to-cart-btn.added {
    background: #16a34a;
}

.atv-cart-icon {
    font-size: 14px;
}

.atv-view-product-btn {
    display: inline-block;
    background: #f3f4f6;
    color: #374151;
    padding: 5px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    height: 32px;
    display: flex;
    align-items: center;
}

.atv-view-product-btn:hover {
    background: #e5e7eb;
}

.atv-out-of-stock-label {
    font-size: 13px;
    color: #dc2626;
    font-weight: 500;
}

/* Mesajul de confirmare */
.atv-add-to-cart-message {
    font-size: 12px;
    margin-top: 4px;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 500;
    width: 100%;
    text-align: center;
}

.atv-add-to-cart-message.success {
    color: #16a34a;
    background: #dcfce7;
}

.atv-add-to-cart-message.error {
    color: #dc2626;
    background: #fee2e2;
}

/* Technical Sidebar */
.atv-technical-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.atv-technical-header {
    padding: 14px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.atv-technical-header h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.atv-technical-subtitle {
    font-size: 12px;
    color: #6b7280;
    display: block;
    margin-top: 2px;
}

.atv-technical-image {
    padding: 16px;
    background: #fafbfc;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.atv-technical-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    max-height: 220px;
}

.atv-technical-footer {
    padding: 10px 16px;
    border-top: 1px solid #f1f3f5;
    text-align: center;
}

.atv-diagram-link {
    color: #2563eb;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    transition: color 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.atv-diagram-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.atv-technical-placeholder {
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
    padding: 40px 20px;
    text-align: center;
}

.atv-technical-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.atv-technical-placeholder p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

/* Empty & Loading */
.atv-empty {
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
}

.atv-loader {
    text-align: center;
    padding: 30px;
    color: #6b7280;
}

/* Lightbox */
.atv-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.atv-lightbox-overlay.active {
    display: flex;
}

.atv-lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.atv-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.atv-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
    transition: transform 0.2s;
}

.atv-lightbox-close:hover {
    transform: rotate(90deg);
}

.atv-lightbox-title {
    position: absolute;
    bottom: -40px;
    left: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    width: 100%;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablets and small desktops */
@media (max-width: 1024px) {
    .atv-products-container {
        flex-direction: column;
    }
    
    .atv-technical-sidebar {
        min-width: unset;
        max-width: 100%;
        order: -1;
        position: static;
        margin-bottom: 20px;
    }
    
    .atv-technical-image {
        min-height: 150px;
    }
    
    .atv-technical-image img {
        max-height: 180px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .atv-search-card {
        padding: 20px;
    }
    
    .atv-fields {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .atv-actions {
        flex-direction: column;
    }
    
    .atv-primary {
        min-width: unset;
    }
    
    .atv-category-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .atv-product-item {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 8px;
    }
    
    .atv-product-position {
        flex: 0 0 28px;
    }
    
    .atv-product-image {
        flex: 0 0 50px;
        width: 50px;
        height: 50px;
    }
    
    .atv-product-details {
        flex: 1 0 calc(100% - 90px);
    }
    
    .atv-product-price-col {
        flex: 0 0 80px;
    }
    
    .atv-product-price {
        font-size: 14px;
    }
    
    .atv-product-actions {
        flex: 1 0 100%;
        justify-content: flex-start;
        padding-left: 60px;
        margin-top: 4px;
    }
    
    .atv-qty-add-wrapper {
        flex-wrap: wrap;
    }
    
    .atv-qty-btn {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 16px;
    }
    
    .atv-qty-input {
        width: 44px;
        height: 30px;
        font-size: 13px;
    }
    
    .atv-add-to-cart-btn {
        padding: 4px 14px;
        font-size: 12px;
        height: 30px;
    }
    
    .atv-search-heading {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .atv-search-card {
        padding: 16px;
    }
    
    .atv-search-heading h2 {
        font-size: 20px;
    }
    
    .atv-category-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .atv-product-item {
        padding: 8px 10px;
    }
    
    .atv-product-position {
        flex: 0 0 24px;
    }
    
    .atv-position-number {
        font-size: 12px;
    }
    
    .atv-product-image {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
    }
    
    .atv-product-name {
        font-size: 13px;
    }
    
    .atv-product-price {
        font-size: 13px;
    }
    
    .atv-product-actions {
        padding-left: 46px;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .atv-qty-add-wrapper {
        flex-wrap: wrap;
        gap: 3px;
    }
    
    .atv-qty-btn {
        width: 28px;
        height: 28px;
        min-width: 28px;
        font-size: 15px;
    }
    
    .atv-qty-input {
        width: 38px;
        height: 28px;
        font-size: 12px;
    }
    
    .atv-add-to-cart-btn {
        padding: 3px 10px;
        font-size: 11px;
        height: 28px;
    }
    
    .atv-add-to-cart-message {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .atv-qty-add-wrapper .atv-add-to-cart-btn {
        flex: 1 0 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 2px;
    }
}