/* ============================================
   CONTAINER
   ============================================ */
.sdp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ============================================
   FILTERS
   ============================================ */
.sdp-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.sdp-filters h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.sdp-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.sdp-filter-group {
    display: flex;
    flex-direction: column;
}

.sdp-filter-group label {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
    color: #555;
}

.sdp-filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
}

.sdp-filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sdp-button, .sdp-button-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.sdp-button {
    background: #0073aa;
    color: white;
}

.sdp-button:hover {
    background: #005a87;
}

.sdp-button-secondary {
    background: #f1f1f1;
    color: #333;
}

.sdp-button-secondary:hover {
    background: #e1e1e1;
}

/* ============================================
   TOP AREA - Text Descriptions
   ============================================ */
.sdp-top-area {
    margin-bottom: 40px;
}

.sdp-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

/* ============================================
   TEXT DESCRIPTIONS - CONTAINER
   ============================================ */
.sdp-text-descriptions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
}

/* ============================================
   STACK LAYOUT - One on top of another
   ============================================ */
.sdp-text-descriptions.sdp-layout-stack {
    flex-direction: column !important;
}

.sdp-text-descriptions.sdp-layout-stack .sdp-text-item {
    width: 100% !important;
    flex: 1 1 100% !important;
    max-width: 100% !important;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 15px;
}

.sdp-text-descriptions.sdp-layout-stack .sdp-text-item:last-child {
    margin-bottom: 0;
}

/* ============================================
   GRID LAYOUT - Side by side
   ============================================ */
.sdp-text-descriptions.sdp-layout-grid {
    flex-direction: row !important;
    flex-wrap: wrap !important;
}

.sdp-text-descriptions.sdp-layout-grid .sdp-text-item {
    flex: 1 1 calc(33.33% - 20px) !important;
    max-width: calc(33.33% - 20px) !important;
    min-width: 280px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 15px;
    box-sizing: border-box;
}

/* For 2 columns */
.sdp-text-descriptions.sdp-layout-grid.sdp-grid-2 .sdp-text-item {
    flex: 1 1 calc(50% - 20px) !important;
    max-width: calc(50% - 20px) !important;
}

/* For 3 columns (default) */
.sdp-text-descriptions.sdp-layout-grid.sdp-grid-3 .sdp-text-item {
    flex: 1 1 calc(33.33% - 20px) !important;
    max-width: calc(33.33% - 20px) !important;
}

/* For 4 columns */
.sdp-text-descriptions.sdp-layout-grid.sdp-grid-4 .sdp-text-item {
    flex: 1 1 calc(25% - 20px) !important;
    max-width: calc(25% - 20px) !important;
}

/* For 5 columns */
.sdp-text-descriptions.sdp-layout-grid.sdp-grid-5 .sdp-text-item {
    flex: 1 1 calc(20% - 20px) !important;
    max-width: calc(20% - 20px) !important;
}

/* For 6 columns */
.sdp-text-descriptions.sdp-layout-grid.sdp-grid-6 .sdp-text-item {
    flex: 1 1 calc(16.66% - 20px) !important;
    max-width: calc(16.66% - 20px) !important;
}

/* ============================================
   LIST LAYOUT - Line by line
   ============================================ */
.sdp-text-descriptions.sdp-layout-list {
    flex-direction: column !important;
}

.sdp-text-descriptions.sdp-layout-list .sdp-text-item {
    background: transparent !important;
    border: none !important;
    padding: 6px 0 !important;
    margin-bottom: 0 !important;
    border-bottom: 1px solid #e8e8e8 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: 100% !important;
}

.sdp-text-descriptions.sdp-layout-list .sdp-text-item:last-child {
    border-bottom: none !important;
}

.sdp-text-descriptions.sdp-layout-list .sdp-text-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.sdp-text-descriptions.sdp-layout-list .sdp-text-content {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.sdp-text-descriptions.sdp-layout-list .sdp-text-content p {
    margin: 0;
}

/* ============================================
   TEXT ITEM COMMON STYLES
   ============================================ */
.sdp-text-item {
    margin-bottom: 15px;
    box-sizing: border-box;
}

.sdp-text-item:last-child {
    margin-bottom: 0;
}

.sdp-text-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-top: 0;
    margin-bottom: 10px;
}

.sdp-text-content {
    color: #555;
    line-height: 1.6;
}

.sdp-text-content img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   FORMAT 2: TEXT WITH IMAGE - Split Top/Bottom
   ============================================ */
.sdp-text-with-image {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-sizing: border-box;
}

.sdp-text-top {
    flex: 1;
}

.sdp-text-bottom {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.sdp-text-bottom img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}

/* ============================================
   FORMAT 1: IMAGE POPUP STYLES
   ============================================ */

/* Popup Button Style - Format 1 */
.sdp-popup-btn {
    display: inline-block;
    padding: 12px 30px;
    background: #0073aa;
    color: #fff !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s, transform 0.2s;
    text-decoration: none !important;
    text-align: center;
    min-width: 120px;
}

.sdp-popup-btn:hover {
    background: #005a87;
    transform: translateY(-2px);
    color: #fff !important;
}

.sdp-popup-btn:active {
    transform: translateY(0);
}

/* Image Popup Link */
.sdp-image-popup {
    display: inline-block;
    cursor: pointer;
    text-decoration: none;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sdp-image-popup img {
    display: block;
    max-width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.sdp-image-popup:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.sdp-image-popup:hover img {
    transform: scale(1.02);
}

/* ============================================
   IMAGE POPUP OVERLAY - FORMAT 1
   ============================================ */
.sdp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.sdp-popup-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.sdp-popup-container .sdp-popup-image {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    border-radius: 4px;
}

.sdp-popup-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #dc3545;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.sdp-popup-close:hover {
    background: #c82333;
}

.sdp-popup-caption {
    text-align: center;
    padding: 10px 0 0 0;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   SPLIT LAYOUT - Text left, Media right
   ============================================ */
.sdp-split-layout {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.sdp-split-left {
    flex: 1 1 50%;
    min-width: 300px;
}

.sdp-split-right {
    flex: 1 1 40%;
    min-width: 280px;
}

/* ============================================
   MEDIA ITEMS - FIXED!
   ============================================ */
.sdp-middle-area {
    margin-bottom: 40px;
}

/* ============================================
   MEDIA - CONTAINER
   ============================================ */
.sdp-media-items {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
}

/* Media Stack Layout - FIXED */
.sdp-media-items.sdp-layout-stack {
    flex-direction: column !important;
}

.sdp-media-items.sdp-layout-stack .sdp-media-item {
    width: 100% !important;
    flex: 1 1 100% !important;
    max-width: 100% !important;
}

/* Media Grid Layout - FIXED */
.sdp-media-items.sdp-layout-grid {
    flex-direction: row !important;
    flex-wrap: wrap !important;
}

.sdp-media-items.sdp-layout-grid .sdp-media-item {
    flex: 1 1 calc(50% - 20px) !important;
    max-width: calc(50% - 20px) !important;
    min-width: 280px;
}

/* ============================================
   MEDIA ITEM COMMON STYLES
   ============================================ */
.sdp-media-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    margin-bottom: 0;
    box-sizing: border-box;
}

.sdp-media-item:last-child {
    margin-bottom: 0;
}

.sdp-media-image {
    width: 100%;
    height: auto;
    display: block;
}

.sdp-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.sdp-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.sdp-media-caption {
    padding: 15px;
}

.sdp-media-caption h3 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 16px;
    color: #333;
}

.sdp-media-caption p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* ============================================
   BOTTOM AREA - Action Buttons
   ============================================ */
.sdp-bottom-area {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    text-align: center;
    margin-top: 20px;
}

.sdp-bottom-area h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

.sdp-action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.sdp-action-buttons .sdp-btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    min-width: 160px;
    text-align: center;
}

.sdp-action-buttons .sdp-btn:hover:not(.disabled) {
    transform: translateY(-2px);
}

.sdp-action-buttons .sdp-btn:active:not(.disabled) {
    transform: translateY(0);
}

.sdp-btn-booking {
    background: #0073aa;
    color: #fff;
}

.sdp-btn-booking:hover:not(.disabled) {
    background: #005a87;
    color: #fff;
}

.sdp-btn-booking.disabled,
.sdp-btn-booking:disabled {
    background: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    transform: none !important;
    opacity: 0.6;
}

.sdp-btn-cart {
    background: #28a745;
    color: #fff;
}

.sdp-btn-cart:hover:not(.disabled) {
    background: #218838;
    color: #fff;
}

.sdp-btn-cart.disabled,
.sdp-btn-cart:disabled {
    background: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    transform: none !important;
    opacity: 0.6;
}

/* ============================================
   MISC
   ============================================ */
.sdp-loading {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: #666;
}

.sdp-cart-message {
    padding: 10px 20px;
    border-radius: 4px;
    margin-top: 15px;
    display: none;
}

.sdp-cart-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.sdp-cart-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Custom Button Style for Text Content */
.sdp-custom-btn {
    display: inline-block;
    padding: 8px 20px;
    background: #0073aa;
    color: #fff !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
}

.sdp-custom-btn:hover {
    background: #005a87;
    color: #fff !important;
}

/* LaTeX Math Styling */
.sdp-latex {
    font-family: 'Times New Roman', serif;
    font-style: italic;
    font-size: 1.1em;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #e9ecef;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .sdp-text-descriptions.sdp-layout-grid .sdp-text-item {
        flex: 1 1 calc(50% - 20px) !important;
        max-width: calc(50% - 20px) !important;
    }
    
    .sdp-text-descriptions.sdp-layout-grid.sdp-grid-2 .sdp-text-item,
    .sdp-text-descriptions.sdp-layout-grid.sdp-grid-3 .sdp-text-item,
    .sdp-text-descriptions.sdp-layout-grid.sdp-grid-4 .sdp-text-item,
    .sdp-text-descriptions.sdp-layout-grid.sdp-grid-5 .sdp-text-item,
    .sdp-text-descriptions.sdp-layout-grid.sdp-grid-6 .sdp-text-item {
        flex: 1 1 calc(50% - 20px) !important;
        max-width: calc(50% - 20px) !important;
    }
}

@media (max-width: 768px) {
    .sdp-filter-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .sdp-text-descriptions.sdp-layout-grid .sdp-text-item {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
    }
    
    .sdp-text-descriptions.sdp-layout-grid.sdp-grid-2 .sdp-text-item,
    .sdp-text-descriptions.sdp-layout-grid.sdp-grid-3 .sdp-text-item,
    .sdp-text-descriptions.sdp-layout-grid.sdp-grid-4 .sdp-text-item,
    .sdp-text-descriptions.sdp-layout-grid.sdp-grid-5 .sdp-text-item,
    .sdp-text-descriptions.sdp-layout-grid.sdp-grid-6 .sdp-text-item {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
    
    .sdp-media-items.sdp-layout-grid .sdp-media-item {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
    }
    
    .sdp-split-left,
    .sdp-split-right {
        flex: 1 1 100%;
    }
    
    .sdp-action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .sdp-action-buttons .sdp-btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .sdp-filter-row {
        grid-template-columns: 1fr;
    }
    
    .sdp-filter-actions {
        flex-direction: column;
    }
    
    .sdp-filter-actions .sdp-button,
    .sdp-filter-actions .sdp-button-secondary {
        width: 100%;
        text-align: center;
    }
    
    .sdp-popup-container {
        max-width: 95vw;
        padding: 15px;
    }
    
    .sdp-popup-close {
        top: -10px;
        right: -10px;
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}


