/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #ffffff;
    color: #8D99A0;
    line-height: 1.6;
    padding-top: 140px; /* Increased to prevent overlap */
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid #C5C7D2;
    z-index: 1000;
    padding: 15px 0; /* Increased padding */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* Added shadow for better separation */
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.company-logo {
    cursor: pointer;
}

.company-logo img {
    height: 80px; /* Reduced from original to prevent overflow */
    width: auto;
    transition: transform 0.3s ease;
}

.company-logo:hover img {
    transform: scale(1.05);
}

.company-logo h1 {
    color: #0CB5D6;
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.help-contact {
    color: #ADADAD;
    font-size: 15px;
    font-family: 'Montserrat', sans-serif;
}

/* Account and Cart Container */
.account-cart-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1001;
}

/* Account Header Styles */
.account-header {
    background: #0CB5D6;
    color: white;
    padding: 10px 20px;
    border-radius: 43px;
    box-shadow: 0 1px 7px 2px rgba(0,0,0,0.16);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    min-width: 120px;
    text-align: center;
    border: 2px solid #0792AD;
    font-size: 14px;
}

.account-header:hover {
    background: #09B2D2;
    transform: translateY(2px);
    box-shadow: 0 6px 15px 2px rgba(0,0,0,0.24);
}

/* Cart Header Styles */
.cart-header {
    background: #0CB5D6;
    color: white;
    padding: 10px 20px;
    border-radius: 43px;
    box-shadow: 0 1px 7px 2px rgba(0,0,0,0.16);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    min-width: 120px;
    text-align: center;
    border: 2px solid #0792AD;
    font-size: 14px;
}

.cart-header:hover {
    background: #09B2D2;
    transform: translateY(2px);
    box-shadow: 0 6px 15px 2px rgba(0,0,0,0.24);
}

.cart-count {
    background: #ff4444;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    margin-left: 8px;
    min-width: 18px;
    display: inline-block;
}

.cart-count.hidden {
    display: none;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container {
    background: white;
    padding: 50px 30px;
    margin-bottom: 20px;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 50px;
}

.main-title {
    color: #0CB5D6;
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1;
}

.main-description {
    color: #8D99A0;
    font-size: 16px;
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto;
}

/* Search Section */
.search-section {
    margin-bottom: 40px;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
    max-width: 600px;
    margin: 0 auto 20px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

input[type="text"] {
    flex: 1;
    padding: 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #0CB5D6;
}

.search-btn {
    background-color: #0CB5D6;
    color: white;
    border: 2px solid #0792AD;
    border-radius: 43px;
    padding: 20px 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 1px 7px 2px rgba(0,0,0,0.16);
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap;
}

.search-btn:hover {
    background-color: #09B2D2;
    transform: translateY(2px);
    box-shadow: 0 6px 15px 2px rgba(0,0,0,0.24);
}

.search-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 140px; /* Account for search button width */
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.autocomplete-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-family: 'Montserrat', sans-serif;
    transition: background-color 0.2s;
}

.autocomplete-item:hover {
    background-color: #f5f5f5;
}

.autocomplete-item.selected {
    background-color: #0CB5D6;
    color: white;
}

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

/* Popular Styles Section */
.popular-styles-section {
    margin: 40px 0;
    padding: 30px;
    background: #f6f6f6;
    border-radius: 10px;
}

.section-title {
    color: #0CB5D6;
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
    line-height: 1;
}

.popular-styles-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.style-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    aspect-ratio: 1;
}

.style-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.style-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.style-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 40px;
    color: #8D99A0;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0CB5D6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Results Section */
.results-section {
    margin-top: 30px;
}

.match-info {
    background: linear-gradient(135deg, #e8f5e8, #d4edda);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #0CB5D6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.match-info h3 {
    color: #0CB5D6;
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.match-info p {
    color: #3B4346;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
}

/* Inventory Items */
.inventory-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.inventory-item {
    display: flex;
    align-items: center;
    padding: 25px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: white;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.inventory-item:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.item-image-container {
    flex-shrink: 0;
    margin-right: 25px;
}

.item-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.3s;
}

.item-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.item-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.item-name {
    font-size: 16px;
    font-weight: 500;
    color: #3B4346;
    margin-bottom: 10px;
    font-family: 'Montserrat', sans-serif;
}

.item-qty-price {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.item-qty {
    font-size: 16px;
    color: #8D99A0;
    font-weight: 500;
    font-family: 'Lato', sans-serif;
}

.item-price {
    font-size: 24px;
    color: #252A32;
    font-weight: 600;
    font-family: 'Oswald', monospace;
}

/* Cart Button */
.cart-button {
    background-color: #0CB5D6;
    color: white;
    border: 2px solid #0792AD;
    padding: 12px 20px;
    border-radius: 43px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 1px 7px 2px rgba(0,0,0,0.16);
    max-width: 200px;
}

.cart-button:hover {
    background-color: #09B2D2;
    transform: translateY(2px);
    box-shadow: 0 6px 15px 2px rgba(0,0,0,0.24);
}

.cart-button.active {
    background-color: white;
    color: #333;
    border: 2px solid #0CB5D6;
}

/* Quantity Controls */
.quantity-controls-inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-btn-inline {
    background-color: transparent;
    border: none;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.qty-btn-inline:hover {
    background-color: rgba(12, 181, 214, 0.1);
}

.qty-btn-inline:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.qty-display-inline {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    min-width: 30px;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
}

.bin-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Shipping Banner */
.shipping-banner {
    background-color: #0CB5D6;
    text-align: center;
    padding: 15px;
    margin-bottom: 0;
}

.shipping-banner p {
    color: white;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    margin: 0;
}

/* Footer */
.footer {
    background-color: white;
    padding: 50px 0 20px;
    border-top: 1px solid #C5C7D2;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding: 0 20px;
}

.footer-logo h3 {
    color: #0CB5D6;
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.footer-text p {
    color: #8D99A0;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
}

.security-info {
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 0 20px;
    text-align: center;
}

.security-info p {
    color: #8D99A0;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
}

/* Error and No Results States */
.no-results {
    text-align: center;
    color: #8D99A0;
    padding: 60px 40px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.no-results h3 {
    color: #3B4346;
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

.error {
    background: linear-gradient(135deg, #ffe6e6, #ffcccc);
    color: #d32f2f;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #d32f2f;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-family: 'Montserrat', sans-serif;
}

/* Cart Modal Styles */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1002;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cart-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    max-height: 90vh;
    width: 100%;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.cart-modal-header {
    padding: 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.cart-modal-title {
    font-size: 22px;
    font-weight: 600;
    color: #0CB5D6;
    font-family: 'Montserrat', sans-serif;
}

.cart-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.cart-close-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.cart-modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.cart-empty {
    text-align: center;
    color: #8D99A0;
    padding: 60px;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
}

.cart-total {
    border-top: 1px solid #eee;
    padding: 25px;
    background: #f8f9fa;
    font-size: 20px;
    font-weight: 600;
    text-align: right;
    color: #252A32;
    font-family: 'Montserrat', sans-serif;
}

/* Image Carousel Modal Styles */
.image-carousel-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.carousel-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.carousel-header {
    padding: 20px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.carousel-title {
    font-size: 18px;
    font-weight: 600;
    color: #0CB5D6;
    font-family: 'Montserrat', sans-serif;
}

.carousel-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.carousel-close-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.carousel-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transition: opacity 0.3s ease;
}

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(12, 181, 214, 0.9);
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    font-size: 24px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.carousel-nav-btn:hover {
    background: #09B2D2;
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%);
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

.carousel-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.carousel-counter {
    font-size: 14px;
    color: #8D99A0;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
}

.carousel-thumbnails {
    display: flex;
    gap: 10px;
    max-width: 400px;
    overflow-x: auto;
    padding: 5px 0;
}

.carousel-thumbnail {
    flex-shrink: 0;
    width: 55px;
    height: 55px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.carousel-thumbnail:hover {
    border-color: #0CB5D6;
    transform: scale(1.05);
}

.carousel-thumbnail.active {
    border-color: #0792AD;
    transform: scale(1.1);
}

.carousel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #8D99A0;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding-top: 200px; /* Increased for mobile */
    }

    .header {
        padding: 10px 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .company-logo img {
        height: 60px; /* Smaller on mobile */
    }
    
    .company-logo h1 {
        font-size: 18px;
    }
    
    .help-contact {
        font-size: 13px;
    }
    
    .account-cart-container {
        position: static;
        justify-content: center;
        margin: 10px 0;
        order: 3; /* Move to bottom in header */
    }
    
    .account-header, .cart-header {
        padding: 8px 15px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .container {
        padding: 30px 15px;
    }
    
    .main-title {
        font-size: 24px;
    }
    
    .main-description {
        font-size: 14px;
    }

    .search-box {
        flex-direction: column;
        gap: 15px;
    }

    .autocomplete-dropdown {
        right: 0; /* Full width on mobile */
    }
    
    .search-btn {
        padding: 15px 50px;
        font-size: 16px;
        width: 100%;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .popular-styles-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .inventory-item {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .item-image-container {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .item-qty-price {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .cart-button {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .popular-styles-container {
        grid-template-columns: 1fr;
    }
    
    .cart-modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .carousel-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .carousel-container {
        height: 50vh;
        min-height: 250px;
    }
    
    .carousel-nav-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .carousel-prev {
        left: 10px;
    }
    
    .carousel-next {
        right: 10px;
    }
}