/* Shop Specific Styles */
.shop-page-container {
    display: flex;
    flex-direction: column;
    max-width: 1400px;
    margin: 120px auto 40px;
    padding: 0 20px;
    gap: 16px;
    min-height: 800px;
    scroll-behavior: smooth;
}

/* Sidebar */
.shop-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #eee;
    padding: 0;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);

    /* Sticky sidebar logic */
    position: sticky;
    top: 110px;
    /* Aligns with fixed header */
    height: calc(100vh - 150px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Custom scrollbar for premium look */
.shop-sidebar::-webkit-scrollbar {
    width: 6px;
}

.shop-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.shop-sidebar::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

.shop-sidebar::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

.sidebar-header {
    background: #fff;
    padding: 15px 20px;
    font-weight: 800;
    font-size: 1.1rem;
    color: #555;
    border-bottom: 1px solid #eee;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-item {
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    color: #444;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: all 0.2s;
    cursor: pointer;
}

.sidebar-link:hover {
    background: #f0fdf4;
    color: #27ae60;
}

.sidebar-link.active {
    background: #27ae60;
    color: #fff;
}

.sidebar-link .icon {
    font-size: 0.8rem;
    opacity: 0.5;
}

.sidebar-link.active .icon {
    opacity: 1;
}

/* Nested Lists */
.sub-list {
    background: #fafafa;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-in-out;
    list-style: none;
}

.sub-list .sidebar-link>span:first-child::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #27ae60;
    margin-right: 8px;
    vertical-align: middle;
    margin-top: -2px;
}

.sub-list.open {
    max-height: 3000px;
    transition: max-height 0.5s ease-in-out;
}

.sub-list .sidebar-link {
    padding-left: 40px;
    font-size: 0.85rem;
}

.sub-sub-list .sidebar-link {
    padding-left: 60px;
    font-size: 0.8rem;
}

/* Main Workspace */
.shop-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-filter-bar {
    display: flex;
    gap: 15px;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
}

.filter-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
}

.btn-filter {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-filter:hover {
    background: #219150;
}

.btn-filter-secondary {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.btn-filter-secondary:hover {
    background: #f5f5f5;
}

/* Érdeklődés modal — checkout-szerű mezők */
.inquiry-modal-card {
    background: #fff;
    border-radius: 10px;
    max-width: 480px;
    width: 100%;
    padding: 22px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.inquiry-modal-title {
    margin: 0 0 6px 0;
    font-size: 1.25rem;
}

.inquiry-modal-product {
    margin: 0 0 14px 0;
    color: #666;
    font-size: 14px;
}

.inquiry-form {
    display: grid;
    gap: 10px;
}

.inquiry-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    background: #fff;
}

.inquiry-input:focus {
    outline: none;
    border-color: #27ae60;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.15);
}

.inquiry-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
}

/* Results Table */
.results-container {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
}

.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.results-table th {
    background: #27ae60;
    color: white;
    text-align: left;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.results-table th:first-child {
    border-top-left-radius: 3px;
}

.results-table th:last-child {
    border-top-right-radius: 3px;
}

.results-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.results-row {
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    z-index: 1;
}

.results-row:hover {
    background: #f9f9f9;
}

.results-row.selected {
    background: #fffbe6;
}

/* Detail Panel (Accordion Like) */
.detail-panel {
    display: none;
    background: #fff;
    border: 2px solid #27ae60;
    padding: 30px;
    margin: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.detail-panel.open {
    display: block;
    animation: slideDown 0.3s ease-out;
}

/* Inline detail panel (inside table row) */
.inline-detail-row td {
    padding: 0 !important;
    border-left: 2px solid #27ae60 !important;
    border-right: 2px solid #27ae60 !important;
    border-bottom: 2px solid #27ae60 !important;
    border-top: none !important;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.inline-detail-panel {
    background: #fff;
    border: none;
    padding: 20px 30px 30px 30px;
    margin: 0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    animation: panelSlideDown 0.3s ease-out;
    position: relative;
    z-index: 10;
}

@keyframes panelSlideDown {
    from {
        opacity: 0;
        max-height: 0;
    }

    to {
        opacity: 1;
        max-height: 2000px;
    }
}

.inline-detail-panel .detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.inline-detail-panel .detail-header h4 {
    margin: 0;
    font-size: 1.3rem;
    color: #333;
}

.close-inline-detail {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1.4rem;
    cursor: pointer;
    color: #888;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-inline-detail:hover {
    background: #f5f5f5;
    color: #333;
    border-color: #999;
}

/* Active row highlight - merges with panel below */
.results-row.active-row {
    background: #27ae60 !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.15), -15px 0 40px rgba(0, 0, 0, 0.05), 15px 0 40px rgba(0, 0, 0, 0.05);
    z-index: 11;
}

.results-row.active-row td {
    border-top: 2px solid #27ae60;
    border-bottom: none !important;
}

.results-row.active-row td:first-child {
    border-left: 2px solid #27ae60;
    border-top-left-radius: 8px;
}

.results-row.active-row td:last-child {
    border-right: 2px solid #27ae60;
    border-top-right-radius: 8px;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.car-info-summary h4 {
    font-size: 1.4rem;
    margin: 0 0 5px 0;
    color: #333;
}

.car-info-summary p {
    color: #666;
    margin: 0;
}

.diagram-container {
    text-align: center;
    margin-bottom: 40px;
}

.diagram-img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.05));
}

.parts-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.part-item {
    display: grid;
    grid-template-columns: 80px 120px 1fr 120px max-content;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.part-item:last-child {
    border-bottom: none;
}

.part-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.part-code {
    font-weight: 800;
    color: #333;
}

.part-name {
    color: #555;
}

.part-price {
    font-weight: 600;
    color: #27ae60;
    text-align: right;
}

.part-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

.qty-input {
    width: 40px;
    padding: 5px;
    text-align: center;
    border: 1px solid #ddd;
}

.qty-stepper {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

/* Legacy gray cart button rules removed — see unified styles below */

.shop-page-container {
    margin-top: 120px;
    flex-direction: column;
    gap: 16px;
}
.shop-body {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    width: 100%;
}
.shop-search-bar {
    width: 100%;
}
.shop-selection-status {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
    margin-bottom: 10px;
}
.shop-main {
    flex: 1;
    min-width: 0;
}
.mobile-search-results {
    margin-top: 12px;
}
.mobile-inline-panel {
    margin: 0;
    padding: 8px 12px 12px 12px;
    background: #fafafa;
    border-top: 1px solid #eee;
    box-sizing: border-box;
    width: 100%;
}
.mobile-inline-panel .mobile-product-card,
.mobile-inline-panel .mobile-vehicle-card {
    width: 100%;
    box-sizing: border-box;
}
.mobile-product-card,
.mobile-vehicle-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}
.mobile-product-card__sku,
.mobile-vehicle-card__title {
    font-weight: 800;
    color: #e67e22;
    margin-bottom: 4px;
}
.mobile-product-card__name,
.mobile-vehicle-card__meta {
    font-weight: 600;
    margin-bottom: 8px;
}
.mobile-product-card__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.mobile-product-card__price {
    font-size: 1.15rem;
    font-weight: 800;
    color: #27ae60;
    white-space: nowrap;
}
.mobile-product-card__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.part-layout {
    display: grid;
    grid-template-columns: 120px 1fr max-content;
    gap: 20px;
}
.tech-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 0.85rem;
}
.mobile-vehicle-card__body {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}
.mobile-vehicle-card.is-open .mobile-vehicle-card__body {
    display: block;
}
.mobile-vehicle-card__toggle {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
}
.mobile-inline-empty {
    color: #888;
    padding: 12px 4px;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1100px) {
    .shop-body {
        flex-direction: column;
    }
    .shop-sidebar {
        width: 100%;
        position: relative;
        top: auto;
        height: auto;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 768px) {
    .shop-page-container {
        margin-top: 72px !important;
        padding: 0 12px 24px;
        min-height: 0;
        gap: 12px;
    }
    .shop-search-bar {
        position: sticky;
        top: 60px;
        z-index: 40;
        background: #f5f5f5;
        padding: 8px 0 10px;
    }
    .shop-main {
        display: none !important;
    }
    .shop-sidebar {
        width: 100%;
        position: static;
        height: auto;
        max-height: none;
        overflow: visible;
        box-shadow: none;
    }
    .sub-list.open {
        overflow: visible;
        max-height: none;
    }
    .part-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .mobile-inline-panel {
        display: block;
        width: 100%;
        max-width: 100%;
        margin: 8px 0 12px;
        padding: 12px;
        background: #f3f4f6;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        box-sizing: border-box;
        left: auto;
        transform: none;
    }
    .mobile-product-card,
    .mobile-vehicle-card {
        box-sizing: border-box;
        max-width: 100%;
        overflow: hidden;
    }
    .mobile-product-card__row {
        flex-direction: column;
        align-items: stretch;
    }
    .mobile-product-card__actions {
        align-items: stretch;
    }
    .mobile-product-card__actions .btn-add-cart {
        width: 100%;
    }
    .shop-detail-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 1400;
    }
    .shop-detail-backdrop.open {
        display: block;
    }
    .shop-detail-modal {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: calc(100vw - 20px);
        max-width: 520px;
        max-height: calc(100dvh - 24px);
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
        z-index: 1410;
        flex-direction: column;
        overflow: hidden;
    }
    .shop-detail-modal.open {
        display: flex;
    }
    .shop-detail-modal__header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding: 14px 16px;
        border-bottom: 1px solid #eee;
        flex-shrink: 0;
    }
    .shop-detail-modal__title {
        font-weight: 700;
        font-size: 0.95rem;
        line-height: 1.35;
        color: #222;
        min-width: 0;
    }
    .shop-detail-modal__close {
        border: 0;
        background: transparent;
        font-size: 1.6rem;
        line-height: 1;
        cursor: pointer;
        color: #666;
        flex-shrink: 0;
    }
    .shop-detail-modal__body {
        padding: 14px 16px 18px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
    }
    .shop-detail-modal__body img {
        max-width: 100%;
        height: auto;
    }
    .shop-detail-modal__body .part-layout {
        grid-template-columns: 1fr;
    }
}

/* Admin Styles */
.admin-sidebar-btns {
    display: inline-flex;
    gap: 4px;
    margin-right: 5px;
}

.edit-btn,
.sort-btn,
.add-sub-btn {
    background: #f39c12;
    color: white;
    border: none;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
}

.sort-btn {
    background: #3498db;
}

.add-sub-btn {
    background: #27ae60;
}

.delete-btn,
.remove-part-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
}

.remove-part-btn {
    font-size: 18px;
    padding: 0 8px;
    line-height: 1;
}

.results-table .edit-btn,
.results-table .delete-btn {
    padding: 5px 10px;
    font-size: 12px;
}

.add-part-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.add-part-btn:hover {
    background: #219150;
}

.search-result-item:hover {
    background: #f0fdf4 !important;
}

/* Admin Image Upload Styles */
.admin-img-upload {
    margin-bottom: 20px;
}

.upload-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

.upload-btn:hover {
    background: #2980b9;
}

.icn-btn {
    background: #f1f1f1;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.icn-btn:hover {
    background: #e0e0e0;
}

.upload-part-btn {
    color: #3498db;
}

.remove-part-btn.icn-btn {
    color: #e74c3c;
    font-size: 14px;
}

.admin-part-actions {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.part-item:hover .admin-part-actions {
    opacity: 1;
}

.btn-add-cart {
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 6px;
    transition: opacity 0.15s, transform 0.1s, background-color 0.15s;
    white-space: nowrap;
    width: auto;
    min-width: 100px;
    text-align: center;
    align-self: flex-end;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-add-cart:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.btn-add-cart.is-success {
    background: #1e8449 !important;
}

@media (hover: hover) {
    .btn-add-cart:hover {
        opacity: 0.92;
        transform: scale(1.02);
    }
}

.btn-add-cart:active {
    transform: scale(0.97);
}

.btn-cart-green {
    background: #27ae60;
}

.btn-cart-orange {
    background: #e67e22;
}

/* Animated Loader */
.loader-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 0;
    width: 100%;
}

.material-spinner {
    width: 40px;
    height: 40px;
    animation: rotate 2s linear infinite;
}

.material-spinner circle {
    stroke: #27ae60;
    stroke-width: 4;
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
    fill: none;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 200;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -35px;
    }

    100% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -124px;
    }
}

.cart-fab {
    display: none;
}

/* header cart styles live in style.css (base layout) */

/* Cart modal styles live in style.css (base layout) */
.cart-checkout-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.cart-checkout-form input, .cart-checkout-form textarea, .cart-checkout-form select {
    border: 1px solid #ddd; border-radius: 6px; padding: 8px 10px;
}