/* eBay Store Widget — Frontend Styles
   Tuned to match Damans of Witham site:
   Fonts: Red Hat Display / Roboto
   Navy: #0f1d38  |  Red: #e53e3e  |  Grey bg: #d1d1d1
*/

/* ── Loading ─────────────────────────────────── */
.esw-aw-wrap.esw-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 40px 0;
    color: #0f1d38;
    font-family: Roboto, Arial, sans-serif;
    font-size: 0.95rem;
}
.esw-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #d1d1d1;
    border-top-color: #0f1d38;
    border-radius: 50%;
    animation: esw-spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes esw-spin { to { transform: rotate(360deg); } }

/* ── Grid ────────────────────────────────────── */
.esw-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(3, 1fr);
}
.esw-cols-1 { grid-template-columns: 1fr; }
.esw-cols-2 { grid-template-columns: repeat(2, 1fr); }
.esw-cols-3 { grid-template-columns: repeat(3, 1fr); }
.esw-cols-4 { grid-template-columns: repeat(4, 1fr); }
.esw-cols-5 { grid-template-columns: repeat(5, 1fr); }
.esw-cols-6 { grid-template-columns: repeat(6, 1fr); }

.esw-layout-list { grid-template-columns: 1fr; }
.esw-layout-list .esw-card { flex-direction: row; }
.esw-layout-list .esw-card-img { width: 160px; flex-shrink: 0; }

@media (max-width: 900px) {
    .esw-cols-4, .esw-cols-5, .esw-cols-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
    .esw-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 16px; }
}
@media (max-width: 420px) {
    .esw-grid { grid-template-columns: 1fr !important; }
}

/* ── Card ────────────────────────────────────── */
.esw-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
}
.esw-card:hover {
    box-shadow: 0 6px 24px rgba(15, 29, 56, 0.12);
    transform: translateY(-3px);
    text-decoration: none !important;
    color: inherit;
}

/* Hover overlay */
.esw-card::after {
    content: 'View on eBay →';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0f1d38;
    color: #fff;
    text-align: center;
    padding: 10px;
    font-family: Roboto, Arial, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.esw-card:hover::after {
    opacity: 1;
    transform: translateY(0);
}

/* Image */
.esw-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
}
.esw-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.esw-card:hover .esw-card-img img {
    transform: scale(1.04);
}
.esw-no-img {
    color: #bbb;
    font-size: 0.8rem;
    font-family: Roboto, Arial, sans-serif;
}

/* Card body */
.esw-card-body {
    padding: 14px 16px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.esw-card-title {
    margin: 0;
    font-family: Roboto, Arial, sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.45;
    color: #0f1d38;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.esw-card-price {
    margin: 0;
    font-family: 'Red Hat Display', Arial, sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #e53e3e;
}
.esw-card-condition {
    display: inline-block;
    font-size: 0.72rem;
    font-family: Roboto, Arial, sans-serif;
    background: #f0f5fb;
    color: #0f1d38;
    padding: 3px 8px;
    border-radius: 3px;
    margin-top: auto;
    align-self: flex-start;
}

/* ── Pagination ──────────────────────────────── */
.esw-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
    font-family: Roboto, Arial, sans-serif;
}
.esw-page-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: #0f1d38;
    color: #fff !important;
    border: none;
    border-radius: 3px;
    font-family: Roboto, Arial, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.18s ease;
    text-decoration: none !important;
}
.esw-page-btn:hover {
    background: #e53e3e;
    color: #fff !important;
}
.esw-page-btn:disabled,
.esw-page-btn[disabled] {
    background: #d1d1d1;
    color: #999 !important;
    cursor: not-allowed;
}
.esw-page-info {
    font-size: 0.875rem;
    color: #0f1d38;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
}

/* ── Notices / Errors ────────────────────────── */
.esw-error, .esw-notice {
    padding: 14px 18px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: Roboto, Arial, sans-serif;
    margin: 16px 0;
    line-height: 1.5;
}
.esw-error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
}
.esw-notice {
    background: #f0f5fb;
    border: 1px solid #9eb8e6;
    color: #0f1d38;
}
.esw-notice a, .esw-error a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

/* ── Buying option badges ────────────────────── */
.esw-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    z-index: 2;
}
.esw-badge {
    display: inline-block;
    font-family: Roboto, Arial, sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    line-height: 1.4;
}
.esw-badge-bin {
    background: #0f1d38;
    color: #fff;
}
.esw-badge-offer {
    background: #e53e3e;
    color: #fff;
}
.esw-badge-auction {
    background: #2b6cb0;
    color: #fff;
}

/* ── Shipping info ───────────────────────────── */
.esw-card-shipping {
    margin: 0;
    font-family: Roboto, Arial, sans-serif;
    font-size: 0.78rem;
    color: #555;
}
