/**
 * 2007-2023 PrestaShop
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to http://www.prestashop.com for more information.
 *
 *  @author    WOW ! Presta <info@wow-presta.com>
 *  @copyright 2023 WOW ! Presta
 *  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 *  International Registered Trademark & Property of WOW ! Presta
 */
/* Ensuring the media gallery container is positioned relatively */
.media-gallery-container {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
    position: relative; /* So the filter can be placed on the top-right */
}

/* Update the filter to be positioned at the top-right */
.media-filter {
    position: absolute;
    top: 20px;
    left: 0px;
    z-index: 10;
    background-color: white;
    padding: 5px 10px;
    border-radius: 5px;
}

/* Image and video separate display */
.media-item {
    background: #fff;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
    display: inline-block;
    margin: 10px 0;
    box-sizing: border-box;
}

/* Ensure the images and videos fit properly */
.media-item img,
.media-item iframe,
.media-item video {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

/* Use grid for a responsive 4 items per row layout */
.media-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 items per row */
    gap: 15px;
}

/* For images */
.media-item img {
    height: 168px; /* Adjust as per your needs */
}

/* For videos */
.media-item iframe,
.media-item video {
    max-height: 200px; /* Adjust as per your needs */
}

/* Popup styling */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    max-width: 80%;
    max-height: 80%;
    background: #fff;
    padding: 20px;
    position: relative;
    text-align: center;
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #000;
    font-size: 30px;
    cursor: pointer;
}

.media-thumbnail {
    cursor: pointer;
}

/* Tabs styling */
.media-tabs {
    margin-top: 50px;
    list-style-type: none;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.tab {
    cursor: pointer;
    padding: 10px 15px;
    background: #ddd;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.tab:hover {
    background-color: #aaa;
}

.tab.active {
    background-color: #007bff;
    color: white;
}

/* Make videos inside the popup bigger */
.popup-content iframe{
    width: 700px; /* Set the width to 500px */
    height: 500px;
    max-width: 100%;
}
.popup-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
}

#media-popup {
    display: none;
}

@media only screen and (max-width: 768px) {
  .media-grid{
  	    grid-template-columns: repeat(2, 1fr);
  }

  .popup-content iframe{
    height: auto;
    }
}

@media only screen and (max-width: 768px) {
  .media-filter{
    position: static;
    margin-bottom: 15px;
  }
  .media-tabs{
    margin-top: 0px;
    display: grid;
    justify-content: center;
    grid-template-columns: repeat(3, 1fr);
  }
}