/* 2025 Holiday Gift Guide - FINAL v3.9 (Uniform Grid/Card Padding Fix) */
.hg-guide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 1rem; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Styles the widget container ONLY when it's in a sidebar */
.sidebar .widget {
    background: white;
    border: 2px solid #c00; /* Red border */
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px; /* Ensure spacing below the boxed widget */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); 
}

/* Styles the standard WordPress widget title bar for this boxed widget */
.sidebar .widget .widget-title {
    color: #c00; /* Red text */
    background: none; /* Clear background */
    text-align: center; 
    padding: 0 0 10px 0; /* Only bottom padding */
    margin: 0 0 15px 0; 
    font-size: 1.4rem; 
    font-weight: 700;
    /* Add a subtle line below the title inside the box */
    border-bottom: 1px solid #eee; 
}

/* ARCHIVE GRID */
.hg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Add a responsive style for shortcode when column count is set to 2 */
.hg-grid[data-columns="2"] {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}

.hg-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); 
    text-align: center;
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    /* FIX: Re-add vertical padding to the card, ensuring space at the bottom */
    padding: 0 10px 15px; /* 0 top, 10px horizontal, 15px bottom */
}

.hg-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.2); 
}

/* FIX: Grid Title Red, fixed 2-line height (4.2rem), and ensure link color is preserved */
.hg-card h3 {
    margin: 0;
    /* Ensure title area is fixed height to prevent card jump */
    min-height: 4.2rem;
    display: flex; /* Use flex to vertically center content */
    align-items: center;
    justify-content: center;
    padding: 1.2rem 0.5rem 0.8rem;
    font-size: 1.3rem; 
    font-weight: 600;
    order: -1;
    line-height: 1.25;
}

.hg-card h3 a {
    color: #a00; /* Make the title link red */
    text-decoration: none;
    transition: color 0.2s;
}
.hg-card h3 a:hover {
    color: #c00; /* Darker red on hover */
    text-decoration: none;
}

/* Price Below Title */
.hg-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #388e3c; /* Green color for price */
    margin: 0.5rem 0;
    order: -1;
}

/* FIX: IMAGE WRAPPER (Uniform Card Height & Click-to-Shop Fix) */
.hg-card .thumb-wrap {
    /* FIX: Set a fixed height to enforce uniform card height for the grid */
    height: 250px;
    overflow: hidden;
    flex: 0 0 250px; /* Fix flex-item size to be the image height */
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.5rem 0; 
    background: white; 
}

/* FIX: IMAGE INSIDE WRAPPER (Visibility Fix) */
.hg-card img {
    max-width: 100%;
    /* FIX: Constrain to the new fixed height of the thumb-wrap */
    max-height: 100%; 
    width: auto;
    height: auto;
    /* FIX: Ensure image fits inside the container without cropping */
    object-fit: contain; 
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

/* Image Link */
.hg-image-link {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.hg-image-link:hover img {
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

/* FIX: Click to Shop Cue for Grid Image (Fixes issue #1) */
.hg-image-link .hg-click-cue {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
    /* Make sure the cue doesn't interfere with clicks on the link itself */
    pointer-events: none; 
}
.hg-image-link:hover .hg-click-cue {
    opacity: 1;
}

/* Excerpt */
.hg-card p {
    flex-grow: 1; /* Pushes the button to the bottom */
    padding: 0 1.2rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: #555;
}

/* Buy Button (for grid/shortcode) */
.hg-buy {
    background: #d32f2f;
    color: white;
    padding: 0.9rem 1.8rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    margin: 0 0 1.2rem;
    font-size: 1rem;
    transition: background 0.2s;
}

.hg-buy:hover {
    background: #b71c1c;
    text-decoration: none;
}

/* FIX: Category/Tag Display in Card (Fixes issue #2) */
.hg-categories {
    margin: 0.8rem 0 1.5rem;
    min-height: 2.2rem; /* Give it space even if empty */
    line-height: 1.4;
}
/* For single item view, add space between content and terms */
.hg-single-categories {
    margin-bottom: 2rem;
}

.hg-category-tag, .hg-tag-tag {
    display: inline-block;
    padding: 3px 8px;
    margin: 3px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: opacity 0.2s;
}
.hg-category-tag {
    background-color: #fce4ec; /* Light pink/red background */
    color: #c00; /* Red text */
    border: 1px solid #f8bbd0;
}
.hg-category-tag:hover {
    opacity: 0.8;
    text-decoration: none;
}
.hg-tag-tag {
    background-color: #e3f2fd; /* Light blue background */
    color: #1976d2; /* Blue text */
    border: 1px solid #bbdefb;
}
.hg-tag-tag:hover {
    opacity: 0.8;
    text-decoration: none;
}


/* BREADCRUMBS */
.hg-breadcrumbs {
    font-size: 0.9rem;
    color: #666;
    margin: 1rem 0 1.5rem;
    text-align: center;
}

.hg-breadcrumbs a {
    color: #c00;
    text-decoration: underline;
}

.hg-breadcrumbs a:hover {
    text-decoration: none;
}

.hg-breadcrumbs span {
    margin: 0 8px;
    color: #aaa;
}

/* SINGLE ITEM PAGE */
.hg-single {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* FIX: Single Item Title (Fixes issue #3) */
.hg-single h1.entry-title {
    color: #c00; /* Red color for single item title */
    font-size: 2.5rem; 
    margin-top: 0;
}

/* Responsive adjustment for single item */
@media (max-width: 768px) {
    .hg-single {
        flex-direction: column;
    }
}


/* Single Item Image */
.hg-single .thumb-wrap {
    flex: 0 0 45%;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    /* Reset padding from .hg-card */
    padding: 0; 
}

.hg-single .thumb-wrap img {
    /* Image inside single view */
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

/* Click to Shop Cue for Single Image */
.hg-single .hg-click-cue {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.hg-single .hg-image-link:hover .hg-click-cue {
    opacity: 1;
}


.hg-single .content {
    flex: 1;
    min-width: 300px;
}

/* Make Share more obvious (per previous request) */
.hg-share-wrap {
    text-align: center;
    margin: 1rem 0 2rem;
    padding: 15px; 
    border: 2px solid #ccc; 
    border-radius: 8px;
    background: #f9f9f9;
}
.hg-social-link {
    color: #d32f2f;
    text-decoration: none;
    font-weight: 500;
    margin: 0 8px;
    transition: color 0.2s;
}
.hg-social-link:hover {
    color: #a00;
    text-decoration: underline;
}

/* Single Item Price */
.hg-single-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: #388e3c; /* Green color for price */
    margin: 0.5rem 0 1.5rem;
    padding: 10px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* Full Width Buy Button (for single page) */
.hg-buy-full {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 2rem auto;
    text-align: center;
    padding: 1.2rem;
    font-size: 1.3rem;
    background: #d32f2f;
    color: white;
    border-radius: 12px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.2s;
    box-shadow: 0 4px 10px rgba(211, 47, 47, 0.3);
}

.hg-buy-full:hover {
    background: #b71c1c;
    box-shadow: 0 4px 15px rgba(183, 28, 28, 0.5);
    text-decoration: none;
}

/* Disclosure */
.hg-disclosure {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    margin: 2rem 0 0;
}


/* FIX: WIDGET STYLES (Fixes issue #5) */
.hg-widget-rotator {
    min-height: 200px; /* Ensure space during rotation */
    position: relative;
    overflow: hidden;
}

.hg-widget-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0; /* Default to hidden */
    /* Add transition for fading between items */
    transition: opacity 0.5s ease-in-out; 
}

/* Ensure the first item is visible by default (CSS fallback before JS runs) */
.hg-widget-item[data-index="0"] {
    position: relative; /* Take up space */
    opacity: 1; /* Default to visible */
}

/* Widget Title Link */
.hg-widget-item h4 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.4;
}

.hg-widget-item h4 a {
    color: #c00;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.hg-widget-item h4 a:hover {
    color: #a00;
    text-decoration: underline;
}

/* Widget Price */
.hg-widget-item .hg-price {
    font-size: 1.1rem;
    margin: 0.3rem 0;
}

/* Widget Image Container/Link (Fixes sizing in widget) */
.hg-widget-image-link {
    display: block;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    max-width: 90%; /* Keep image slightly smaller in widget */
    /* FIX: Set a uniform height for widget images too */
    height: 180px; 
    margin: 0.5rem auto 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hg-widget-image-link img {
    /* FIX: Constrain to the new fixed height of the link container */
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* Ensure image is fully visible */
    display: block;
    margin: 0 auto;
    border-radius: 10px;
}

/* Click to Shop Cue for Widget Image */
.hg-widget-image-link .hg-click-cue {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    opacity: 0; 
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.hg-widget-image-link:hover .hg-click-cue {
    opacity: 1; 
}

/* Widget Buy Button */
.hg-widget-buy-wrap {
    margin-top: 0.8rem; 
    text-align: center;
}

.hg-widget-buy {
    background: #d32f2f;
    color: white;
    padding: 0.6rem 1.2rem; 
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.hg-widget-buy:hover {
    background: #b71c1c;
    text-decoration: none;
}