/* 
  SrrShop Marketplace CSS (Trendyol / Hepsiburada Style)
*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #f27a1a; /* Trendyol Orange */
    --primary-hover: #e06c13;
    --text-main: #333333;
    --text-muted: #999999;
    --text-dark: #212121;
    
    --bg-main: #f3f4f6; /* Marketplace light gray bg */
    --bg-white: #ffffff;
    
    --border: #e2e8f0;
    --border-light: #f5f5f5;
    
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.05);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.1);
    
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.store-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.store-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: 2rem;
}

.store-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -1px;
    min-width: 150px;
}

.store-logo span {
    color: var(--primary);
}

/* Search Bar */
.header-search {
    flex-grow: 1;
    max-width: 600px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 0.8rem 1.2rem;
    padding-right: 3rem;
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    background: var(--bg-white);
}

.header-search button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 3rem;
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 1.2rem;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.action-item:hover {
    color: var(--primary);
}

.action-item .icon {
    font-size: 1.2rem;
}

.cart-btn {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Page Header (Optional, kept minimal) */
.store-page-header {
    background: var(--bg-white);
    padding: 1.5rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.store-page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Main Layout */
.store-main {
    min-height: calc(100vh - 72px - 200px);
    padding: 1.5rem 0 3rem;
}

/* Shop Layout */
.shop-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
}

/* Sidebar */
.shop-sidebar {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    border: 1px solid var(--border);
    height: fit-content;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.filter-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
}

.filter-list::-webkit-scrollbar {
    width: 6px;
}
.filter-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.filter-list a {
    color: var(--text-main);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-list a:hover {
    color: var(--primary);
}

.filter-list a.active {
    color: var(--primary);
    font-weight: 600;
}

/* Checkbox Style for categories */
.filter-list a::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
}

.filter-list a.active::before {
    background: var(--primary);
    border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
}

/* Marketplace Product Card */
.product-card {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    position: relative;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
    z-index: 2;
}

.product-img-wrapper {
    position: relative;
    padding-top: 100%; /* 1:1 Aspect Ratio for better hardware/tool presentation */
    background: #fff;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    overflow: hidden;
}

.product-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
}

/* Badges */
.card-badges {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 2;
}

.badge {
    background: #333;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 2px;
    text-transform: uppercase;
}

.badge.free-shipping {
    background: #111;
}

.badge.fast-delivery {
    background: #22c55e;
}

.product-info {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 0.85rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.6em; /* Fixed height for 2 lines */
}

.product-title strong {
    font-weight: 700;
    color: var(--text-dark);
}

.product-card:hover .product-title {
    color: var(--text-main);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.product-rating .stars {
    color: #fbbf24;
    letter-spacing: -1px;
}

.product-price-box {
    margin-top: auto;
    padding-top: 0.5rem;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* Add to Cart Hover Button */
.card-action {
    padding: 0 0.75rem 0.75rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    position: absolute;
    bottom: -45px;
    left: -1px;
    right: -1px;
    background: var(--bg-white);
    border: 1px solid var(--primary);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: 0 8px 12px rgba(0,0,0,0.1);
    z-index: 10;
}

.product-card:hover .card-action {
    opacity: 1;
    visibility: visible;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-block {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    background: var(--bg-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: flex;
    gap: 1rem;
}

/* --- MOBILE RESPONSIVE STYLES --- */
@media (max-width: 768px) {
    /* Header */
    .header-inner {
        height: auto;
        padding: 1rem 0;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .store-logo {
        flex: 1;
    }
    
    .header-actions {
        gap: 1rem;
    }
    
    .header-actions span {
        display: none; /* Hide text, keep only icons on mobile */
    }
    
    .header-search {
        order: 3; /* Move search bar to bottom row of header */
        width: 100%;
        max-width: 100%;
    }

    /* Shop Layout */
    .shop-layout {
        grid-template-columns: 1fr;
    }

    .shop-sidebar {
        padding: 1rem;
        margin-bottom: 0;
    }
    
    .filter-list {
        max-height: 150px;
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        gap: 1rem;
    }

    /* Product Grid */
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 products per row on mobile */
        gap: 0.5rem;
    }
    
    .product-card {
        border-radius: var(--radius-sm);
    }
    
    .product-info {
        padding: 0.5rem;
    }
    
    .product-title {
        font-size: 0.75rem;
        height: 2.8em;
    }
    
    .product-price {
        font-size: 0.95rem;
    }
    
    .card-badges {
        transform: scale(0.8);
        transform-origin: top left;
    }

    /* Always show add to cart on mobile, no hover needed */
    .card-action {
        position: static;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        padding: 0.5rem;
        border: none;
        border-top: 1px solid var(--border-light);
    }

    .product-card:hover {
        box-shadow: var(--shadow-sm); /* Disable large hover shadow on mobile */
        z-index: 1;
    }
    
    /* Product Details */
    .product-detail-layout {
        flex-direction: column;
    }
    
    .product-gallery .main-image {
        max-height: 350px;
    }
    
    .product-info-detail h1 {
        font-size: 1.2rem;
    }
    
    .product-price-large {
        font-size: 1.5rem;
    }
    
    .add-to-cart-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .add-to-cart-wrapper .qty-selector {
        justify-content: center;
        margin-bottom: 1rem;
    }
    
    /* Cart & Checkout */
    .cart-layout {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

/* Cart & Checkout Layout */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
}

.cart-items, .cart-summary, .checkout-form {
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid var(--border-light);
    padding: 0.25rem;
    margin-right: 1rem;
}

/* Footer */
.store-footer {
    background: #ffffff;
    border-top: 1px solid var(--border);
    padding: 3rem 0 1rem;
    margin-top: auto;
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-links h4, .footer-contact h4 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.footer-links a {
    display: block;
    color: var(--text-main);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- MOBILE RESPONSIVE STYLES --- */
@media (max-width: 768px) {
    /* Header */
    .header-inner {
        height: auto;
        padding: 1rem 0;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .store-logo {
        flex: 1;
    }
    
    .header-actions {
        gap: 1rem;
    }
    
    .header-actions span {
        display: none; /* Hide text, keep only icons on mobile */
    }
    
    .header-search {
        order: 3; /* Move search bar to bottom row of header */
        width: 100%;
        max-width: 100%;
    }

    /* Shop Layout */
    .shop-layout {
        grid-template-columns: 1fr;
    }

    .shop-sidebar {
        padding: 1rem;
        margin-bottom: 0;
    }
    
    .filter-list {
        max-height: 150px;
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        gap: 1rem;
    }

    /* Product Grid */
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 products per row on mobile */
        gap: 0.5rem;
    }
    
    .product-card {
        border-radius: var(--radius-sm);
    }
    
    .product-info {
        padding: 0.5rem;
    }
    
    .product-title {
        font-size: 0.75rem;
        height: 2.8em;
    }
    
    .product-price {
        font-size: 0.95rem;
    }
    
    .card-badges {
        transform: scale(0.8);
        transform-origin: top left;
    }

    /* Always show add to cart on mobile, no hover needed */
    .card-action {
        position: static;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        padding: 0.5rem;
        border: none;
        border-top: 1px solid var(--border-light);
    }

    .product-card:hover {
        box-shadow: var(--shadow-sm); /* Disable large hover shadow on mobile */
        z-index: 1;
    }
    
    /* Product Details */
    .product-detail-layout {
        flex-direction: column;
    }
    
    .product-gallery .main-image {
        max-height: 350px;
    }
    
    .product-info-detail h1 {
        font-size: 1.2rem;
    }
    
    .product-price-large {
        font-size: 1.5rem;
    }
    
    .add-to-cart-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .add-to-cart-wrapper .qty-selector {
        justify-content: center;
        margin-bottom: 1rem;
    }
    
    /* Cart & Checkout */
    .cart-layout {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* Footer */
    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
}