/* ── Grid layout — override WooCommerce float-based grid ─── */

.ramco-courses ul.products,
.ramco-classes ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    align-items: stretch;
    /* clear WooCommerce float/clearfix approach */
    float: none !important;
}

/* Courses grid: fixed 4-column layout per the client mock, stepping down
   to 3 columns on tablet. The classes grid above keeps its auto-fill
   behaviour untouched. */
.ramco-courses ul.products {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

@media (max-width: 1100px) {
    .ramco-courses ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

/* WooCommerce adds ::before { content:" "; display:table } for clearfix.
   In a grid container, pseudo-elements become grid items and steal a cell.
   Suppress both so no ghost column appears. */
.ramco-courses ul.products::before,
.ramco-courses ul.products::after,
.ramco-classes ul.products::before,
.ramco-classes ul.products::after {
    content: none !important;
    display: none !important;
}

/* nullify WooCommerce's float+width layout on individual items */
.ramco-courses ul.products li.product,
.ramco-classes ul.products li.product {
    float: none !important;
    margin: 0 !important;
    width: 100% !important;
    clear: none !important;
}

/* ── Ramco card ───────────────────────────────────────────── */

.ramco-courses ul.products li.product.ramco-card,
.ramco-classes ul.products li.product.ramco-card {
    display: flex !important;
    flex-direction: column;
    background: #fff;
    border: 1px solid #c8d6e0 !important;
    border-radius: 4px;
    padding: 0 !important;
    overflow: hidden;
}

/* Courses card shell: lighter border + soft shadow + hover lift, per the
   client mock. Scoped to .ramco-courses so the classes grid above is
   untouched. */
.ramco-courses ul.products li.product.ramco-card {
    border: 1px solid #dce4ed !important;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 52, 100, 0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ramco-courses ul.products li.product.ramco-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 52, 100, 0.12);
}

/* ── Body ─────────────────────────────────────────────────── */

.ramco-card__body {
    flex: 1;
    padding: 1.1rem 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
}

.ramco-card__title {
    font-size: 1rem !important;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.5rem !important;
}

.ramco-card__title a {
    color: inherit;
    text-decoration: none;
}

.ramco-card__title a:hover {
    text-decoration: underline;
}

.ramco-card__desc {
    font-size: 0.88rem;
    color: #444;
    line-height: 1.55;
    margin: 0 0 0.75rem;
    flex: 1;
}

.ramco-card__price {
    font-size: 0.92rem;
    font-weight: 600;
    color: #222;
    margin: 0;
}

/* ── Footer / button ──────────────────────────────────────── */

.ramco-card__footer {
    padding: 0.75rem 1.25rem 1.25rem;
}

/* !important required: GeneratePress outputs inline CSS in <head>
   that sets a.button { background-color: #55555e } after our file loads */
.ramco-card__btn.button,
.ramco-card__btn.button:visited {
    display: block !important;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    background-color: #0c73c8 !important;
    color: #fff !important;
    border-color: #0c73c8 !important;
}

.ramco-card__btn.button:hover,
.ramco-card__btn.button:focus {
    background-color: #0a5fa8 !important;
    border-color: #0a5fa8 !important;
    color: #fff !important;
}

/* ── Course filters ([ramco_courses_filters]) ───────────────
   One-row layout per the client mock (courses.html .filter-grid), wrapping
   to multiple rows on narrower screens rather than the browser default of
   each label/control stacking on its own line. */

.ramco-course-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin: 0 0 1.5rem;
}

.ramco-course-filters__field {
    /* Deliberately block (not flex) layout for the label/control stack:
       Mobile Safari doesn't reliably stretch form controls (input/select)
       to fill a flex container's cross axis, which let the native
       type="date" control render at its own intrinsic width and overflow
       past this field's column on iPhone. Block layout has no such quirk,
       since width: 100% on the control resolves against a normal
       containing block. overflow: hidden is a hard backstop: iOS Safari's
       native date control can ignore width/max-width outright and keep
       its own intrinsic render width, so this clips it to the field
       regardless — the native date PICKER popup is OS-level UI and isn't
       affected by this. */
    display: block;
    overflow: hidden;
    flex: 1 1 140px;
    min-width: 130px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #445;
}

.ramco-course-filters__field > span {
    display: block;
    margin-bottom: 0.3rem;
}

.ramco-course-filters__field--search {
    flex: 2 1 220px;
    min-width: 200px;
}

.ramco-course-filters__search,
.ramco-course-filters__date,
.ramco-course-filters select {
    min-height: 45px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #d5dfe9;
    border-radius: 5px;
    background: #fff;
    padding: 0 0.8rem;
    font-size: 0.9rem;
    color: #222;
}

.ramco-course-filters__search:focus,
.ramco-course-filters__date:focus,
.ramco-course-filters select:focus {
    outline: none;
    border-color: #0c73c8;
    box-shadow: 0 0 0 3px rgba(12, 115, 200, 0.12);
}

.ramco-course-filters button[type="submit"],
.ramco-course-filters__clear {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    padding: 0 1.25rem;
    border-radius: 5px;
    white-space: nowrap;
    cursor: pointer;
}

/* Secondary style — the "Filter" submit button is a JS-optional fallback
   (see ramco-course-filters.js), so it's kept visually subordinate to the
   primary "Clear filters" action beside it. */
.ramco-course-filters button[type="submit"] {
    border: 1px solid #d5dfe9;
    background: #fff;
    color: #222;
    font-weight: 600;
}

.ramco-course-filters button[type="submit"]:hover,
.ramco-course-filters button[type="submit"]:focus {
    border-color: #0c73c8;
    color: #0c73c8;
}

/* Styled to look like the clear-filters <button> in the mock while staying
   an <a>, so it still works as a plain GET link if JS fails to load —
   the same no-JS fallback [ramco_classes_filters]'s clear link relies on. */
.ramco-course-filters__clear {
    background: #0c73c8;
    color: #fff !important;
    font-weight: 700;
    text-decoration: none !important;
}

.ramco-course-filters__clear:hover,
.ramco-course-filters__clear:focus {
    background: #0a5fa8;
    color: #fff !important;
}

@media (max-width: 600px) {
    .ramco-course-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .ramco-course-filters__field,
    .ramco-course-filters__field--search {
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* ── M1 card number input (unrelated to cards) ────────────── */

#m1-card-number {
    background-color: #fff;
    border: 1px solid #000;
    border-radius: 3px;
    height: 40px;
    padding: 0 8px;
    box-sizing: border-box;
}
