/* Shopify Products Search Styles */

.shopify-search-container {
    display: inline-block;
    position: relative;
}

.shopify-search-icon {
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.05);
}

.shopify-search-icon:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.shopify-search-icon svg {
    display: block;
}

/* Modal Styles */
.shopify-search-v2-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.shopify-search-v2-modal.show {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.shopify-search-modal-content {
    background-color: #fff;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.shopify-search-v2-modal.show .shopify-search-modal-content {
    transform: scale(1);
}

.shopify-search-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
    background: #f9f9f9;
}

.shopify-search-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.shopify-search-v2-close {
    cursor: pointer;
    font-size: 24px;
    color: #666;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.shopify-search-v2-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Search Input */
.shopify-search-input-container {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
}

.shopify-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.shopify-search-input:focus {
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.shopify-search-v2-loader {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e1e1e1;
    border-top: 2px solid #4caf50;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

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

/* Search Results */
.shopify-search-v2-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}

.shopify-search-welcome {
    text-align: center;
    padding: 40px 24px;
    color: #666;
}

.shopify-search-welcome p {
    margin: 0;
    font-size: 16px;
}

.shopify-search-no-results {
    text-align: center;
    padding: 40px 24px;
    color: #666;
}

.shopify-search-no-results p {
    margin: 0;
    font-size: 16px;
}

.shopify-search-results-list {
    padding: 16px 0;
}

.shopify-search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.shopify-search-result-item:hover {
    background-color: #f9f9f9;
}

.shopify-search-result-item:last-child {
    border-bottom: none;
}

.shopify-search-result-image {
    width: 60px;
    height: 60px;
    margin-right: 16px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    flex-shrink: 0;
}

.shopify-search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shopify-search-result-content {
    flex: 1;
    min-width: 0;
}

.shopify-search-result-title {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shopify-search-result-price {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #4caf50;
}

.shopify-search-result-vendor {
    margin: 0;
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shopify-search-result-excerpt {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #888;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .shopify-search-modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 20px;
    }

    .shopify-search-modal-header {
        padding: 16px 20px;
    }

    .shopify-search-modal-header h3 {
        font-size: 16px;
    }

    .shopify-search-input-container {
        padding: 16px 20px;
    }

    .shopify-search-input {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .shopify-search-result-item {
        padding: 12px 20px;
    }

    .shopify-search-result-image {
        width: 50px;
        height: 50px;
        margin-right: 12px;
    }

    .shopify-search-result-title {
        font-size: 14px;
    }

    .shopify-search-result-price {
        font-size: 13px;
    }

    .shopify-search-result-vendor {
        font-size: 11px;
    }
}

/* Smooth scrollbar */
.shopify-search-v2-results::-webkit-scrollbar {
    width: 6px;
}

.shopify-search-v2-results::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.shopify-search-v2-results::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.shopify-search-v2-results::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Product Grid Styles (from existing plugin) */
.shopify-search-v2-modal .product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: none;
    margin: 0;
    padding: 16px;
}

.shopify-search-v2-modal .product {
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: box-shadow 0.3s ease;
    position: relative;
}

.shopify-search-v2-modal .product:hover {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.shopify-search-v2-modal .product .capsule {
    background: rgba(211, 47, 47, 0.75);
    font-size: 12px;
    height: 20px;
    border-radius: 20px;
    padding: 0.5px 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 40;
    color: white;
    box-shadow: 0 0 4px rgba(211, 47, 47, 0.3);
    transition: all 0.25s ease-in-out;
}

.shopify-search-v2-modal .product:hover .capsule {
    background: rgba(211, 47, 47, 1);
}

.shopify-search-v2-modal .product .capsule.green {
    background: rgba(181, 117, 51, 0.9);
}

.shopify-search-v2-modal .product:hover .capsule.green {
    background: rgba(181, 117, 51, 1);
}

.shopify-search-v2-modal .shopifyImagesContainer {
    position: relative;
    margin-bottom: 10px;
    height: 200px;
    overflow: hidden;
}

.shopify-search-v2-modal .shopifyImagesContainer>div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.shopify-search-v2-modal .shopifyImagesContainer>.lastImage {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.shopify-search-v2-modal .shopifyImagesContainer:hover>.lastImage {
    opacity: 1;
}

.shopify-search-v2-modal .shopifyImagesContainer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.shopify-search-v2-modal .product h4 {
    margin: 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.shopify-search-v2-modal .product .font-h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 10px 0;
}

.shopify-search-v2-modal .product .font-h5 {
    font-size: 16px;
    font-weight: 500;
}

.shopify-search-v2-modal .product .product-price {
    font-weight: bold;
    color: #4caf50;
    margin: 10px 0;
}

.shopify-search-v2-modal .product .variant-select {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.shopify-search-v2-modal .product .details {
    text-decoration: underline;
    cursor: pointer;
    color: #007bff;
    margin: 10px 0;
}

.shopify-search-v2-modal .product .description {
    text-align: left;
    margin-top: 15px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background: #f9f9f9;
}

.shopify-search-v2-modal .add-to-cart,
.shopify-search-v2-modal .add-to-cart-modal {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 10px 15px;
    margin-top: 10px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    width: 100%;
}

.shopify-search-v2-modal .add-to-cart:hover,
.shopify-search-v2-modal .add-to-cart-modal:hover {
    background-color: #45a049;
}

.shopify-search-v2-modal .vamtam-button.accent1.hover-accent2.button-solid {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 10px 15px;
    margin-top: 10px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    width: 100%;
    font-weight: 600;
}

.shopify-search-v2-modal .vamtam-button.accent1.hover-accent2.button-solid:hover {
    background-color: #45a049;
}

.shopify-search-v2-modal .vamtam-button.accent1.button-solid.added,
.shopify-search-v2-modal .add-to-cart.added,
.shopify-search-v2-modal .add-to-cart-modal.added {
    background: #888888 !important;
    color: #ffffff !important;
    opacity: 0.8 !important;
    cursor: not-allowed !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.shopify-search-v2-modal .vamtam-button.accent1.button-solid.added:hover,
.shopify-search-v2-modal .add-to-cart.added:hover,
.shopify-search-v2-modal .add-to-cart-modal.added:hover {
    background: #888888 !important;
    transform: none !important;
}

#shopify-search-v2-product-details-modal .vamtam-button.accent1.button-solid.added,
#shopify-search-v2-product-details-modal .add-to-cart.added,
#shopify-search-v2-product-details-modal .add-to-cart-modal.added {
    background: #888888 !important;
    color: #ffffff !important;
    opacity: 0.8 !important;
    cursor: not-allowed !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

#shopify-search-v2-product-details-modal .vamtam-button.accent1.button-solid.added:hover,
#shopify-search-v2-product-details-modal .add-to-cart.added:hover,
#shopify-search-v2-product-details-modal .add-to-cart-modal.added:hover {
    background: #888888 !important;
    transform: none !important;
}

/* Disabled variant options styling */
.shopify-search-v2-modal .variant-select option:disabled,
#shopify-search-v2-product-details-modal .variant-select option:disabled {
    background-color: #f5f5f5 !important;
    color: #999999 !important;
}

/* Image slider styles */
.shopify-search-v2-modal .image-slider {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.shopify-search-v2-modal .image-slider .slide {
    width: 100%;
    height: 100%;
}

.shopify-search-v2-modal .image-slider .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Details Modal (matching existing plugin) */
#shopify-search-v2-product-details-modal.modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

#shopify-search-v2-product-details-modal .modal-content {
    background: #ffffff;
    border-radius: 14px;
    position: relative;
    margin-top: 150px;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    width: 640px;
    max-width: 92%;
    max-height: 500px;
    overflow: scroll;
}

#shopify-search-v2-product-details-modal .close {
    font-size: 40px;
    position: absolute;
    right: 20px;
    top: 0px;
    cursor: pointer;
}

#shopify-search-v2-product-details-modal .close:hover,
#shopify-search-v2-product-details-modal .close:focus {
    color: #000;
}

#shopify-search-v2-product-details-modal .modal-description {
    padding: 50px;
}

#shopify-search-v2-product-details-modal .modal-description>div {
    display: flex;
    gap: 30px;
}

#shopify-search-v2-product-details-modal .modal-description>div>.images {
    width: 40%;
    position: relative;
    min-height: 300px;
}

#shopify-search-v2-product-details-modal .modal-description .images .bx-wrapper {
    position: relative;
}

#shopify-search-v2-product-details-modal .modal-description .details {
    width: 60%;
}

#shopify-search-v2-product-details-modal .modal-description .details,
#shopify-search-v2-product-details-modal .modal-description .details>div {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#shopify-search-v2-product-details-modal .image-slider {
    position: relative;
    width: 100%;
    min-height: 206px;
    overflow: hidden;
}

#shopify-search-v2-product-details-modal .image-slider .slide {
    text-align: center;
    display: none;
}

#shopify-search-v2-product-details-modal .image-slider .slide.firstImage {
    display: block;
}

#shopify-search-v2-product-details-modal .image-slider .slide img {
    max-width: 200px;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: 10px;
}

#shopify-search-v2-product-details-modal .images>.image-slider>.slide:not(:first-child) {
    display: none;
}

#shopify-search-v2-product-details-modal .bx-viewport,
#shopify-search-v2-product-details-modal .bx-wrapper .image-slider,
#shopify-search-v2-product-details-modal .bx-wrapper .slide {
    min-height: 206px !important;
}

#shopify-search-v2-product-details-modal .modal-description>div .bx-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    z-index: 100;
}

#shopify-search-v2-product-details-modal .modal-description>div .bx-controls .bx-controls-direction {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 20px;
    padding: 0 10px;
    box-sizing: border-box;
}

#shopify-search-v2-product-details-modal .modal-description>div .bx-controls .bx-controls-direction a {
    display: flex;
    width: 24px;
    height: 24px;
    border-radius: 24px;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.4);
    transition: all 0.4s ease-in-out;
    font-size: 20px;
}

#shopify-search-v2-product-details-modal .modal-description>div .bx-controls .bx-controls-direction a:hover {
    background: rgba(0, 0, 0, 0.75);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .shopify-search-v2-modal .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 12px;
    }

    .shopify-search-v2-modal .shopifyImagesContainer {
        height: 180px;
    }

    .shopify-search-v2-modal .product .font-h4 {
        font-size: 16px;
    }

    .shopify-search-v2-modal .product .font-h5 {
        font-size: 14px;
    }

    #shopify-search-v2-product-details-modal .modal-description>div {
        flex-direction: column;
    }

    #shopify-search-v2-product-details-modal .modal-description>div>.images {
        width: 100%;
    }

    #shopify-search-v2-product-details-modal .modal-description .image-slider {
        width: 100%;
    }

    #shopify-search-v2-product-details-modal .modal-description .details {
        width: 100%;
    }

    #shopify-search-v2-product-details-modal .modal-description .images img {
        min-width: 300px;
        min-height: 300px;
    }
}