/*
 Theme Name:   Astra Child
 Theme URI:    https://www.my4by.com/
 Description:  A MY4BY child theme for Astra
 Author:       MY4BY
 Author URI:   https://yourwebsite.com/
 Template:     astra
 Version:      1.0.0
 Text Domain:  astra-child
*/

/* Change primary color to a bold purple */
:root {
    --ast-global-color-0: #6b48ff;
}

/* Update header font */
.site-title {
    font-family: 'Georgia', serif;
    font-size: 36px;
    color: #333;
}

/* Customize button styles */
.woocommerce #respond input#submit, 
.woocommerce a.button {
    background-color: #BB2A0D; /* Deep reddish-brown */
    border-radius: 25px;
    color: white;
}
.woocommerce #respond input#submit:hover, 
.woocommerce a.button:hover {
    background-color: #ff4500; /* Brighter red on hover */
}

/* Ensure Astra container is full-width and centered */
.ast-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Style the parent categories container (homepage) */
.ast-container .parent-categories {
    width: 100%;
    text-align: center;
    padding: 20px 0;
}

/* Style the child categories container (category pages) */
.ast-container .child-categories {
    width: 100%;
    text-align: center;
    padding: 20px 0;
}

/* Style the heading for both parent and child categories */
.ast-container .parent-categories h2,
.ast-container .child-categories h2 {
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
}

/* Style the category list as 3 columns for both parent and child categories */
.ast-container .parent-categories ul.category-list,
.ast-container .child-categories ul.category-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 900px;
    -webkit-column-count: 3;
    -moz-column-count: 3;
    column-count: 3;
    -webkit-column-gap: 40px;
    -moz-column-gap: 40px;
    column-gap: 40px;
    -webkit-column-fill: balance;
    -moz-column-fill: balance;
    column-fill: balance;
    text-align: left;
}

/* Style list items */
.ast-container .parent-categories ul.category-list li,
.ast-container .child-categories ul.category-list li {
    margin-bottom: 15px;
    -webkit-column-break-inside: avoid;
    -moz-column-break-inside: avoid;
    column-break-inside: avoid;
}

/* Style links */
a {
    color: #BB2A0D; /* Deep reddish-brown */
    text-decoration: none;
    transition: color 0.3s;
}
a:hover {
    color: #ff4500; /* Brighter red on hover */
}

/* Fix WooCommerce Add to cart button color */
.woocommerce ul.products li.product a.button.add_to_cart_button,
.woocommerce ul.products li.product button.button.add_to_cart_button,
.woocommerce div.product form.cart .button.single_add_to_cart_button {
    background-color: #BB2A0D !important; /* Deep reddish-brown */
    color: #fff !important;
    border: 2px solid #000000 !important; /* Black outline */
    border-radius: 25px;
    padding: 10px 20px;
    text-transform: uppercase;
    font-weight: 600;
    box-sizing: border-box;
}

.woocommerce ul.products li.product a.button.add_to_cart_button:hover,
.woocommerce ul.products li.product button.button.add_to_cart_button:hover,
.woocommerce div.product form.cart .button.single_add_to_cart_button:hover {
    background-color: #ff4500 !important; /* Brighter red on hover */
    color: #fff !important;
    border: 2px solid #000000 !important; /* Keep black outline on hover */
}

/* Ensure other buttons (like Read more) aren’t affected */
.woocommerce a.button.product_type_simple:not(.add_to_cart_button) {
    background-color: #f28c38 !important;
    color: #fff !important;
}

/* Force consistent image sizes in the product grid */
.woocommerce ul.products li.product img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
}

/* Make product containers consistent height and align buttons at the bottom */
.woocommerce ul.products li.product {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 400px;
    padding-bottom: 10px;
}

/* Ensure the image and title take up the available space */
.woocommerce ul.products li.product .woocommerce-loop-product__link {
    flex-grow: 1;
}

/* Position the Add to cart button at the bottom */
.woocommerce ul.products li.product .button.add_to_cart_button {
    margin-top: auto;
    align-self: flex-start;
}

/* Style the Astra sale badge */
.ast-onsale-card {
    background-color: #EA1313 !important;
    color: #FFFFFF !important;
    border: none !important;
    font-weight: bold !important;
    padding: 12px 16px !important;
    border-radius: 50% !important;
    font-size: 18px !important;
    line-height: 1 !important;
    box-shadow: 5px 5px 5px rgb(0, 0, 0) !important;
}

/* Responsive adjustments for categories */
@media (max-width: 768px) {
    .ast-container .parent-categories ul.category-list,
    .ast-container .child-categories ul.category-list {
        -webkit-column-count: 2;
        -moz-column-count: 2;
        column-count: 2;
        max-width: 600px;
    }
}

@media (max-width: 480px) {
    .ast-container .parent-categories ul.category-list,
    .ast-container .child-categories ul.category-list {
        -webkit-column-count: 1;
        -moz-column-count: 1;
        column-count: 1;
        max-width: 300px;
    }
}

/* Responsive adjustments for product grid */
@media (max-width: 768px) {
    .woocommerce ul.products li.product {
        min-height: 350px;
    }
    .woocommerce ul.products li.product img {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .woocommerce ul.products li.product {
        min-height: 300px;
    }
    .woocommerce ul.products li.product img {
        height: 120px;
    }
}

/* AMAZON AFFILIATE DISCLAIMER */
.affiliate-disclaimer {
    font-size: 14px;
    color: #333;
    background-color: #f9f9f9;
    padding: 15px;
    margin: 20px 0;
    border-left: 4px solid #BB2A0D;
    line-height: 1.6;
}
.affiliate-disclaimer h3 {
    font-size: 18px;
    color: #BB2A0D;
    margin-top: 0;
    margin-bottom: 10px;
}
.affiliate-disclaimer p {
    margin: 0 0 10px;
}
.affiliate-disclaimer ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}
.affiliate-disclaimer ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
}
.affiliate-disclaimer ul li:before {
    content: "✔";
    position: absolute;
    left: 0;
    color: #BB2A0D;
    font-size: 16px;
}
.affiliate-disclaimer strong {
    color: #BB2A0D;
}
.affiliate-disclaimer em {
    font-style: italic;
    color: #666;
}

/* Search Page Styles */
.search-bar-wrapper {
    text-align: center;
    padding: 20px;
}
.search-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.search-input-container {
    width: 100%;
    max-width: 300px;
}
.search-field {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    font-size: 16px;
    box-sizing: border-box;
    margin: 0;
}
.search-field:focus {
    border-color: #0073aa;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.5);
}
.search-submit {
    padding: 10px 20px;
    border: 2px solid #ffd700;
    border-radius: 20px;
    background-color: #BB2A0D;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.3s;
}
.search-submit:hover {
    background-color: #ff4500;
}

/* Mobile Menu Styles */
@media (max-width: 921px) {
    .custom-mobile-menu ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    .custom-mobile-menu .menu-item {
        padding: 10px 15px;
        border-bottom: 1px solid #ddd;
    }
    .custom-mobile-menu .menu-item a {
        text-decoration: none;
        color: #BB2A0D;
    }
    .custom-mobile-menu .menu-item a:hover {
        color: #ff4500;
    }
    .custom-mobile-menu .header-search-bar {
        padding: 10px 15px;
    }
    .custom-mobile-menu .search-field {
        width: 100%;
        max-width: 200px;
    }
    .ast-mobile-menu-buttons ~ .main-header-bar-navigation,
    .ast-mobile-header .main-header-bar-navigation,
    .ast-mobile-popup-content .main-header-bar-navigation {
        display: none !important;
    }
}

/* Style for Proceed to Amazon Checkout Button */
.wc-block-cart__submit-button.contained {
    background-color: #FF9900; /* Amazon orange */
    border: 2px solid #000000; /* Black outline */
    border-radius: 25px; /* Rounded corners */
    color: #000000; /* Black text */
    padding: 10px 20px;
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    transition: background-color 0.3s;
}

.wc-block-cart__submit-button.contained:hover {
    background-color: #e68a00; /* Slightly darker orange on hover */
    color: #000000; /* Keep black text on hover */
    border: 2px solid #000000; /* Keep black outline on hover */
}







/* ---  TABLES AND TABLE-RELATED STYLES BELOW  --- */

/* Generic Table Styles (Shared Across All Tables) */
.generic-table {
  max-width: 100%;
  margin: 20px auto;
  overflow-x: auto;
  font-family: Arial, sans-serif;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}

/* Override parent container constraints for tables */
.site-content .generic-table {
  max-width: none !important;
  width: 100% !important;
  overflow-x: auto !important;
}

.site-content .generic-table .table-grid {
  max-width: none !important;
  width: auto !important;
}

/* Ensure no parent constraints interfere with the table layout */
.generic-table,
.generic-table * {
  box-sizing: border-box;
}

/* Generic Table Caption */
.generic-table .table-caption {
  text-align: center;
  font-size: 1.5em;
  font-weight: bold;
  margin-bottom: 10px;
  text-transform: uppercase;
  color: #1C2526;
}

/* Generic Styles for Section Headers and Subcategories */
.generic-table .table-section-header td,
.generic-table .table-section-header > div {
  background-color: #333;
  color: white;
  font-weight: bold;
  text-align: left;
  padding: 10px;
}

.generic-table .table-subcategory td,
.generic-table .table-subcategory > div {
  background-color: #e0e0e0;
  font-weight: bold;
  text-align: left;
  padding: 10px;
}

/* Footnotes */
.generic-table .footnote {
  font-size: 11px;
  margin-top: 10px;
  border-top: 1px solid #000;
  padding-top: 5px;
}

.generic-table sup {
  font-size: 10px;
  vertical-align: super;
}


/* Hide Repeated Years on Large Screens */
.generic-table .repeated-year {
  display: none;
}

/* Show Repeated Years on Small Screens */
@media (max-width: 767px) {
  .generic-table .repeated-year {
    display: inline;
  }
}





/******************  9 COLUMN TABLES ****************/

/* Generic 9-Column Table (e.g., Rancho) */
.generic-table.generic-table-9col table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #000;
}

.generic-table-9col th,
.generic-table-9col td {
  padding: 6px 8px;
  text-align: left;
  border: 1px solid #000;
  vertical-align: top;
}

.generic-table-9col th {
  background-color: #f5f5f5;
  font-weight: bold;
}

/* Center specific data columns (e.g., for Rancho) */
.generic-table-9col td:nth-child(3),
.generic-table-9col td:nth-child(4),
.generic-table-9col td:nth-child(5),
.generic-table-9col td:nth-child(6),
.generic-table-9col td:nth-child(7),
.generic-table-9col td:nth-child(8),
.generic-table-9col td:nth-child(9) {
  text-align: center;
}

/* Responsive Design for 9-Column Tables */
@media (max-width: 767px) {
  .generic-table.generic-table-9col table,
  .generic-table.generic-table-9col thead,
  .generic-table.generic-table-9col tbody,
  .generic-table.generic-table-9col th,
  .generic-table.generic-table-9col td,
  .generic-table.generic-table-9col tr {
    display: block;
  }

  .generic-table-9col thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .generic-table-9col tr {
    margin-bottom: 15px;
    border: 1px solid #000;
  }

  .generic-table.generic-table-9col td {
    border: none;
    position: relative;
    padding-left: 50%;
    padding-right: 10px;
    border-bottom: 1px solid #ddd;
    text-align: right;
  }

  .generic-table-9col td:before {
    position: absolute;
    left: 6px;
    content: attr(data-label);
    font-weight: bold;
    white-space: nowrap;
    text-align: left;
  }

  .generic-table-9col .table-section-header,
  .generic-table-9col .table-subcategory {
    display: block;
    padding-left: 6px;
    text-align: left;
  }

  .generic-table-9col .footnote {
    display: block;
    padding-left: 6px;
  }

  .generic-table-9col td:nth-child(3):before,
  .generic-table-9col td:nth-child(4):before,
  .generic-table-9col td:nth-child(5):before,
  .generic-table-9col td:nth-child(6):before,
  .generic-table-9col td:nth-child(7):before,
  .generic-table-9col td:nth-child(8):before,
  .generic-table-9col td:nth-child(9):before {
    text-align: left;
  }
}


/******************  8 COLUMN TABLES ****************/

/* 8-Column Table Layout for Desktop */
.generic-table-8col .table-grid {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ccc;
  background-color: #fff;
}

/* Style for Table Rows on Desktop */
.generic-table-8col .table-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(100px, 1fr));
  gap: 0;
}

/* Style for Table Headers and Data Cells on Desktop */
.generic-table-8col .table-header,
.generic-table-8col [data-label] {
  padding: 10px;
  text-align: center;
  box-sizing: border-box;
  white-space: normal;
  border: 0.5px solid #ccc;
  background-color: #fff;
  font-size: 14px;
}

/* Responsive Layout for Medium and Small Screens (≤1024px) */
@media (max-width: 1024px) {
  .generic-table-8col .table-grid {
    display: block;
    width: 100%;
  }

  .generic-table-8col .table-row {
    display: block;
    margin-bottom: 10px;
    border-bottom: 3px solid #1C2526;
  }

  .generic-table-8col .table-header-row {
    display: none;
  }

  .generic-table-8col .table-row > div:not(.table-header) {
    display: block;
    padding: 8px 10px 8px 40%;
    border-bottom: 1px solid #ddd;
    font-size: 16px;
    white-space: normal;
    position: relative;
    box-sizing: border-box;
    width: 100%;
    text-align: right; /* Align the values to the right */
  }

  .generic-table-8col .table-row > div:not(.table-header)::before {
    content: attr(data-label) ": ";
    position: absolute;
    left: 10px;
    top: 8px;
    font-weight: bold;
    color: #1C2526;
    white-space: nowrap;
    text-align: left;
    width: 30%;
    box-sizing: border-box;
  }

  .generic-table-8col .table-row > div:last-child:not(.table-header) {
    border-bottom: none;
  }
}

/* Style for Sub-Category Rows */
.generic-table-8col .colspan-8 {
  background-color: #f5f5f5;
  padding: 10px;
  font-weight: bold;
  text-align: center;
  border-top: 2px solid #1C2526;
  border-bottom: 2px solid #1C2526;
}


/******************  6 COLUMN TABLES ****************/

/* 6-Column Table Layout for Desktop */
.generic-table-6col .table-grid {
  display: block;
  width: 100%;
  min-width: 750px; /* Ensures readability on desktop */
  box-sizing: border-box;
  border: 1px solid #ccc;
  background-color: #fff;
}

/* Style for Table Rows on Desktop */
.generic-table-6col .table-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 0;
}

/* Style for Table Headers and Data Cells on Desktop */
.generic-table-6col .table-header,
.generic-table-6col [data-label] {
  padding: 10px;
  text-align: center;
  box-sizing: border-box;
  white-space: normal;
  border: 0.5px solid #ccc;
  background-color: #fff;
  font-size: 14px;
}

/* Link Styling */
/* .generic-table-6col a {
  color: #0066cc;
  text-decoration: underline;
} */

/* Responsive Layout for Medium and Small Screens (≤1024px) */
@media (max-width: 1024px) {
  .generic-table-6col .table-grid {
    display: block;
    width: 100%;
    min-width: 0; /* Reset for mobile */
  }

  .generic-table-6col .table-row {
    display: block;
    margin-bottom: 10px;
    border-bottom: 3px solid #1C2526;
  }

  .generic-table-6col .table-header-row {
    display: none;
  }

  .generic-table-6col .table-row > div:not(.table-header) {
    display: block;
    padding: 8px 10px 8px calc(100px + 10px);
    border-bottom: 1px solid #ddd;
    font-size: 16px;
    white-space: normal;
    position: relative;
    box-sizing: border-box;
    width: 100%;
    text-align: right; /* Align the values to the right */
  }

  .generic-table-6col .table-row > div:not(.table-header)::before {
    content: attr(data-label) ": ";
    position: absolute;
    left: 10px;
    top: 8px;
    font-weight: bold;
    color: #1C2526;
    white-space: normal;
    text-align: left;
    width: 100px;
    max-width: 30%;
    box-sizing: border-box;
  }

  .generic-table-6col .table-row > div:last-child:not(.table-header) {
    border-bottom: none;
  }
}

/* Style for Sub-Category Rows */
.generic-table-6col .colspan-6 {
  background-color: #f5f5f5;
  padding: 10px;
  font-weight: bold;
  text-align: center;
  border-top: 2px solid #1C2526;
  border-bottom: 2px solid #1C2526;
}

