/* ==========================================================================
   ALAR INSTITUTE - COURSE SHOP COMPONENT STYLES
   Designed to integrate with Mahesh Public School Original Template
   ========================================================================== */

/* --- Courses Grid Layout --- */
.course-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-top: 30px;
}
@media (max-width: 991px) {
    .course-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .course-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Course Card --- */
.course-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}
.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(10, 92, 56, 0.12);
    border-color: #0a5c38;
}

.course-media {
    position: relative;
    height: 180px;
    background: #eaeaea;
}
.course-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.course-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #0a5c38;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.course-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.course-body h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1b3a5c;
    margin: 0 0 10px;
    line-height: 1.3;
}
.course-category-label {
    display: inline-block;
    color: #0a5c38;
    background: #e8f5ee;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    width: fit-content;
    margin-bottom: 12px;
}
.course-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #666666;
    margin-bottom: 12px;
}
.course-meta span i {
    color: #f0a500;
    margin-right: 4px;
}
.course-body p {
    font-size: 14px;
    color: #555555;
    line-height: 1.5;
    margin: 0 0 18px;
}

/* Price & Button Action */
.course-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    border-top: 1px solid #edf2f7;
    padding-top: 14px;
    margin-bottom: 12px;
}
.course-price {
    font-size: 20px;
    font-weight: 800;
    color: #0a5c38;
}
.course-price-row del {
    font-size: 13px;
    color: #888888;
}

/* General Buttons */
.shop-btn {
    background: #0a5c38 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 10px 22px !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    text-decoration: none !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
}
.shop-btn:hover {
    background: #f0a500 !important;
    color: #1a1a1a !important;
    text-decoration: none !important;
}
.shop-btn.gold {
    background: #f0a500 !important;
    color: #1a1a1a !important;
}
.shop-btn.gold:hover {
    background: #0a5c38 !important;
    color: #ffffff !important;
    text-decoration: none !important;
}
.shop-btn.light {
    background: #ffffff !important;
    border: 1px solid #cbd5e0 !important;
    color: #1b3a5c !important;
}
.shop-btn.light:hover {
    background: #e2e8f0 !important;
    color: #1b3a5c !important;
    text-decoration: none !important;
}

.subject-link {
    width: 100% !important;
    text-align: center !important;
    background: #f7fafc !important;
    border: 1px solid #edf2f7 !important;
    padding: 8px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #1b3a5c !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    display: block !important;
    text-decoration: none !important;
}
.subject-link:hover {
    background: #e8f5ee !important;
    border-color: #0a5c38 !important;
    color: #0a5c38 !important;
    text-decoration: none !important;
}

/* ==========================================================================
   DETAILS MODAL SYSTEM
   ========================================================================== */
.course-details-modal {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100000;
}
.course-details-modal.open {
    display: flex;
}
.course-details-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(27, 58, 92, 0.7);
    backdrop-filter: blur(3px);
}
.course-details-dialog {
    position: relative;
    width: min(800px, 100%);
    max-height: calc(100vh - 40px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 48px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlide 0.3s ease;
    z-index: 10;
}
@keyframes modalSlide {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.course-details-close {
    position: absolute;
    right: 14px;
    top: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    color: #1b3a5c;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 100;
}
.course-details-close:hover {
    background: #e74c3c;
    color: #ffffff;
}

.modal-header-banner {
    position: relative;
    height: 160px;
    background: #1b3a5c;
    flex-shrink: 0;
}
.modal-header-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.75;
}
.modal-header-info {
    position: absolute;
    bottom: 20px;
    left: 24px;
    right: 24px;
    color: #ffffff;
}
.modal-header-info h2 {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    line-height: 1.3;
}
.modal-header-meta {
    font-size: 11px;
    color: #f0a500;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
    display: block;
}

.modal-tab-navs {
    display: flex;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    overflow-x: auto;
}
.modal-tab-nav {
    padding: 12px 20px;
    font-weight: 700;
    font-size: 13px;
    color: #4a5568;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}
.modal-tab-nav:hover {
    color: #0a5c38;
}
.modal-tab-nav.active {
    color: #0a5c38;
    border-bottom-color: #0a5c38;
}

.modal-tab-panels {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
}
.modal-tab-panel {
    display: none;
}
.modal-tab-panel.active {
    display: block;
}

/* Accordions */
.subject-item-custom {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}
.subject-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #ffffff;
    cursor: pointer;
    font-weight: 700;
    color: #1b3a5c;
    font-size: 14px;
}
.subject-header-custom:hover {
    color: #0a5c38;
}
.subject-body-custom {
    padding: 14px 18px;
    border-top: 1px solid #e2e8f0;
    font-size: 13px;
    color: #555555;
    line-height: 1.6;
}

/* Demo Videos Grid */
.demo-video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.demo-video-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
.video-thumbnail-wrap {
    position: relative;
    height: 120px;
    background: #000;
}
.video-thumbnail-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}
.video-play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 38px;
    background: rgba(0,0,0,0.25);
    cursor: pointer;
    transition: all 0.2s;
}
.video-play-btn:hover {
    color: #f0a500;
    background: rgba(0,0,0,0.4);
}
.video-title-bar {
    padding: 10px 12px;
}
.video-title-bar h4 {
    font-size: 13.5px;
    font-weight: 700;
    color: #1b3a5c;
    margin: 0 0 3px;
}
.video-title-bar span {
    font-size: 11px;
    color: #777777;
    font-weight: 600;
}

/* PDF Lists */
.pdf-download-list-custom {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pdf-download-row-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.pdf-info-part {
    display: flex;
    align-items: center;
    gap: 10px;
}
.pdf-info-part div strong {
    font-size: 13px;
    color: #1b3a5c;
    display: block;
}
.pdf-info-part div span {
    font-size: 11px;
    color: #777777;
}

.modal-footer-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.modal-price-part {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.modal-price-part strong {
    font-size: 24px;
    color: #0a5c38;
    font-weight: 800;
}
.modal-price-part del {
    font-size: 13px;
    color: #777777;
}

/* ==========================================================================
   CART TABLE & CHECKOUT LAYOUT
   ========================================================================== */
.empty-cart {
    text-align: center;
    padding: 40px 20px;
    background: #ffffff;
    border: 1px dashed #cbd5e0;
    border-radius: 12px;
}
.empty-cart i {
    font-size: 48px;
    color: #cbd5e0;
    margin-bottom: 12px;
}
.empty-cart h3 {
    color: #1b3a5c;
    margin-bottom: 6px;
}
.empty-cart p {
    color: #718096;
    margin-bottom: 16px;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}
.cart-table th, .cart-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.cart-table th {
    background: #f7fafc;
    font-weight: 700;
    color: #1b3a5c;
    font-size: 13px;
    text-transform: uppercase;
}
.cart-table td {
    font-size: 14.5px;
}
.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    overflow: hidden;
}
.qty-control button {
    border: none;
    background: #f7fafc;
    width: 28px;
    height: 28px;
    font-weight: 700;
    cursor: pointer;
}
.qty-control button:hover {
    background: #e2e8f0;
}
.qty-control span {
    width: 32px;
    text-align: center;
    font-weight: 700;
}

/* Order Summary */
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #edf2f7;
    font-size: 14px;
    color: #4a5568;
}
.summary-row.total {
    border-bottom: none;
    font-weight: 800;
    font-size: 18px;
    color: #0a5c38;
}

@media (max-width: 767px) {
    .demo-video-grid {
        grid-template-columns: 1fr;
    }
    .cart-table thead {
        display: none;
    }
    .cart-table tr {
        display: block;
        border-bottom: 2px solid #edf2f7;
        padding: 12px 0;
    }
    .cart-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: none;
        padding: 6px 0;
    }
    .cart-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #718096;
        font-size: 11px;
        text-transform: uppercase;
    }
}
