/* ============================================
   Main Wrapper - 1200px max-width
   ============================================ */

.ast-container,
.site-content,
#primary,
#main {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
}

body:not(.elementor-editor-active) .custom-shop-wrapper {
    max-width: 1200px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@media (max-width: 1240px) {
    body:not(.elementor-editor-active) .custom-shop-wrapper {
        max-width: calc(100% - 40px) !important;
    }
}

.custom-shop-container {
    display: flex !important;
    gap: 30px !important;
    padding: 30px 0 !important;
}

/* ============================================
   Sidebar
   ============================================ */

.shop-sidebar {
    flex: 0 0 250px !important;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px 16px;
    height: fit-content;
    position: sticky !important;
    top: 20px !important;
}

/* Filter section */
.filter-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Section header row with collapse toggle */
.filter-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    cursor: pointer;
}

.filter-section-header h3 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #6b7280;
    text-transform: uppercase;
    margin: 0;
}

.filter-toggle {
    font-size: 14px;
    color: #9ca3af;
    line-height: 1;
    transition: transform 0.2s;
}

/* Checkbox filter list */
.filter-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    cursor: pointer;
}

/* Custom styled green checkbox */
.filter-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 17px;
    height: 17px;
    border: 1.5px solid #d1d5db;
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s;
    background: #fff;
}

.filter-item input[type="checkbox"]:checked {
    background: #16a34a;
    border-color: #16a34a;
}

.filter-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.filter-item input[type="checkbox"]:hover {
    border-color: #16a34a;
}

.filter-list .filter-item .filter-label {
    flex: 1;
    text-align: left !important;
}

.filter-item .count {
    margin-left: auto;
    flex-shrink: 0;
}

.count {
    background: #DDD;
    border-radius: 5px;
    padding: 3px 6px;
}

/* Condition dot color fix - add at the end of your CSS file */
.condition-dot {
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
}

.condition-dot.dot-green {
    background-color: #16a34a !important;
}

.condition-dot.dot-orange {
    background-color: #f59e0b !important;
}

.condition-dot.dot-red {
    background-color: #ef4444 !important;
}

.condition-dot.dot-gray {
    background-color: #9ca3af !important;
}

/* Color filter circles */
.color-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.color-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.color-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s;
    border: 2px solid transparent;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

/* White dot needs a border so it's visible */
.color-dot.white {
    box-shadow: 0 0 0 1px #d1d5db;
}

/* Selected color dot - ring effect */
.color-item input[type="checkbox"]:checked + .color-dot {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #16a34a;
}

.color-dot:hover {
    transform: scale(1.1);
}

/* Storage pill buttons */
.storage-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.storage-btn {
    padding: 6px 14px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    border-radius: 30px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    color: #1f2937;
    transition: all 0.15s;
}

.storage-btn:hover  { border-color: #111; }
.storage-btn.active { background: #111; color: #fff; border-color: #111; }

/* Carrier pill buttons */
.carrier-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.carrier-btn {
    padding: 6px 14px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    border-radius: 30px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    color: #1f2937;
    transition: all 0.15s;
}

.carrier-btn:hover  { border-color: #111; }
.carrier-btn.active { background: #111; color: #fff; border-color: #111; }

/* Price range inputs */
.price-range-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.price-range-inputs input {
    flex: 1;
    padding: 9px 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13px;
    color: #1f2937;
    transition: border-color 0.15s;
}

.price-range-inputs input:focus {
    outline: none;
    border-color: #16a34a;
}

.price-range-inputs input::placeholder { color: #9ca3af; }

.price-sep { color: #9ca3af; font-size: 13px; }

.price-apply-btn {
    width: 100%;
    padding: 9px;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.price-apply-btn:hover { background: #15803d; }

/* ============================================
   Dot colors (used in cards and filter list)
   ============================================ */

.dot-green  { background: #16a34a; }
.dot-orange { background: #f59e0b; }
.dot-red    { background: #ef4444; }

/* ============================================
   Main Content
   ============================================ */

.shop-main {
    flex: 1 !important;
    min-width: 0 !important;
}

/* ============================================
   Top Bar - single row with inline filter tags
   ============================================ */

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Left: count + active tags in one row */
.top-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.results-count {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

/* Active filter tags - inline green pills */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 500;
    color: #15803d;
}

.remove-filter {
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: #86efac;
    font-weight: 600;
    transition: color 0.15s;
}

.remove-filter:hover { color: #16a34a; }

/* Right: sort + view toggles */
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sort-dropdown select {
    padding: 8px 30px 8px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    background: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    transition: border-color 0.15s;
}

.sort-dropdown select:focus { outline: none; border-color: #16a34a; }

/* View toggle buttons */
.view-controls { display: flex; gap: 6px; }

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.15s;
    padding: 0;
}

.view-btn.active  { border-color: #111; color: #111; background: #f9fafb; }
.view-btn:hover   { border-color: #111; color: #111; }

/* ============================================
   Deal of the Week
   ============================================ */

.deal-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #0d2618 0%, #14532d 60%, #166534 100%);
    border-radius: 18px;
    padding: 28px 32px;
    margin-bottom: 32px;
    gap: 24px;
}

.deal-left {
    flex: 1;
}

/* Lightning bolt icon */
.deal-bolt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #4ade80;
    margin-bottom: 8px;
}

/* DEAL OF THE WEEK label */
.deal-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #86efac;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.deal-title {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 14px;
    line-height: 1.3;
}

.deal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.deal-tag {
    background: rgba(255,255,255,0.12);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 500;
    color: #d1fae5;
}

/* Right side: price + button */
.deal-right {
    text-align: right;
    flex-shrink: 0;
}

.deal-starting {
    font-size: 11px;
    color: #86efac;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.deal-current-price {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin-bottom: 4px;
}

.deal-retail-price {
    font-size: 13px;
    color: #6ee7b7;
    text-decoration: line-through;
    margin-bottom: 14px;
}

.deal-shop-btn {
    display: inline-block;
    background: #fff;
    color: #14532d;
    border: none;
    padding: 10px 22px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.deal-shop-btn:hover {
    background: #f0fdf4;
    transform: translateX(3px);
}

/* ============================================
   Products Section
   ============================================ */

.products-section { margin-bottom: 48px; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
}

/* ============================================
   Products Grid - 3 columns default
   ============================================ */

.products-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 18px !important;
}

.products-grid.list-view {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
}

/* ============================================
   Product Card
   ============================================ */

.product-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
    position: relative;
    transition: all 0.2s;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -8px rgba(0,0,0,0.1);
    border-color: #d1d5db;
}

/* Badge - top-left colored pill */
.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    z-index: 2;
}

/* Badge color variants */
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-orange { background: #fff7ed; color: #c2410c; }
.badge-blue   { background: #eff6ff; color: #1d4ed8; }
.badge-red    { background: #fef2f2; color: #b91c1c; }
.badge-gray   { background: #f3f4f6; color: #4b5563; }

/* Wishlist heart - top-right */
.wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s;
    z-index: 2;
    padding: 0;
}

.wishlist-btn:hover    { color: #ef4444; border-color: #fca5a5; background: #fff; }
.wishlist-btn.wishlisted { color: #ef4444; fill: #ef4444; }
.wishlist-btn.wishlisted svg { fill: #ef4444; stroke: #ef4444; }

/* Product image area */
.product-image-link {
    display: block;
    text-decoration: none;
    margin-bottom: 14px;
}

.product-image-wrap {
    background: #f5f5f3;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform 0.3s;
}

.product-card:hover .product-image-wrap img {
    transform: scale(1.04);
}

.product-image-placeholder {
    width: 100%;
    height: 100%;
    background: #f0f0ee;
}

/* Grade row with dot */
.product-grade {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.product-grade.grade-excellent { color: #16a34a; }
.product-grade.grade-good      { color: #d97706; }
.product-grade.grade-fair      { color: #dc2626; }

/* Colored dot before grade text */
.grade-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Product title link */
.product-title-link {
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
}

.product-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.3;
    margin: 0;
}

.product-title-link:hover .product-title { color: #16a34a; }

/* Specs line */
.product-specs {
    font-size: 11.5px;
    color: #6b7280;
    margin-bottom: 10px;
}

/* Price row */
.product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.current-price {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.regular-price {
    font-size: 13px;
    color: #9ca3af;
    text-decoration: line-through;
    font-weight: 400;
}

.saved {
    font-size: 11.5px;
    font-weight: 600;
    color: #16a34a;
    background: #f0fdf4;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Feature pills */
.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.feature {
    font-size: 10.5px;
    font-weight: 500;
    color: #374151;
    background: #f3f4f6;
    padding: 3px 9px;
    border-radius: 10px;
}

.feature-scuffs {
    color: #92400e;
    background: #fffbeb;
}

/* Add to Cart button */
.add-to-cart-btn {
    width: 100%;
    background: #111827;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 10px;
}

.add-to-cart-btn:hover    { background: #374151; }
.add-to-cart-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* IMEI & Clean History row - bottom of card */
.product-imei-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #16a34a;
    font-weight: 500;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.imei-dot {
    width: 7px;
    height: 7px;
    background: #16a34a;
    border-radius: 50%;
    flex-shrink: 0;
}

.imei-separator { color: #d1d5db; }

/* ============================================
   List view overrides
   ============================================ */

.products-grid.list-view .product-card {
    flex-direction: row !important;
    align-items: center !important;
    gap: 16px !important;
    padding: 16px 20px !important;
}

.products-grid.list-view .product-image-link {
    flex-shrink: 0;
    width: 80px;
    margin-bottom: 0;
}

.products-grid.list-view .product-image-wrap {
    width: 80px;
    height: 80px;
}

.products-grid.list-view .product-grade  { margin-bottom: 4px; }
.products-grid.list-view .product-title  { font-size: 14px; }
.products-grid.list-view .product-specs  { margin-bottom: 4px; }

.products-grid.list-view .product-price  {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-bottom: 0;
    min-width: 90px;
}

.products-grid.list-view .product-features { margin-bottom: 0; }

.products-grid.list-view .add-to-cart-btn {
    width: auto;
    min-width: 130px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.products-grid.list-view .product-imei-row {
    border-top: none;
    padding-top: 0;
    flex-shrink: 0;
}

/* ============================================
   Utility
   ============================================ */

.no-products {
    text-align: center;
    padding: 48px;
    color: #9ca3af;
    font-size: 15px;
    grid-column: 1 / -1;
}

.loading {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* Sidebar Header - Filters and Clear all */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: 0.3px;
}

.sidebar-clear-all {
    color: #ef4444;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-clear-all:hover {
    color: #dc2626;
    text-decoration: underline;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .custom-shop-container {
        flex-direction: column !important;
    }

    .shop-sidebar {
        position: static !important;
        flex: auto !important;
        width: 100% !important;
    }

    .products-grid {
        grid-template-columns: 1fr !important;
    }

    .top-bar {
        flex-wrap: wrap;
        gap: 10px;
    }

    .deal-card {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }

    .deal-right { text-align: center; }
    .deal-tags  { justify-content: center; }

    .products-grid.list-view .product-card {
        flex-direction: column !important;
        text-align: center;
    }

    .products-grid.list-view .product-image-link {
        width: 100%;
    }

    .products-grid.list-view .product-image-wrap {
        width: 100%;
        height: 180px;
    }

    .products-grid.list-view .add-to-cart-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .top-bar-right { gap: 6px; }
    .deal-current-price { font-size: 28px; }
}