.learndash-course-grid .items-wrapper .grid-2 .post {
    line-height: 1.428571429;
    background-color: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 4px;
    -webkit-transition: all 0.2s ease-in-out;
    transition: all 0.2s ease-in-out;
    display: inline-block;
    max-width: 100%;
    height: auto;
    display: block;
    position: relative;
    padding: 0;
    margin: 0;
    box-shadow: 2px 2px 2px 1px rgb(0 0 0 / 5%);
    -moz-box-shadow: 2px 2px 2px 1px rgb(0 0 0 / 5%);
    -webkit-box-shadow: 2px 2px 2px 1px rgb(0 0 0 / 5%);
}

.learndash-course-grid .items-wrapper .grid-2 .ribbon {
    text-shadow: 0 1px rgb( 0 0 0 / 30% );
    position: absolute;
    z-index: 2;
    top: 20px;
    right: 15px;
    left: auto;
    padding: 10px 12px;
    border-radius: 6px;
    color: #fff;
    background: #0f69aa;
    font-weight: bold;
    font-size: 1rem;
}

.learndash-course-grid .items-wrapper .grid-2 .ribbon::before {}

.learndash-course-grid .items-wrapper .grid-2 .thumbnail {
    margin: 0;
    padding: 0;
    position: relative;
}

.learndash-course-grid .items-wrapper .grid-2 .thumbnail img {
    margin: 0 auto;
    padding: 0;
    width: 100%;
    height: auto;
}

.learndash-course-grid .items-wrapper .grid-2 .thumbnail .arrow {
    position: absolute;
    right: 10px;
    bottom: -18px;
    left: initial;
    top: initial;
    overflow: visible;
    z-index: 1000;
    height: auto;
    width: auto;
    margin: 0;
    padding: 0;
    border-radius: 100px;
}

.learndash-course-grid .items-wrapper .grid-2 .thumbnail .arrow a {
    border-radius: 100px;
    display: block;
}

.learndash-course-grid .items-wrapper .grid-2 .thumbnail .arrow * {
    text-decoration: none;
}

.learndash-course-grid .items-wrapper .grid-2 .thumbnail .arrow .dashicons {
    background: #fd9752;
    color: #fff;
    font-size: 25px;
    width: auto;
    height: auto;
    padding: 5px;
    border-radius: 100px;
}

.learndash-course-grid .items-wrapper .grid-2 .content {
    padding: 30px 22px;
    color: #333333;
}

.learndash-course-grid .items-wrapper .grid-2 .content>*:not(:last-child) {
    margin-bottom: 20px;
}

.learndash-course-grid .items-wrapper .grid-2 .content .author {
    display: flex;
    gap: 15px;
}

.learndash-course-grid .items-wrapper .grid-2 .content .author .avatar {
    width: 43px;
    height: 43px;
    border-radius: 30px;
    display: block;
}

.learndash-course-grid .items-wrapper .grid-2 .content .author .wrapper {
    display: grid;
    width: 100%;
}

.learndash-course-grid .items-wrapper .grid-2 .content .author .name {
    font-weight: bold;
    font-size: 1rem;
}

.learndash-course-grid .items-wrapper .grid-2 .content .author .wrapper .lessons {
    float: right;
}

.learndash-course-grid .items-wrapper .grid-2 .content .entry-title {
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1.2;
    color: #333;
}

.learndash-course-grid .items-wrapper .grid-2 .content .entry-title a {
    text-decoration: none;
    color: #333;
    font-size: 1.2rem;
    line-height: 1.2;
    font-weight: bold;
}

.learndash-course-grid .items-wrapper .grid-2 .content .entry-content {
    margin-bottom: 20px;
    color: #949ca1;
    font-size: 0.875rem;
}

.learndash-course-grid .items-wrapper .grid-2 .content .entry-content>* {
    margin: 0;
}

.learndash-course-grid .items-wrapper .grid-2 .content .author {
    font-size: 0.875rem;
    color: #949ca1;
}

.learndash-course-grid .items-wrapper .grid-2 .content .button {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    border-radius: 5px;
    width: 100%;
}

.learndash-course-grid .items-wrapper .grid-2 .content .button a {
    color: #ffffff;
    font-weight: bold;
    text-decoration: none;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    text-align: center;
    display: -ms-flexbox;
    display: flex;
    justify-content: center;
    -ms-flex-align: center;
    align-items: center;
    cursor: pointer;
    background-color: #143f5e;
    border-color: #143f5e;
    border-radius: 5px;
    font-size: 1rem;
    padding: 12px 0;
}

.learndash-course-grid .items-wrapper .grid-2 .content .button a:hover {
    background: #29648f;
    border-color: #29648f;
}

.video {
    display: flex;
    justify-content: center;
    aspect-ratio: 16 / 9;
    background: black;
}

/* Prevent background scroll when lightbox open */
body.ld-vl--open {
    overflow: hidden;
}

/* Lightbox shell (hidden by default) */
#ld-video-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    /* above most themes */
    pointer-events: none;
}

/* Backdrop */
#ld-video-lightbox .ld-vl__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    opacity: 0;
    transition: opacity .2s ease;
}

@media screen and (max-width: 768px) {
    #ld-video-lightbox .ld-vl__backdrop {
        background: rgba(0, 0, 0, 1) !important;
    }
}

/* Dialog */
#ld-video-lightbox .ld-vl__dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%);
    /* start slightly up for subtle motion */
    width: min(90vw, 1000px);
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
    overflow: hidden;
    opacity: 0;
    transition: transform .2s ease, opacity .2s ease;
}

@media screen and (max-width: 768px) {
    #ld-video-lightbox .ld-vl__dialog {
        width: 100vw !important;
        border-radius: 0px !important;
        height: 75vh;
    }
}

/* Visible state driven by body class */
body.ld-vl--open #ld-video-lightbox {
    pointer-events: auto;
}

body.ld-vl--open #ld-video-lightbox .ld-vl__backdrop {
    opacity: 1;
}

body.ld-vl--open #ld-video-lightbox .ld-vl__dialog {
    opacity: 1;
    transform: translate(-50%, -50%);
}

/* Content wrapper ensures iframe fills */
#ld-video-lightbox .ld-vl__content,
#ld-video-lightbox .ld-vl__content iframe,
#ld-video-lightbox .ld-vl__content video {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

/* Close button */
#ld-video-lightbox .ld-vl__close {
    position: absolute;
    padding: 24px;
    top: .5rem;
    right: .5rem;
    z-index: 2;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.ld-video-trigger {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: inherit;
    cursor: pointer;
}

.ld-video-trigger img {
    aspect-ratio: 16 / 9;
    width: 100%;
    object-fit: cover;
    display: block;
}

.ld-video-trigger__badge {
    position: absolute;
    inset: 0;
    /* display: grid;
    place-items: center; */
    pointer-events: none;
    transform: translate(44%, 41%);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .5));
}

.ld-video-trigger__badge .dashicons {
    font-size: 48px;
    line-height: 1;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .5));
}

/* Card Actions Layout */
.ld-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.ld-card-actions .button {
  flex: 1;
  min-width: 120px;
}

.primary-button a,
.ld-btn,
.ld-add-to-cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

/* Primary button (course access) */
.primary-button a {
  background: #007cba;
  color: white;
}

.primary-button a:hover {
  background: #005a87;
}

/* Add to cart button */
.ld-add-to-cart-btn {
  background: #143f5e;
  color: white;
}

.ld-add-to-cart-btn:hover {
  background: #29648f;
}

.ld-add-to-cart-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.ld-add-to-cart-btn .dashicons {
  width: 16px;
  height: 16px;
  font-size: 16px;
}

/* Loading state */
.ld-add-to-cart-btn.loading {
  position: relative;
}

.ld-add-to-cart-btn.loading .dashicons-update-alt {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Checkout Confirmation Dialog */
.ld-checkout-confirm {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
}

.ld-checkout-confirm__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ld-checkout-confirm--active .ld-checkout-confirm__backdrop {
  opacity: 1;
}

.ld-checkout-confirm__dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: white;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  transition: transform 0.3s ease;
}

.ld-checkout-confirm--active .ld-checkout-confirm__dialog {
  transform: translate(-50%, -50%) scale(1);
}

.ld-checkout-confirm__content {
  padding: 30px;
  text-align: center;
}

.ld-checkout-confirm__content h3 {
  margin: 0 0 15px 0;
  color: #2c3e50;
  font-size: 20px;
}

.ld-checkout-confirm__content p {
  margin: 0 0 25px 0;
  color: #666;
  line-height: 1.5;
}

.ld-checkout-confirm__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.ld-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.ld-btn--primary {
  background: #007cba;
  color: white;
}

.ld-btn--primary:hover {
  background: #005a87;
}

.ld-btn--secondary {
  background: #f8f9fa;
  color: #6c757d;
  border: 1px solid #e9ecef;
}

.ld-btn--secondary:hover {
  background: #e9ecef;
  color: #495057;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ld-card-actions {
    flex-direction: column;
  }

  .ld-card-actions .button {
    flex: none;
    width: 100%;
  }

  .ld-checkout-confirm__dialog {
    max-width: 350px;
    margin: 20px;
  }

  .ld-checkout-confirm__content {
    padding: 25px;
  }

  .ld-checkout-confirm__actions {
    flex-direction: column;
  }

  .ld-btn {
    width: 100%;
  }
}

/* Success state animation */
@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.ld-add-to-cart-btn.success {
  animation: successPulse 0.3s ease;
}

/* Grid item positioning context */
.item.grid-2 {
  position: relative;
}

/* Style adjustments for better button integration */
.ld-card-actions .button a,
.ld-card-actions .button button {
  font-family: inherit;
  line-height: 1.4;
}

/* Ensure buttons have consistent height */
.primary-button a,
.ld-add-to-cart-btn {
  min-height: 44px;
}

/* Free product styling */
.ld-add-to-cart-btn[data-is-free="true"] {
  background: var(--global-palette-btn-bg);
  color: white;
}

.ld-add-to-cart-btn[data-is-free="true"]:hover {
  background: var(--global-palette-btn-bg-hover);
}

/* Focus states for accessibility */
.ld-add-to-cart-btn:focus,
.primary-button a:focus {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

/* Ensure proper spacing in card content */
.content > .ld-card-actions {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #f0f0f0;
}

small.tag {
    background-color: #fd9752;
    border-radius: 25px;
    padding: 5px 10px;
    color: white;
    margin-right: 10px !important;
}
