* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

.flex {
    display: flex;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #17d4fc 0%, #0ea5e9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.search-container {
    flex: 1;
    max-width: 600px;
    margin: 0 30px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #17d4fc;
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #0ea5e9;
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #0369a1;
}

.nav-icons {
    display: flex;
    align-items: center;
    gap: 20px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s;
    position: relative;
}

.icon-btn:hover {
    background: #f1f3f4;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Shop Finder Section */
.shop-finder {
    background: white;
    padding: 20px 0;
    border-bottom: 1px solid #e1e5e9;
}

.finder-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.finder-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

.location-selectors {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.select-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
}

.select-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.location-select {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    font-size: 16px;
    cursor: pointer;
    min-width: 180px;
    transition: border-color 0.3s;
}

.location-select:focus {
    border-color: #17d4fc;
    outline: none;
}

/* Main Section Layout */
#section {
    max-width: 1200px;
    margin: 0 auto;
    gap: 30px;
    padding: 20px;
}

/* Sidebar */
.side {
    width: 280px;
    flex-shrink: 0;
}

.group {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.sub-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
}

.group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    margin-bottom: 10px;
}

.group select:focus {
    border-color: #17d4fc;
    outline: none;
}

.filter {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    justify-content: space-between;
    align-items: center;
}

.filter .text {
    font-size: 14px;
    color: #555;
}

.filter .pointer {
    cursor: pointer;
    color: #999;
    font-size: 16px;
}

.price-range {
    width: 48%;
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
}

.price-range:focus {
    border-color: #17d4fc;
    outline: none;
}

.category {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.category:hover {
    background: #f8f9fa;
}

.category i {
    margin-right: 10px;
    color: #0ea5e9;
    width: 20px;
}

.category .text {
    font-size: 14px;
    color: #828282;
}

.currency-iso {
    font-weight: 600;
    color: #0ea5e9;
}

/* Main Board */
.board {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* Store Sections */
.store-section {
    margin-bottom: 40px;
    overflow: hidden;
}

.store-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    padding-right: 80px;
    border-bottom: 2px solid #f8f9fa;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8f9fc 0%, #ffffff 100%);
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.store-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.store-name {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.store-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #7f8c8d;
}

.contact-btn {
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
    font-size: 14px;
}

.contact-btn:hover {
    background: #0369a1;
}

/* Store Navigation Arrow */
.store-nav-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: #0ea5e9;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.store-nav-arrow:hover {
    background: #0369a1;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.store-nav-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

/* Tooltip for store arrow */
.store-nav-arrow::before {
    content: 'View full store inventory';
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.store-nav-arrow::after {
    content: '';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #2c3e50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.store-nav-arrow:hover::before,
.store-nav-arrow:hover::after {
    opacity: 1;
}

/* Products Grid */
.products-container {
    position: relative;
    overflow: hidden;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    max-height: none;
}

/* When there are many products, switch to horizontal scroll */
.products-grid.scroll-horizontal {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
    scroll-behavior: smooth;
    grid-template-columns: none;
    width: 100%;
    max-width: 100%;
}

.products-grid::-webkit-scrollbar {
    height: 8px;
}

.products-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.products-grid::-webkit-scrollbar-thumb {
    background: #67e8f9;
    border-radius: 4px;
}

.products-grid::-webkit-scrollbar-thumb:hover {
    background: #17d4fc;
}

.product-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
}

.scroll-horizontal .product-card {
    flex: 0 0 220px;
    min-width: 220px;
    max-width: 220px;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: #f8f9fa;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-icon-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(14, 165, 233, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.cart-icon-btn:hover {
    background: rgba(3, 105, 161, 1);
    transform: scale(1.1);
}

.product-info {
    padding: 15px;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.product-title {
    font-size: 14px;
    color: #34495e;
    line-height: 1.3;
    margin-bottom: 8px;
    height: 35px;
    overflow: hidden;
}

.product-condition {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.condition-new { background: #d4edda; color: #155724; }
.condition-fresh { background: #d1ecf1; color: #0c5460; }
.condition-used { background: #fff3cd; color: #856404; }
.condition-refurbished { background: #cce7ff; color: #004085; }
.condition-slightly-used { background: #f8d7da; color: #721c24; }
.condition-open-box { background: #e2e3e5; color: #383d41; }
.condition-for-rent { background: #d4edda; color: #155724; }

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.store-modal {
    max-width: 800px;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

.modal h1 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 24px;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

.cart-item-price {
    color: #0ea5e9;
    font-weight: 600;
}

.cart-remove {
    background: #ff4757;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.cart-remove:hover {
    background: #ff3838;
}

.cart-total {
    text-align: right;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.cart-total-amount {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

.checkout-btn {
    width: 100%;
    background: #0ea5e9;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: background 0.3s;
}

.checkout-btn:hover {
    background: #0369a1;
}

/* Store Inventory Modal Styles */
.store-inventory-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f8f9fa;
}

.store-inventory-title {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.store-inventory-location {
    color: #828282;
    font-size: 16px;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Animations */
@keyframes slideIn {
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

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

.notification {
    animation: slideIn 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .search-container {
        max-width: 100%;
        margin: 0;
    }

    .location-selectors {
        flex-direction: column;
    }

    .select-group {
        width: 100%;
        min-width: auto;
    }

    #section {
        flex-direction: column;
        gap: 20px;
    }

    .side {
        width: 100%;
    }

    .store-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px;
        position: relative;
    }

    .store-left {
        align-items: center;
        text-align: center;
    }

    .store-nav-arrow {
        position: static;
        transform: none;
        margin-top: 15px;
        align-self: center;
    }

    .store-nav-arrow::before {
        bottom: -45px;
    }

    .store-nav-arrow::after {
        bottom: -35px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .products-grid.scroll-horizontal {
        gap: 15px;
    }

    .scroll-horizontal .product-card {
        flex: 0 0 180px;
        min-width: 180px;
        max-width: 180px;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }

    .inventory-grid {
        grid-template-columns: 1fr;
    }
}

/* Additional hover and focus states */
.location-select:hover,
.group select:hover,
.price-range:hover {
    border-color: #17d4fc;
}

.category:active {
    background: #e9ecef;
}

.product-card:active {
    transform: translateY(-1px);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success states */
.success {
    background: #17d4fc !important;
}

.success:hover {
    background: #0ea5e9 !important;
}