/*
Theme Name: Durham Rose
Version: 1.0.0
Template: Divi
Author: InterScot Network Ltd
Author URI: https://interscot.net
Description: Durham Rose website design
Text Domain: durhamrose
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

body {
  overflow-x: hidden; /* Prevent side-to-side scrolling  */
}

.show-when-empty {
	display: block !important;
}

/* Custom CSS for Divi Gallery Module Slider Images */
.dr-image-slider-400 .et_pb_gallery_items .et_pb_gallery_item .et_pb_gallery_image img {
  width: 100%;
  height: 100%; /* Make the image take 100% height of its parent container */
  min-height: 400px; /* Set a minimum height for the image itself */
  object-fit: cover;
  object-position: center center;
}

.dr-image-slider-400 .et_pb_gallery_items {
  display: flex;
  align-items: center;
  height: 400px; /* Example: If you want the whole module to be 300px tall */
  overflow: hidden; /* Hide any overflow if images are significantly larger */
}

.dr-image-slider-500 .et_pb_gallery_items .et_pb_gallery_item .et_pb_gallery_image img {
  width: 100%;
  height: 100%; /* Make the image take 100% height of its parent container */
  min-height: 500px; /* Set a minimum height for the image itself */
  object-fit: cover;
  object-position: center center;
}

.dr-image-slider-500 .et_pb_gallery_items {
  display: flex;
  align-items: center;
  height: 500px; /* Example: If you want the whole module to be 300px tall */
  overflow: hidden; /* Hide any overflow if images are significantly larger */
}

#testimonials-carousel .dica-image-container, .dica-image-container > .image {
  height: -webkit-fill-available;
}

#testimonials-carousel .dica-image-container, .dica-image-container > .image > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.mega-menu-visible #et-main-area {
  filter: brightness(0.8);
}

/* ------------------------------------------ */

/* Custom Divi Portfolio Module Grid */
.custom-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.custom-portfolio-item {
  background: #fff;
  overflow: hidden; /* Ensures the image corners are rounded if you add border-radius */
}

.custom-portfolio-item a {
  text-decoration: none;
  color: #333;
  display: block;
}

.custom-portfolio-item .portfolio-item-image {
  line-height: 0; /* Removes any space below the image */
}

.custom-portfolio-item img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.custom-portfolio-item h3 {
  padding: 15px 20px;
  margin: 0;
  font-size: 18px;
  text-align: center;
  background: #f9f9f9;
}

/* Custom Portfolio Pagination Styles */
.custom-portfolio-pagination {
  margin-top: 40px;
  text-align: center;
}

.custom-portfolio-pagination .page-numbers {
  display: inline-block;
  padding: 8px 16px;
  margin: 0 4px;
  border: 1px solid #ddd;
  color: #333;
  text-decoration: none;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.custom-portfolio-pagination .page-numbers:hover {
  background-color: #f5f5f5;
  border-color: #ccc;
}

.custom-portfolio-pagination .page-numbers.current {
  background-color: #0073e6; /* Divi's default blue */
  border-color: #0073e6;
  color: #fff;
  cursor: default;
}

.custom-portfolio-pagination .page-numbers.dots {
  border: none;
  background: none;
  padding: 8px 4px;
}

/* ==========================================================================
ACF Portfolio Gallery Module Styles
========================================================================== */

/* 1. The main grid container */
.custom-acf-gallery-grid-container {
  display: grid;
  /* The column count is set by a CSS variable from the module */
  grid-template-columns: repeat(var(--gallery-column-count, 3), 1fr);
  grid-gap: 15px;
}

/* 2. Individual gallery items */
.custom-acf-gallery-item {
  position: relative;
  line-height: 0; /* Prevents extra space below the image */
}

/* 3. Image styling */
.custom-acf-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* 4. Divi's overlay for the lightbox hover effect */
.custom-acf-gallery-item .et_overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0);
  transition: background-color 0.3s;
}

.custom-acf-gallery-item:hover .et_overlay {
  background-color: rgba(0, 0, 0, 0.4);
}

/* 5. The "+" icon on hover */
.custom-acf-gallery-item:hover .et_overlay:after {
  content: "\e037"; /* Divi's search/plus icon */
  font-family: "ETmodules";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 32px;
  line-height: 1;
}

/* ==========================================================================
Disable Divi Lightbox Zoom Animation (Aggressive Override)
========================================================================== */

/*
* This rule targets the main content wrapper of the lightbox.
* It forcibly disables all CSS `animation` and `transition` effects
* to ensure the image appears instantly without any movement or fading.
*/
.mfp-wrap.et_pb_mfp_zoom_in .mfp-container .mfp-content {
  animation: none !important;
  transition: none !important;
}

/* --- Final Portfolio Filter Styles (Standard Checkbox) --- */

/* 1. Main Filter Bar Wrapper */
#acf-portfolio-filter-form-wrapper {
  background: #f8f9fa;
  padding: 10px 20px;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 30px;

  /* --- FIX: Create a new stacking context --- */
  position: relative;
  z-index: 20; /* This needs to be higher than the z-index of the section below it */
}

#acf-portfolio-filter-form {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dropdown-filters-nav {
  display: flex;
  gap: 20px;
}

/* 2. Individual Dropdown Styles */
.filter-dropdown {
  position: relative;
}

/* Clickable 'Metal', 'Style' buttons */
.filter-toggle {
  background: none;
  border: none;
  padding: 10px 5px;
  font-size: 16px;
  font-weight: 500;
  color: #495057;
  cursor: pointer;
  transition: color 0.2s ease;
}

.filter-toggle:hover,
.filter-dropdown.is-active .filter-toggle {
  color: #000;
}

/* The Pure CSS Arrow */
.filter-toggle::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 8px;
  vertical-align: middle;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #333; /* This creates the down arrow */
  border-bottom: 0;
  transition: transform 0.2s ease-in-out;
}

/* Flip the arrow to point UP when active */
.filter-dropdown.is-active .filter-toggle::after {
  transform: rotate(180deg);
}

/* 3. The Dropdown Panel Itself */
.dropdown-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 99999; /* <-- Increased z-index */
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-radius: 5px;
  padding: 20px;
  width: 420px;
}

/* Show the panel when the dropdown is active */
.filter-dropdown.is-active .dropdown-panel {
  display: block;
}

/* 4. The Grid Container for the Options */
.dropdown-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}

/* 5. The Individual Filter Option (The Grid Item) */
.filter-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 15px;
  min-width: 0;
}

/* 6. The Standard Checkbox Itself */
.filter-option input[type="radio"] {
  /* Make the standard checkbox visible and add spacing */
  display: inline-block;
  margin-right: 12px;
  /* Prevent it from shrinking */
  flex-shrink: 0;
}

/* 7. The Label Text */
.filter-option .option-label {
  display: inline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* No padding-left needed as the checkbox margin handles spacing */
}

/* 8. The 'Clear Filters' Button */
#filter-reset-button {
  background: #74567a;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

#filter-reset-button:hover {
  background: #927d96;
}

/* 9. Loading Indicator for AJAX */
#portfolio-grid-container .loading-spinner {
  text-align: center;
  padding: 50px;
  font-size: 20px;
  color: #999;
}

/* --- 10. Active Filter Indicator Styles --- */

/* Style for the filter button when a filter in its group is selected */
.filter-dropdown .filter-toggle.filter-active {
  color: #74567a;
  text-decoration: underline;
  text-decoration-thickness: 1.5px; /* Optional: makes the underline a bit bolder */
  text-underline-offset: 5px;   /* Optional: adds a little space between text and underline */
}

.filter-dropdown-active-parent {
    z-index: 10 !important;
}

/* ACF Product Filters — cleaned, consolidated styles */

/* Bar */
.acfpf-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important; /* ensure dropdowns aren't clipped */
}

/* Items */
.acfpf-item {
  position: relative;
  flex: 0 0 auto;
}

/* Toggle (title) */
.acfpf-toggle {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .6rem .35rem;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #333;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
  border-bottom: 1px solid #e6e6e6 !important; /* underline */
}
.acfpf-toggle:hover,
.acfpf-item.open .acfpf-toggle {
  background: transparent !important;
  border-bottom-color: #cfcfcf !important;
}
/* Selected accent (purple) */
.acfpf-item.has-selected .acfpf-toggle {
  border-bottom-color: #74567a !important;
}
/* Keyboard focus */
.acfpf-toggle:focus-visible {
  outline: 2px solid #74567a;
  outline-offset: 2px;
}

/* Count badge */
.acfpf-count[aria-hidden="true"] { display: none; }
.acfpf-count {
  display: inline-block;
  min-width: 1.25em;
  height: 1.25em;
  padding: 0 .35em;
  border-radius: 999px;
  font-size: .78em;
  line-height: 1.25em;
  text-align: center;
  background: #74567a !important;
  color: #fff;
}

/* Caret */
.acfpf-caret {
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #666;
  margin-left: .1rem;
}

/* Dropdown menu */
.acfpf-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 320px;
  max-height: 60vh;
  overflow: auto;
  padding: .5rem;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,.08);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}
.acfpf-item.open .acfpf-menu {
  opacity: 1; visibility: visible; transform: translateY(0); transition-delay: 0s;
}
/* Also open on hover for pointer devices */
@media (hover: hover) and (pointer: fine) {
  .acfpf-item:hover .acfpf-menu {
    opacity: 1; visibility: visible; transform: translateY(0); transition-delay: 0s;
  }
}

/* Dropdown list reset + options */
.acfpf-menu .acfpf-list,
.acfpf-menu .acfpf-list > li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.acfpf-menu .acfpf-list > li::marker { content: '' !important; }

.acfpf-option { margin: 0; }
.acfpf-option label {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .25rem;
  cursor: pointer;
  border-radius: 4px;
}
.acfpf-option label:hover { background: #f7f7f7; }
.acfpf-option input[type="checkbox"] { accent-color: #74567a; }

/* Loading spinner on products module during AJAX swaps */
.et_pb_wc_products.acfpf-loading,
.et_pb_woo_products.acfpf-loading,
.et_pb_shop.acfpf-loading,
.woocommerce ul.products.acfpf-loading {
  position: relative;
  opacity: .6;
  transition: opacity .2s ease;
}
.et_pb_wc_products.acfpf-loading::after,
.et_pb_woo_products.acfpf-loading::after,
.et_pb_shop.acfpf-loading::after,
.woocommerce ul.products.acfpf-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(0,0,0,.15);
  border-top-color: rgba(0,0,0,.55);
  animation: acfpf-spin .8s linear infinite;
}
@keyframes acfpf-spin { to { transform: rotate(360deg); } }

/* Square corners for filter dropdown menus (override previous rounded corners) */
.acfpf-menu {
  border-radius: 0 !important;
}

/* Optional: make individual option hover states square as well */
.acfpf-option label {
  border-radius: 0 !important;
}

/* WooCommerce sorting dropdown (.orderby) — match ACFPF filter title style, no purple outline */

/* Base: plain text with subtle underline, custom caret on the right */
form.woocommerce-ordering select.orderby,
select.orderby {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: transparent !important;

  border: 0 !important;
  border-radius: 0 !important;
  border-bottom: 1px solid #e6e6e6 !important;

  padding: .45rem 1.6rem .35rem .6rem; /* right padding leaves room for caret */
  color: #333;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;

  /* Down arrow caret (matches filter titles) */
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23666' d='M1 0l4 4 4-4 1 1-5 5L0 1z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .45rem center;
  background-size: 10px 6px;
}

/* Hover: slightly darker underline, like .acfpf-toggle:hover */
form.woocommerce-ordering select.orderby:hover,
select.orderby:hover {
  border-bottom-color: #cfcfcf !important;
}

/* Focus: remove purple outline; keep subtle underline cue */
form.woocommerce-ordering select.orderby:focus,
select.orderby:focus {
  outline: none !important;
  box-shadow: none !important;
  border-bottom-color: #cfcfcf !important;
}

/* Remove default arrow in old IE/Edge */
form.woocommerce-ordering select.orderby::-ms-expand,
select.orderby::-ms-expand {
  display: none;
}

/* Optional: keep ordering form compact inside Divi modules */
.et_pb_wc_products form.woocommerce-ordering,
.et_pb_shop form.woocommerce-ordering {
  margin: 0;
  display: inline-block;
}

.button-secondary {
	font-size: 16px;
	background-color: white;
	border: 1px solid #74567a;
	border-radius: 100px;
	line-height: 36.8px;
	padding: 0px 20px;
	vertical-align: middle;
	text-align: center;
}

.d-inline-block {
	display: inline-block;
}

.w-50 {
	width: 50%;
}



/* WooCommerce - Lifestyle block on product category pages */
/* 1. Style the Custom Block */
.woocommerce ul.products li.product.custom-lifestyle-block {
  /* Force it to start a new row (Row 4) */
  clear: both !important;
  float: left !important;
  /* WIDTH CALCULATION for 4-Column Grid:
  (Product Width * 2) + Gutter
  Standard Divi: (22.05% * 2) + 3.9% = ~48% */
  width: 48% !important;
  /* Maintain the gutter to the right so product 13 doesn't touch it */
  margin-right: 3.9% !important;
  /* Reset standard margins */
  margin-left: 0 !important;
  /* Visual Styling */
  background-color: #f7f7f7;
  box-sizing: border-box;
  align-items: center;
  text-align: center;
  min-height: 300px; /* Matches typical product height */
}

/* 2. Ensure inner content is contained */
.custom-lifestyle-block .et_pb_module {
  width: 100%;
}

/* 3. Hide the dummy fix completely */
.woocommerce ul.products li.product.dummy-product-fix {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  clear: none !important;
}

/* --- RESPONSIVENESS --- */
/* Tablet: Divi usually switches to 2 columns here */
@media only screen and (max-width: 980px) {
  .woocommerce ul.products li.product.custom-lifestyle-block {
    width: 100% !important; /* Make it full width on tablet */
    margin-right: 0 !important;
  }
}

/* Mobile */
@media only screen and (max-width: 767px) {
  .woocommerce ul.products li.product.custom-lifestyle-block {
    width: 100% !important;
    margin-bottom: 30px !important;
  }
}

/* 
  Targets the link wrapping each gallery image within the module that has your custom class.
  It disables all mouse events, including clicks, which prevents the lightbox from opening.
*/
.disable-lightbox .et_pb_gallery_image a {
   pointer-events: none;
}

/* 
  Finds and completely hides the hover overlay (the icon that appears when you mouse over an image).
  The `!important` flag ensures this style will override any of Divi's default styles.
*/
.disable-lightbox .et_pb_gallery_image .et_overlay {
   display: none !important;
}