/* Gallery Container */
.wcpp-gallery{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:40px;
  max-width:1200px;
  margin:0 auto;
}

/* Individual Gallery Item */
.wcpp-item{
  list-style:none;
  text-align:center;
}

/* Thumbnail Button Styling */
button.wcpp-thumb-btn {
    background: none !important;
    padding: 0 !important;
}

/* Thumbnail Image Wrapper */
.wcpp-thumb-img{
  display: flex;
  align-items: center;
  justify-content: center;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  transition: none;
  padding: 0;
  background-color: #e5e5e5;
}
.wcpp-thumb-img:hover {
  background-color: #e5e5e5 !important;
  padding: 5px !important;
}

/* Thumbnail Image */
.wcpp-thumb-img img{
  object-fit: cover !important;
  width: 100% !important;
  height: auto;
  aspect-ratio: 1 / 1; /* Enforce square aspect ratio */
}
.wcpp-thumb-img img:hover {
  object-fit: contain !important; /* Change fit on hover to show the full image */
}

/* Text elements */
.wcpp-caption { margin-top:17px; font-size:14px; color:#333; }
.wcpp-title{ 
  display:block;
  margin-bottom: 10px;
  font-size: 22px;
  font-style: normal;
}
.wcpp-excerpt{ display:block; color:#666; font-size:17px; margin-top:4px; }

/* Modal styles - High Z-Index for overlays */
.wcpp-modal{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(0,0,0,0.95);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:999999; /* Ensure modals are on top of everything */
  padding:20px;
  box-sizing:border-box;
  backdrop-filter: blur(5px);
}

/* Ensure modals are on top of other high z-index elements */
#wcpp-lightbox-modal,
#wcpp-print-modal {
  z-index: 1000000 !important;
}

.wcpp-modal-inner{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:100%;
}


/* Lightbox specific inner container */
.wcpp-lightbox-inner{
  background:transparent !important;
  box-shadow:none !important;
  max-width:100% !important;
  max-height:100% !important;
  width:100% !important;
  height:100% !important;
  margin:0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}

/* Close Button */
.wcpp-modal-close{
  position:absolute;
  right:25px;
  top:25px;
  background:none;
  border:none;
  font-size:36px;
  cursor:pointer;
  color:white;
  z-index:1000001;
  width:50px;
  height:50px;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0.9;
  transition: opacity 0.3s ease;
  text-shadow:0 2px 4px rgba(0,0,0,0.5);
}

.wcpp-modal-close:hover{
  opacity:1;
}

/* Navigation Arrows for Lightbox */
.wcpp-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  font-size: 40px;
  line-height: 1;
  padding: 10px 15px;
  cursor: pointer;
  z-index: 1000001;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  border-radius: 4px;
}

.wcpp-nav-arrow:hover {
  opacity: 1;
}

.wcpp-nav-prev {
  left: 20px;
}

.wcpp-nav-next {
  right: 20px;
}

/* Lightbox main content wrapper */
.wcpp-lightbox-content{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  max-width:100%;
  width:100%;
  height:100%;
  text-align:center;
  padding:40px 20px;
}

/* Lightbox Image Container */
.wcpp-lightbox-media{
  text-align:center;
  margin-bottom:30px;
  max-width:90vw;
  flex-shrink:0;
}

.wcpp-lightbox-media img{
  max-width:100%;
  max-height:70vh;
  width:auto;
  height:auto;
  object-fit:contain;
  display:block;
  margin:0 auto;
  border-radius:0 !important;
}

/* Lightbox Text Info (Title/Caption) */
.wcpp-lightbox-info{
  text-align:center;
  color:white;
  max-width:600px;
  margin:0 auto;
  flex-shrink:0;
}

.wcpp-lightbox-info h3{
  margin:0 0 10px 0;
  font-size:22px;
  color:white;
}

.wcpp-lightbox-info p{
  margin:0 0 30px 0;
  font-size:16px;
  color:rgba(255,255,255,0.9);
}

/* Lightbox Button Wrapper (to hold print button and licensing link) */
.wcpp-lightbox-button-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Choose Print Button */
.wcpp-choose-print{
  background:var(--ast-global-color-1) !important;
  color:var(--ast-global-color-5) !important;
  border:none !important;
  padding: 10px 20px !important;
  border-radius:0 !important;
  cursor:pointer !important;
  font-size: 16px !important;
  text-decoration:none !important;
  display:inline-block !important;
  width:180px !important;
  margin:0 auto !important;
  font-weight:500 !important;
  transition: all 0.3s ease !important;
  text-transform: uppercase !important;
}

.wcpp-choose-print:hover{
  background:var(--ast-global-color-3) !important;
}

/* Licensing Link inside the Lightbox */
.wcpp-licensing-lightbox {
  margin-top: 20px; 
  text-align: center;
}

.wcpp-licensing-lightbox a {
  color: white; 
  text-decoration: underline;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.wcpp-licensing-lightbox a:hover {
  opacity: 1;
}

/* Print modal specific inner styles */
.wcpp-print-inner{
  background:#fff !important;
  border-radius:12px;
  max-width:800px;
  width:90%;
  max-height:85vh;
  overflow-y:auto;
  box-shadow:0 20px 60px rgba(0,0,0,0.3);
  margin:auto !important;
  display:flex !important;
  flex-direction:column !important;
  position:relative !important;
  transform: none !important;
  top: auto !important;
  left: auto !important;  
  justify-content:flex-start;
}

.wcpp-print-content{
  padding:40px;
  flex:1;
}

.wcpp-print-content h3{
  margin-top:0;
  margin-bottom:30px;
  text-align:center;
  font-size:1.6em;
  color:#333;
  font-weight:600;
}

/* WooCommerce form styles (specific to print modal) */
.wcpp-photo-form{
  display:flex;
  flex-direction:column;
  gap:25px;
}

.wcpp-photo-preview{
  text-align:center;
  border-radius:8px;
  overflow:hidden;
}

.wcpp-photo-preview img{
  max-width:100%;
  height:auto;
  max-height:250px;
  object-fit:contain;
  border-radius:6px;
}

.wcpp-photo-form .variations_form{
  margin:0;
}

.wcpp-photo-form .single_variation_wrap{
  margin-top:20px;
}

.wcpp-photo-form .woocommerce-variation-add-to-cart{
  display:flex;
  gap:15px;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  margin-top:20px;
}

.wcpp-photo-form .quantity{
  margin:0 !important;
}

/* Custom Add-to-Cart Button */
.wcpp-photo-form .wcpp-add-to-cart-button{
  padding: 10px 20px !important;
  font-size:16px !important;
  background:var(--ast-global-color-1) !important;
  border:none !important;
  font-weight:500 !important;
}

.wcpp-photo-form .wcpp-add-to-cart-button:hover{
  background:var(--ast-global-color-3) !important;
}

/* Cart message notification (Success/Error) */
.wcpp-cart-message{
  position:fixed;
  top:20px;
  right:20px;
  background:#4CAF50;
  color:white;
  padding:15px 25px;
  border-radius:6px;
  z-index:1000002;
  font-weight:600;
  box-shadow:0 4px 12px rgba(0,0,0,0.15);
  display:none;
}

/* Pagination (Generic style) */
.wcpp-pagination {  
  width: 100%;
  display: flex;
  justify-content: center;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  margin: 30px 0 0 0;
  padding: 10px;
  flex-wrap: wrap;
}

.wcpp-pagination a,
.wcpp-pagination .current {
  margin: 2px; 
  padding: 0 3px;
  text-decoration:none;
  transition: all 0.3s ease;
  border: 0;
  font-size: 1em;
}

.wcpp-pagination a:hover{
  background-color: #f5f6f8;
}

/* Current/Active page styles */
.wcpp-pagination .current,
.wcpp-pagination span.current { 
  font-weight: bold;
}


/* Responsive: tablet 2 columns, mobile 1 column */
@media (max-width:900px){
  .wcpp-gallery{ grid-template-columns: repeat(2, 1fr); }
  .wcpp-thumb-btn{ max-width:100%; height:auto; aspect-ratio: 1/1; }
  .wcpp-nav-arrow { font-size: 30px; }
  .wcpp-nav-prev { left: 10px; }
  .wcpp-nav-next { right: 10px; }
}

@media (max-width:600px){
  .wcpp-gallery{ grid-template-columns: repeat(1, 1fr); }
  .wcpp-thumb-btn{ max-width:100%; height:auto; aspect-ratio: 1/1; }

  .wcpp-lightbox-info h3{
    font-size:1.5em;
  }

  .wcpp-lightbox-info p{
    font-size:1.1em;
  }

  .wcpp-print-content{
    padding:25px 20px;
  }

  .wcpp-modal{
    padding:10px;
  }

  .wcpp-modal-close{
    right:15px;
    top:15px;
    font-size:28px;
    width:40px;
    height:40px;
  }

  .wcpp-lightbox-content{
    padding:20px 15px;
  }

  .wcpp-nav-arrow { font-size: 24px; padding: 5px 10px; }
  .wcpp-nav-prev { left: 5px; }
  .wcpp-nav-next { right: 5px; }
}

/* Ensure proper centering and display */
.wcpp-modal[style*="display: flex"] {
  display: flex !important;
}

/* Ensure the inner wrapper occupies full modal space */
.wcpp-lightbox-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* WooCommerce table styles for variations */
.wcpp-photo-form table.variations {
  width: 100%;
  margin-bottom: 20px;
  border-collapse: collapse;
  border: 0;
}

.wcpp-photo-form table.variations td {
  padding: 12px 0;
  vertical-align: top;
  border: 0;
}

.wcpp-photo-form table.variations td.label {
  width: 35%;
  padding-right: 20px;
  font-weight: 600;
  color: #333;
  text-align: left;
}

.wcpp-photo-form table.variations td.value {
  width: 65%;
}

.wcpp-photo-form table.variations select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  font-size: 14px;
}

.wcpp-photo-form .reset_variations {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: #007cba;
  text-decoration: none;
}

.wcpp-photo-form .reset_variations:hover {
  text-decoration: underline;
}

/* Ensure WooCommerce variation details are styled and always visible */
.wcpp-photo-form .woocommerce-variation {
  text-align: center;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 6px;
  margin-bottom: 15px;
  display: block !important; /* KEY FIX: Always display the single_variation wrapper */
}

/* KEY FIX: Force hide the stock availability and default availability messages */
.woocommerce-variation .stock, 
.wcpp-photo-form .woocommerce-variation-availability {
  display: none !important;
}

.wcpp-print-shipping-vat {
  display: flex;
  flex-direction: column;
  align-items: center;
}


.wcpp-print-shipping,
.wcpp-print-vat {
  font-size: 17px; 
  margin: 5px 0;
}

.wcpp-print-shipping {
}

.wcpp-print-licensing {
  text-align: center; 
  margin: 20px 0; 
}

/* Styling for the main product description / print info */
.wcpp-print-info {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid #eee;
  font-size: 0.95em;
  line-height: 1.6;
  color: #555;
  text-align: justify;
}

.wcpp-print-info .wp-block-kadence-column:hover {
  outline:0 !important;
}

.wcpp-photo-form .woocommerce-variation-price {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}

/* Prevent body scroll when modal is open */
body.wcpp-modal-open {
  overflow: hidden;
}

/* Add to cart button loading state */
.wcpp-photo-form .wcpp-add-to-cart-button {
    font-family: 'Roboto', sans-serif !important;
    text-transform: uppercase !important;
}

.wcpp-photo-form .wcpp-add-to-cart-button.loading {
  position: relative;
}

.wcpp-photo-form .wcpp-add-to-cart-button.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 0;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-right-color: transparent;
  animation: wcpp-spin 0.6s linear infinite;
}

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

/* Order item photo info */
.wcpp-order-photo-info {
  margin-top: 5px;
  font-size: 0.9em;
  color: #666;
}

.wcpp-order-photo-info a {
  color: #007cba;
  text-decoration: none;
}

.wcpp-order-photo-info a:hover {
  text-decoration: underline;
}

/* Cart item styles for photo thumbnails */
.woocommerce-cart-form .product-thumbnail img,
.woocommerce-checkout-review-order-table .product-thumbnail img {
  border-radius: 4px;
  object-fit: cover;
}

.woocommerce-js a.remove {
  top: 3px !important;
}

p.delivery-time-info {
  font-size: .8em;
  font-weight: 400;
  margin: .3em 0;
  opacity: .7;
}

.woocommerce-order .wcpp-delivery-meta {
  display: none;
}

.woocommerce-order ul.wc-item-meta {
  padding-left: 0;
  font-size: 16px;
}


/* Keep original style to hide form stock messages */
#wcpp-print-modal .stock {
  display: none;
}


/* Search functionality styles */
.wcpp-search-input-wrapper {
    display: flex;
    gap: 10px;
    margin: 0 0 25px;
    align-items: center;
    justify-content: center;
}

input#wcpp-search-input {
    padding-top: 8px;
    padding-bottom: 8px;
    padding-left: 12px;
    padding-right: 10px;
}

.wcpp-search-button {
    font-size: 22px !important;
    padding-top: 8px;
    padding-bottom: 8px;
    padding-left: 12px;
    padding-right: 10px;
    line-height: 1;
}
.wcpp-search-button svg {
    height: 1em;
    width: .9em;
    margin-top: 3px;
    margin-right: 2px;
    fill: currentColor;
}

/* Hide search input on actual search results page if needed */
body.search.search-results .wcpp-search-input-wrapper {
  display: none;
}