/**
 * Theme Name: Storefront for Larb
 * Template:   storefront
 * 
 */

/* Hide any fallback page list menus that might appear */
/* This targets page lists that WordPress auto-generates when no menu is assigned */
.widget_pages ul li.page_item {
    display: none !important;
}

/* Ensure mobile menu (handheld-navigation) works properly */
/* The handheld-navigation class is used by Storefront for mobile menu */
.handheld-navigation ul {
    display: block !important;
    visibility: visible !important;
    position: static !important;
}

/* When mobile menu is toggled open, ensure it displays */
.main-navigation.toggled ul {
    display: block !important;
    visibility: visible !important;
}

/* Add spacing between header and content */
.site-content {
    padding-top: 40px !important;
}

#main {
    margin-top: 30px !important;
}

/* Ensure spacing on all page types */
.woocommerce .site-content, 
.single .site-content, 
.page .site-content, 
.archive .site-content {
    padding-top: 40px !important;
}

/* Responsive spacing for mobile */
@media (max-width: 767px) {
    .site-content, 
    .woocommerce .site-content, 
    .single .site-content, 
    .page .site-content, 
    .archive .site-content {
        padding-top: 25px !important;
    }
    
    #main {
        margin-top: 20px !important;
    }
}

/* Restaurant Branding Section - For the LARB name and tagline */
.restaurant-branding {
    text-align: center;
    margin: 40px 0;
}

.restaurant-name {
    font-size: 3.5em;
    font-weight: 700;
    letter-spacing: 0.15em;
    margin: 0 0 10px 0;
    line-height: 1.2;
    color: #333;
}

.restaurant-tagline {
    font-size: 1.8em;
    font-weight: 300;
    font-style: italic;
    margin: 0;
    color: #666;
}

/* Responsive adjustments for restaurant branding */
@media (max-width: 767px) {
    .restaurant-name {
        font-size: 2.5em;
    }
    
    .restaurant-tagline {
        font-size: 1.4em;
    }
}

/* Menu Notice Styles */
.menu-notice-permanent {
    text-align: center;
    font-size: 1.1em;
    color: #333;
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 4px;
}

.menu-notice-temporary {
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
    color: #d32f2f;
    margin: 20px 0;
    padding: 15px;
    background-color: #fff3f3;
    border: 2px solid #ffdddd;
    border-radius: 4px;
}

/* Ensure links in temporary notices have sufficient contrast */
.menu-notice-temporary a {
    color: #b71c1c; /* Darker red for better contrast */
    text-decoration: underline;
}

.menu-notice-temporary a:hover,
.menu-notice-temporary a:focus {
    color: #8b0000; /* Even darker on hover/focus */
    text-decoration: none;
}

/* For inline temporary notices without background */
.menu-notice-temporary-inline {
    text-align: center;
    font-size: 1.3em;
    font-weight: 600;
    color: #d32f2f;
    margin: 20px 0;
}

/* Banner title styling - replaces H4 for accessibility */
.banner-title {
    display: block;
    text-align: center;
    font-size: 2.2em;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 20px 0;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Responsive adjustment for banner title */
@media (max-width: 767px) {
    .banner-title {
        font-size: 1.8em;
    }
}

/* Custom Logo and Site Branding Styling */
.site-branding {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 20px !important; /* Comfortable spacing between logo and text */
}

.site-logo {
    flex-shrink: 0;
}

/* Logo link container - fits the image size */
.site-logo a.custom-logo-link {
    width: auto !important;
    display: inline-block !important;
}

/* Logo size control */
.site-logo img.custom-logo,
.site-header .site-branding img {
    height: 70px !important; /* Reduced from 100px for less header height */
    width: auto !important;
    max-width: 120px !important;
}

.site-text {
    flex-grow: 1;
}

.site-title {
    margin: 0;
    font-size: 1.8em;
}

.site-title a {
    text-decoration: none;
    color: inherit;
}

.site-description {
    margin: 5px 0 0 0;
    font-size: 0.9em;
    opacity: 0.8;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .site-branding {
        flex-direction: row !important;
        justify-content: flex-start !important;
        text-align: left !important;
        gap: 15px !important; /* Comfortable mobile spacing */
    }
    
    .site-logo img.custom-logo,
    .site-header .site-branding img {
        height: 55px !important; /* Smaller on mobile */
        max-width: 90px !important;
    }
}

/* Menu card cover styling */
.menu-card-cover {
    overflow: hidden;
    border-radius: 0px;
    position: relative;
}

.menu-card-cover .wp-block-cover__inner-container {
    width: 100%;
    padding: 0 !important;
    margin: 0;
}

/* Make button wrapper span full width */
.menu-button-wrapper {
    width: 100%;
    margin: 0 !important;
}

.menu-button-wrapper .wp-block-button {
    width: 100%;
    margin: 0;
}

/* Style the menu buttons to span full width */
.menu-button .wp-block-button__link {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8) !important;
    color: #ffffff !important;
    font-size: 22px !important;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: none;
    border-radius: 0 !important;
    transition: background-color 0.3s ease;
    padding: 12px 20px !important;
    display: block;
    text-align: center;
}

/* Hover effect for menu buttons */
.menu-button .wp-block-button__link:hover {
    background-color: rgba(0, 0, 0, 0.95) !important;
    transform: none;
}

/* Focus state for accessibility */
.menu-button .wp-block-button__link:focus {
    outline: 2px solid #fff;
    outline-offset: -2px;
}


/* Review Section - Make entire area clickable */
.review-section {
    position: relative;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.review-section:hover {
    background-color: #efefef !important;
}

/* Style the review image */
.review-image {
    margin: 0 !important;
    max-width: 400px;
}

.review-image img {
    height: auto;
    max-height: 120px;
    width: auto;
    transition: opacity 0.3s ease;
}

.review-image img:hover {
    opacity: 0.85;
}

/* Make the image link expand to fill the entire section */
.review-image a {
    position: static;
}

.review-image a::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Ensure text remains accessible */
.review-section p {
    position: relative;
    z-index: 2;
    pointer-events: none;
}

/* Focus state for keyboard navigation */
.review-image a:focus {
    outline: 3px solid #0073aa;
    outline-offset: 5px;
    border-radius: 4px;
}

/* Ensure image is responsive */
@media (max-width: 768px) {
    .review-image {
        max-width: 100%;
    }
    
    .review-image img {
        max-height: 80px;
    }
}

/* Related Products - 4 columns layout */
.related.products ul.products {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
}

.related.products ul.products li.product {
    width: 23% !important;
    margin: 0 0 2em 0 !important;
    flex: 0 0 23% !important;
}

/* Make related product images smaller */
.related.products ul.products li.product img {
    height: auto !important;
    max-height: 180px !important;
    width: 100% !important;
    object-fit: cover !important;
}

/* Responsive - 2 columns on tablets */
@media (max-width: 768px) {
    .related.products ul.products li.product {
        width: 48% !important;
        flex: 0 0 48% !important;
    }
}

/* Responsive - 1 column on mobile */
@media (max-width: 480px) {
    .related.products ul.products li.product {
        width: 100% !important;
        flex: 0 0 100% !important;
    }
}

/* Hide product navigation arrows on sides of screen */
.storefront-product-pagination,
.product-navigation,
.storefront-sticky-add-to-cart,
nav.woocommerce-product-pagination,
.single-product div.product .storefront-product-pagination,
.storefront-product-pagination a[rel="next"],
.storefront-product-pagination a[rel="prev"] {
    display: none !important;
}

/* Also hide any floating side navigation */
.product-nav-previous,
.product-nav-next {
    display: none !important;
}

/* Mobile footer bar custom icons */
.storefront-handheld-footer-bar ul li.phone a:before {
    content: "\f095";
    font-family: "Font Awesome 5 Free", FontAwesome;
    font-weight: 900;
    margin-right: 0.5em;
}

.storefront-handheld-footer-bar ul li.maps a:before {
    content: "\f3c5";
    font-family: "Font Awesome 5 Free", FontAwesome;
    font-weight: 900;
    margin-right: 0.5em;
}

/* Screen reader text - visible to screen readers but not visually */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    word-wrap: normal !important;
}

/* When screen reader text is focused (for keyboard users) */
.screen-reader-text:focus {
    background-color: #ffffff;
    clip: auto !important;
    clip-path: none;
    color: #000000; /* Higher contrast for better accessibility */
    display: block;
    font-size: 1em;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
    border: 2px solid #0073aa; /* Blue border for better visibility */
    border-radius: 4px;
}

/* WooCommerce Notice Accessibility - High Contrast Colors Only */
/* Error notices (red banner) */
.woocommerce-notices-wrapper .woocommerce-error,
ul.woocommerce-error {
    background-color: #d32f2f !important; /* Dark red background */
    color: #ffffff !important; /* White text for high contrast */
    border-color: #b71c1c !important; /* Darker red border */
}

.woocommerce-error li {
    color: #ffffff !important; /* Ensure list items are white */
}

/* Info notices (blue banner) */
.woocommerce-info,
.cart-empty.woocommerce-info,
.wc-empty-cart-message .woocommerce-info {
    background-color: #1565c0 !important; /* Dark blue background */
    color: #ffffff !important; /* White text for high contrast */
    border-color: #0d47a1 !important; /* Darker blue border */
}

/* Success notices (green banner) */
.woocommerce-message {
    background-color: #2e7d32 !important; /* Dark green background */
    color: #ffffff !important; /* White text for high contrast */
    border-color: #1b5e20 !important; /* Darker green border */
}

/* Ensure any links in notices have sufficient contrast */
.woocommerce-error a,
.woocommerce-info a,
.woocommerce-message a {
    color: #ffffff !important;
}

.woocommerce-error a:hover,
.woocommerce-error a:focus,
.woocommerce-info a:hover,
.woocommerce-info a:focus,
.woocommerce-message a:hover,
.woocommerce-message a:focus {
    color: #f0f0f0 !important;
}

/* Default no products message */
.no-products-message {
    text-align: center;
    padding: 30px 20px;
    background-color: #f8f8f8;
    border-radius: 4px;
    margin: 20px 0;
}

.no-products-message p {
    color: #666;
    margin: 0;
    font-size: 1.1em;
}
