/**
 * IASCOM Header Styles
 * Version: 2.4.0
 * Full width like topbar + Integrated Smart Finder
 */

/* ========================================
   SHOW ONLY ON DESKTOP/TABLET (>=769px)
======================================== */
.iascom-header-wrapper {
    display: none !important;
}

@media (min-width: 769px) {
    .iascom-header-wrapper {
        display: block !important;
    }
}

/* ========================================
   RESET
======================================== */
.iascom-header-wrapper *,
.ih-sidecart *,
.ih-sidecart-overlay,
.ih-search-popup * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.iascom-header-wrapper {
    font-family: Arial, sans-serif;
    width: 100%;
}

/* ========================================
   CONTAINER - Full width like topbar
======================================== */
.ih-container {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 10px;
    gap: 15px;
}

/* ========================================
   MAIN HEADER ROW
======================================== */
.ih-main {
    background: #f5f5f5;
    padding: 15px 0;
}

/* ========================================
   LOGO
======================================== */
.ih-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.ih-logo img {
    height: 50px;
    width: auto;
    max-width: 200px;
}

/* ========================================
   FLAGS - Inline
======================================== */
.ih-flags {
    flex-shrink: 0;
    display: inline-flex !important;
    align-items: center;
    gap: 3px;
}

.ih-flags * {
    display: inline !important;
}

.ih-flags .gt_selector,
.ih-flags .gt_switcher,
.ih-flags .gt_switcher_wrapper,
.ih-flags > div {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 3px !important;
    flex-wrap: nowrap !important;
}

/* ========================================
   SEARCH INPUT
======================================== */
.ih-search {
    flex: 1;
    max-width: 450px;
}

.ih-search-input {
    width: 100%;
    height: 52px;
    padding: 0 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 26px;
    outline: none;
    transition: all 0.3s ease;
    background: #fff;
}

.ih-search-input:focus {
    border-color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ========================================
   B2B BUTTON
======================================== */
.ih-btn-b2b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #707070;
    color: #fff !important;
    text-decoration: none !important;
    padding: 12px 35px;
    border: 2px solid #e30613;
    border-radius: 5px;
    font-size: 22px;
    font-weight: 200;
    text-transform: uppercase;
    transition: all 0.3s;
    flex-shrink: 0;
}

.ih-btn-b2b:hover {
    filter: brightness(0.9);
}

/* ========================================
   ΚΑΛΑΘΙ BUTTON
======================================== */
.ih-btn-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #e30613 !important;
    text-decoration: none !important;
    padding: 12px 30px;
    border: 2px solid #e30613;
    border-radius: 5px;
    font-size: 22px;
    font-weight: 200;
    transition: all 0.3s;
    flex-shrink: 0;
}

.ih-btn-cart:hover {
    background: #ffeaea;
}

/* ========================================
   CART TOTAL + ICON
======================================== */
.ih-cart-total {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #e30613 !important;
    text-decoration: none !important;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.ih-cart-total:hover {
    color: #c00 !important;
}

.ih-cart-amount .woocommerce-Price-amount {
    color: inherit !important;
}

.ih-cart-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ih-cart-icon {
    width: 28px;
    height: 28px;
    stroke: #e30613;
}

.ih-cart-total:hover .ih-cart-icon {
    stroke: #c00;
}

.ih-cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e30613;
    color: #fff;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   NAVIGATION MENU
======================================== */
.ih-nav {
    background: #707070;
}

.ih-nav .ih-container {
    justify-content: center;
    padding: 0 10px;
}

.ih-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
}

.ih-menu > li {
    position: relative;
}

.ih-menu > li > a {
    display: block;
    padding: 22px 30px;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 22px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 1px;
    transition: background 0.2s;
    border-right: 1px dotted rgba(255,255,255,0.4);
}

.ih-menu > li:last-child > a {
    border-right: none;
    background: #e30613 !important;
}

.ih-menu > li > a:hover,
.ih-menu > li.current-menu-item > a {
    background: rgba(255,255,255,0.1);
}

.ih-menu > li:last-child > a:hover {
    background: #c00510 !important;
}

/* ========================================
   DROPDOWN
======================================== */
.ih-menu > li > .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    background: #5a5a5a;
    list-style: none;
    margin: 0;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    text-align: left;
}

.ih-menu > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ih-menu > li > .sub-menu > li > a {
    display: block;
    padding: 12px 20px;
    color: #ccc !important;
    text-decoration: none !important;
    font-size: 15px;
    text-align: left;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.ih-menu > li > .sub-menu > li > a:hover {
    background: rgba(255,255,255,0.05);
    color: #fff !important;
    border-left-color: #e30613;
    padding-left: 23px;
}

/* ========================================
   SEARCH POPUP - Full Screen Grid
======================================== */
.ih-search-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    font-family: Arial, sans-serif;
}

.ih-search-popup.popup-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ih-search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    animation: ihFadeIn 0.3s ease;
}

.ih-search-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 85vh;
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    overflow-y: auto;
    z-index: 1;
    animation: ihSlideUp 0.3s ease;
}

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

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

.ih-search-close {
    position: absolute;
    top: 20px;
    right: 20px;
    height: 40px;
    padding: 0 20px;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    z-index: 10;
}

.ih-search-close:hover {
    background: #e0e0e0;
}

.ih-search-header {
    margin-bottom: 24px;
    padding-right: 100px;
}

.ih-search-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px 0;
}

.ih-search-count {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Search Results Grid */
.ih-search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.ih-product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.ih-product-card:hover {
    border-color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.ih-product-image {
    width: 100%;
    height: 140px;
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ih-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ih-product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ih-product-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ih-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #d32f2f;
    margin-bottom: 8px;
}

.ih-product-sku {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.ih-product-stock {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.ih-product-stock.in-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.ih-product-stock.out-of-stock {
    background: #ffebee;
    color: #c62828;
}

.ih-product-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
}

.ih-product-btn {
    flex: 1;
    height: 28px;
    border: none;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 6px;
}

.ih-product-btn-view {
    background: #1a1a1a;
    color: #fff;
}

.ih-product-btn-view:hover {
    background: #000;
}

.ih-product-btn-cart {
    background: #d32f2f;
    color: #fff;
}

.ih-product-btn-cart:hover {
    background: #c62828;
}

.ih-product-btn:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}

.ih-product-btn svg {
    width: 11px;
    height: 11px;
}

.ih-search-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.ih-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.ih-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f0f0f0;
    border-top-color: #333;
    border-radius: 50%;
    animation: ihSpin 0.8s linear infinite;
}

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

/* ========================================
   SIDE CART
======================================== */
.ih-sidecart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.ih-sidecart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ih-sidecart {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    max-width: 90vw;
    height: 100%;
    background: #fff;
    z-index: 99999;
    box-shadow: -5px 0 20px rgba(0,0,0,0.2);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
}

.ih-sidecart.active {
    right: 0;
}

.ih-sidecart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
}

.ih-sidecart-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.ih-sidecart-empty-wrap {
    font-size: 12px;
    font-weight: 400;
    color: #c00;
}

.ih-empty-cart-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    color: #c00;
    cursor: pointer;
    text-decoration: underline;
}

.ih-empty-cart-btn:hover {
    color: #900;
}

.ih-empty-cart-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.ih-sidecart-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    line-height: 1;
}

.ih-sidecart-close:hover {
    color: #e30613;
}

.ih-sidecart-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.ih-sidecart-items {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
}

.ih-sidecart-item {
    display: flex;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    position: relative;
}

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

.ih-sidecart-item-image {
    flex-shrink: 0;
    width: 70px;
}

.ih-sidecart-item-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.ih-sidecart-item-details {
    flex: 1;
    min-width: 0;
}

.ih-sidecart-item-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333 !important;
    text-decoration: none !important;
    margin-bottom: 5px;
    line-height: 1.3;
}

.ih-sidecart-item-name:hover {
    color: #e30613 !important;
}

.ih-sidecart-item-price {
    font-size: 14px;
    color: #666;
}

.ih-sidecart-item-remove {
    position: absolute;
    top: 15px;
    right: 0;
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
}

.ih-sidecart-item-remove:hover {
    color: #e30613;
}

.ih-sidecart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}

.ih-sidecart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
}

.ih-sidecart-subtotal strong {
    font-size: 20px;
    color: #333;
}

.ih-sidecart-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ih-sidecart-btn {
    display: block;
    text-align: center;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 5px;
    transition: all 0.3s;
}

.ih-sidecart-btn-cart {
    background: #707070;
    color: #fff !important;
}

.ih-sidecart-btn-cart:hover {
    background: #5a5a5a;
}

.ih-sidecart-btn-checkout {
    background: #800020;
    color: #fff !important;
}

.ih-sidecart-btn-checkout:hover {
    background: #600018;
}

.ih-sidecart-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 1200px) {
    .ih-search {
        max-width: 300px;
    }
}

@media (max-width: 1024px) {
    .ih-flags {
        display: none !important;
    }
    .ih-search {
        max-width: 250px;
    }
}

@media (max-width: 768px) {
    .ih-search-results {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    .ih-search-content {
        width: 95%;
        padding: 20px;
    }
    .ih-product-actions {
        flex-direction: column;
    }
}

body.ih-cart-open,
body.ih-search-open {
    overflow: hidden;
}
