/* Basic Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: var(--bg);
    color: #111;
    -webkit-font-smoothing:antialiased;
}

:root {
    --cols: 4; /* number of cards per row */
    --card-min-width: 220px; /* minimum card width */
    --card-image-height: 180px; /* image height inside a card */
    --card-min-height: 380px; /* minimum card height to show description + links */
    --bg: #f5f5f7;
    --panel-bg: #ffffff;
    --muted: #6e6e73;
    --text: #1d1d1f;
    --accent: #0071e3;
    --radius: 12px;
}

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

/* Header */
header {
    background-color: transparent;
    padding: 22px 0;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 18px;
    color: var(--text);
}

.logo img {
    height: 48px;
    max-height: 56px;
    width: auto;
    display: block;
    margin-right: 12px;
    object-fit: contain;
}

.search-bar {
    flex-grow: 1;
    margin: 0 20px;
}

.search-bar input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    background: transparent;
    font-size: 15px;
    color: var(--text);
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-right: 20px;
}

nav ul li a {
    text-decoration: none;
    color: #555;
    font-weight: bold;
}

.header-icons a {
    color: #555;
    margin-left: 20px;
    text-decoration: none;
}

.sign-in-btn {
    background-color: #2874f0;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

/* Flash Sale Section */
.flash-sale {
    background-color: #ff5722;
    color: #fff;
    padding: 40px 0;
    margin-top: 20px;
    border-radius: 8px;
}

.flash-sale .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sale-info h1 {
    font-size: 48px;
    margin-bottom: 10px;
}

.flash-sale-badge {
    background-color: #fff;
    color: #ff5722;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 14px;
}

.countdown {
    display: flex;
    margin-top: 20px;
}

.time-box {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 5px;
    margin-right: 10px;
    text-align: center;
}

.time-box .time {
    font-size: 24px;
    font-weight: bold;
    display: block;
}

.time-box .unit {
    font-size: 12px;
}

.sale-products {
    display: flex;
    gap: 20px;
}

.sale-products .product-card {
    background-color: #fff;
    color: #333;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    position: relative;
    width: 180px;
}

.sale-products .product-card .discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #f00;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
}

.sale-products .product-card img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.sale-products .product-card .claimed {
    color: #777;
    font-size: 12px;
    margin-bottom: 5px;
}

.sale-products .product-card h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.sale-products .product-card .price {
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
}

.sale-products .product-card .original-price {
    text-decoration: line-through;
    color: #777;
    font-size: 14px;
    margin-left: 5px;
}

/* Explore by Price */
.explore-by-price {
    margin-top: 40px;
}

.explore-by-price .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.explore-by-price h2 {
    font-size: 24px;
}

.price-filters {
    display: flex;
    gap: 10px;
}

.price-btn {
    background-color: #eee;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.price-btn.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

.view-all-categories {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
}

/* Product Listing */
.product-listing .container {
    display: flex;
    gap: 20px;
}

.sidebar {
    width: 30%;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.filters-header h2 {
    font-size: 20px;
}

.clear-all {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-weight: bold;
}

.filter-group {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.filter-group:last-child {
    border-bottom: none;
}

.filter-group h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.filter-group label {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.filter-group label input[type="checkbox"],
.filter-group label input[type="radio"] {
    margin-right: 10px;
    /* Add custom styling for checkboxes/radio buttons if needed */
}

.products-content {
    flex-grow: 1;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.sort-by span {
    margin-right: 10px;
}

.sort-by select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(var(--card-min-width), 1fr));
    gap: 20px;
}

.product-card-small {
    background-color: #fff;
    padding: 18px;
    border-radius: 10px;
    text-align: center;
    position: relative;
    min-height: var(--card-min-height);
    display: flex;
    flex-direction: column;
}

.product-card-small .badge {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
}

.product-card-small .badge.best-seller {
    background-color: #28a745;
}

.product-card-small .badge.low-stock {
    background-color: #ff9800;
    color: #fff;
}

.product-card-small .badge.new-arrival {
    background-color: #03a9f4;
    color: #fff;
}
.product-card-small .badge.organic {
    background-color: #4caf50;
}

.product-card-small .badge.must-have {
    background-color: #6f42c1;
    color: #fff;
}

.product-card-small .badge {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
}

.product-card-small img {
    width: 100%;
    max-height: var(--card-image-height);
    height: auto;
    object-fit: contain;
    object-position: center;
    border-radius: 6px;
    margin-bottom: 12px;
    background-color: #fff;
}

.product-card-small h3 {
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 700;
    text-transform: uppercase;
    color: #111;
    line-height: 1.15;
    margin-top: 6px;
}

.product-card-small .product-desc {
    font-size: 14px;
    color: #333;
    margin: 8px 0 12px 0;
    flex: 1 1 auto;
    line-height: 1.45;
    text-align: left;
    white-space: pre-wrap; /* preserve newlines from admin pasted text */
    overflow: visible;
    word-break: break-word;
}

.get-deal-btn {
    margin-top: 12px;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    background-color: #2b7bf6;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(43,123,246,0.12);
    width: 140px;
    text-align: center;
}
.share-btn {
        display: inline-block;
        background-color: #fff;
        color: #2b7bf6;
        padding: 10px 14px;
        border-radius: 8px;
        border: 1px solid #d6e9ff;
        cursor: pointer;
        margin-left: 10px;
}
.share-btn:hover { background-color: #f6fbff; }

.card-actions {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 10px;
}

/* Share modal */
.share-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.share-modal {
    background: #fff;
    width: 420px;
    max-width: calc(100% - 32px);
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
.share-modal .close-btn { float: right; cursor: pointer; font-size: 18px; }
.share-modal .share-grid { display:flex; gap:12px; justify-content:space-around; padding:12px 0; }
.share-modal .share-grid a { text-decoration:none; color:#333; display:flex; flex-direction:column; align-items:center; gap:8px; font-size:13px; }
.share-modal .share-grid a .icon { width:52px; height:52px; border-radius:10px; display:flex; align-items:center; justify-content:center; box-shadow:0 6px 12px rgba(0,0,0,0.08); }
.share-modal .share-grid a .icon svg { width:28px; height:28px; display:block; }
.share-modal .share-grid a .label { margin-top:4px; color:#444; }
.share-modal .share-preview { display:flex; gap:12px; align-items:flex-start; padding:8px 0; border-top:1px solid #f0f0f0; border-bottom:1px solid #f0f0f0; margin:10px 0; }
.share-modal .share-preview img { width:96px; height:96px; object-fit:cover; border-radius:6px; }
.share-modal .share-preview .meta { font-size:14px; color:#222; }
.share-modal .copy-link-btn { display:block; width:100%; padding:10px; border-radius:8px; border:1px dashed #8fd5c9; background:#eafbf6; color:#0a6b52; text-align:center; cursor:pointer; margin-top:12px; }
.get-deal-btn:hover { opacity: 0.95; }

.product-card-small .product-links a {
    display:block;
    color:#2874f0;
    margin-bottom:4px;
    font-size:13px;
    text-decoration:none;
}
.product-card-small .product-links a:hover { text-decoration:underline; }

.product-card-small p {
    font-size: 12px;
    color: #777;
    margin-bottom: 5px;
}

.product-card-small .price {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.product-card-small .original-price {
    text-decoration: line-through;
    color: #777;
    font-size: 12px;
    margin-left: 5px;
}

.product-card-small .discount {
    color: #28a745;
    font-weight: bold;
    margin-left: 5px;
}

.load-more-btn {
    display: block;
    margin: 40px auto;
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

/* Footer */
footer {
    background-color: #333;
    color: #fff;
    padding: 40px 0;
    margin-top: 40px;
}

footer .container {
    display: flex;
    justify-content: space-between;
    gap: 40px;
}

.footer-section h3 {
    margin-bottom: 20px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li a {
    text-decoration: none;
    color: #eee;
    margin-bottom: 10px;
    display: block;
}

.newsletter input {
    padding: 10px;
    border: none;
    border-radius: 5px 0 0 5px;
}

.newsletter button {
    background-color: #2874f0;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
}

/* Responsive layout adjustments */
@media (max-width: 1100px) {
    :root { --cols: 3; }
    .container { padding: 0 12px; }
    .sidebar { width: 280px; }
}

@media (max-width: 900px) {
    :root { --cols: 2; }
    header .container { flex-wrap: wrap; gap:10px; }
    .product-listing .container { flex-direction: column; }
    .sidebar { width: 100%; order: 2; }
    .products-content { order: 1; }
    .product-grid { grid-template-columns: repeat(2, minmax(var(--card-min-width), 1fr)); }
    .search-bar { order: 0; width: 100%; }
    .logo { width: 100%; }
}

@media (max-width: 480px) {
    :root { --cols: 1; --card-image-height: 140px; }
    .product-grid { grid-template-columns: 1fr; }
    .product-card-small { padding: 12px; min-height: 260px; }
    .product-card-small h3 { font-size: 15px; height: 3.2em; }
    .search-bar input { font-size: 14px; }
    .sidebar { padding: 12px; }
}

/* Apple-style theme overrides (polish) */
:root { --accent-weak: rgba(0,113,227,0.08); }

.products-header p { color: var(--muted); font-size: 14px; margin:0; }
.sort-by select, .price-btn, .clear-all { border-radius: 8px; }
.clear-all { color: var(--accent); background: transparent; border: none; }
.price-btn { background: transparent; border: 1px solid rgba(0,0,0,0.06); color: var(--text); }
.view-all-categories { color: var(--accent); }

.product-card-small { transition: transform .18s ease, box-shadow .18s ease; }
.product-card-small:hover { transform: translateY(-6px); box-shadow: 0 22px 44px rgba(12,12,14,0.08); }

.product-card-small .price { color: var(--text); font-size: 16px; }
.product-card-small .original-price { color: var(--muted); }

footer { background: transparent; color: var(--muted); }
footer .footer-section h3 { color: var(--text); font-weight:600; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* subtle inputs/buttons */
select, input[type="range"] { border-radius: 8px; }

/* keep share modal icons crisp */
.share-modal .share-grid a .icon img { width:28px; height:28px; display:block; }

/* accessibility */
:focus { outline-color: var(--accent); outline-offset: 2px; }
