/**
 * Product Page Styles
 *
 * @package Longhorn_Outdoors
 */

/* ==========================================================================
   Product Single Layout
   ========================================================================== */
.product-single {
    padding: var(--lh-spacing-lg) 0 var(--lh-spacing-xxl);
}

.product-single .entry-header {
    margin-bottom: var(--lh-spacing-lg);
}

.product-single .entry-title {
    font-size: 2rem;
    margin-bottom: var(--lh-spacing-sm);
    color: var(--lh-black);
}

/* Main Product Grid */
.product-single-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--lh-spacing-xl);
    align-items: start;
}

@media (max-width: 992px) {
    .product-single-grid {
        grid-template-columns: 1fr;
        gap: var(--lh-spacing-lg);
    }
}

/* ==========================================================================
   Product Media Section
   ========================================================================== */
.product-media {
    position: sticky;
    top: calc(var(--lh-header-height) + var(--lh-spacing-lg));
}

.product-featured-image {
    width: 100%;
    background: var(--lh-off-white);
    border-radius: var(--lh-radius-md);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--lh-transition-normal);
}

.product-featured-image:hover img {
    transform: scale(1.03);
}

/* Placeholder for products without images */
.product-image-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, var(--lh-off-white) 0%, #e0dcd8 100%);
    border-radius: var(--lh-radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--lh-gray);
}

.product-image-placeholder svg {
    width: 80px;
    height: 80px;
    opacity: 0.5;
    margin-bottom: var(--lh-spacing-md);
}

.product-image-placeholder span {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Product Gallery */
.product-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--lh-spacing-sm);
    margin-top: var(--lh-spacing-md);
}

.gallery-item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--lh-radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--lh-transition-fast);
}

.gallery-item:hover,
.gallery-item.active {
    border-color: var(--lh-primary);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Video */
.product-video {
    margin-top: var(--lh-spacing-lg);
    border-radius: var(--lh-radius-md);
    overflow: hidden;
}

.responsive-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: var(--lh-black);
}

.responsive-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================================================
   Product Details Section
   ========================================================================== */
.product-details {
    max-width: 560px;
}

.product-short-desc {
    font-size: 1.1rem;
    color: var(--lh-gray);
    line-height: 1.7;
    margin-bottom: var(--lh-spacing-lg);
}

/* ==========================================================================
   Pricing Section
   ========================================================================== */
.product-pricing-section {
    background: linear-gradient(135deg, #f8f6f3 0%, #f0ebe5 100%);
    padding: var(--lh-spacing-lg);
    border-radius: var(--lh-radius-md);
    margin-bottom: var(--lh-spacing-lg);
    border: 1px solid var(--lh-light-gray);
}

.pricing-label {
    font-size: 0.75rem;
    color: var(--lh-gray);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: var(--lh-spacing-xs);
}

.price-display {
    margin: var(--lh-spacing-sm) 0;
}

.price-display .current-price,
.price-display .sale-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--lh-primary);
    font-family: var(--lh-font-heading);
}

.price-display.sale {
    display: flex;
    align-items: center;
    gap: var(--lh-spacing-md);
    flex-wrap: wrap;
}

.price-display .regular-price.strikethrough {
    font-size: 1.5rem;
    color: var(--lh-gray);
    text-decoration: line-through;
    font-weight: 400;
}

.savings-badge {
    background: var(--lh-success);
    color: var(--lh-white);
    padding: 6px 14px;
    border-radius: var(--lh-radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Dealer Tier Pricing */
.dealer-tier-pricing {
    margin-top: var(--lh-spacing-lg);
    padding-top: var(--lh-spacing-md);
    border-top: 1px dashed var(--lh-light-gray);
}

.dealer-tier-pricing h4 {
    margin: 0 0 var(--lh-spacing-md);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--lh-dark-gray);
    font-family: var(--lh-font-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tier-pricing-table {
    width: 100%;
    border-collapse: collapse;
}

.tier-pricing-table tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.tier-pricing-table tr:last-child {
    border-bottom: none;
}

.tier-pricing-table tr.current-tier {
    background: rgba(139, 69, 19, 0.1);
    border-radius: var(--lh-radius-sm);
}

.tier-pricing-table tr.current-tier td:first-child {
    border-radius: var(--lh-radius-sm) 0 0 var(--lh-radius-sm);
}

.tier-pricing-table tr.current-tier td:last-child {
    border-radius: 0 var(--lh-radius-sm) var(--lh-radius-sm) 0;
}

.tier-pricing-table td {
    padding: var(--lh-spacing-sm) var(--lh-spacing-sm);
    font-size: 0.95rem;
}

.tier-pricing-table td.price {
    text-align: right;
    font-weight: 700;
    color: var(--lh-primary);
}

/* Stock Status */
.stock-status-display {
    margin-top: var(--lh-spacing-md);
    padding-top: var(--lh-spacing-md);
    border-top: 1px solid var(--lh-light-gray);
}

.stock-status-display .status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--lh-radius-sm);
}

.stock-status-display .status.in-stock {
    background: rgba(40, 167, 69, 0.1);
    color: var(--lh-success);
}

.stock-status-display .status.low-stock {
    background: rgba(255, 193, 7, 0.15);
    color: #b8860b;
}

.stock-status-display .status.out-of-stock {
    background: rgba(220, 53, 69, 0.1);
    color: var(--lh-error);
}

/* ==========================================================================
   Product Meta
   ========================================================================== */
.product-meta {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--lh-spacing-lg);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--lh-spacing-sm);
}

.product-meta li {
    font-size: 0.9rem;
    color: var(--lh-gray);
    padding: var(--lh-spacing-sm);
    background: var(--lh-off-white);
    border-radius: var(--lh-radius-sm);
}

.product-meta li strong {
    color: var(--lh-dark-gray);
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

@media (max-width: 480px) {
    .product-meta {
        grid-template-columns: 1fr;
    }
}

/* Product Content */
.product-details .entry-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--lh-dark-gray);
    margin-bottom: var(--lh-spacing-lg);
}

.product-details .entry-content h2,
.product-details .entry-content h3,
.product-details .entry-content h4 {
    margin-top: var(--lh-spacing-lg);
    margin-bottom: var(--lh-spacing-sm);
}

.product-details .entry-content ul,
.product-details .entry-content ol {
    margin-bottom: var(--lh-spacing-md);
}

.product-details .entry-content li {
    margin-bottom: var(--lh-spacing-xs);
}

/* ==========================================================================
   Product Actions
   ========================================================================== */
.product-actions {
    background: var(--lh-white);
    border: 2px solid var(--lh-primary);
    border-radius: var(--lh-radius-md);
    padding: var(--lh-spacing-lg);
    margin-bottom: var(--lh-spacing-lg);
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: var(--lh-spacing-md);
    margin-bottom: var(--lh-spacing-md);
}

.quantity-selector label {
    font-weight: 600;
    color: var(--lh-dark-gray);
    white-space: nowrap;
}

.quantity-selector .qty-input {
    width: 100px;
    padding: 10px 14px;
    border: 2px solid var(--lh-light-gray);
    border-radius: var(--lh-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: border-color var(--lh-transition-fast);
}

.quantity-selector .qty-input:focus {
    outline: none;
    border-color: var(--lh-primary);
}

.add-to-cart-btn {
    width: 100%;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--lh-primary);
    color: var(--lh-white);
    border: none;
    border-radius: var(--lh-radius-sm);
    cursor: pointer;
    transition: all var(--lh-transition-normal);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.add-to-cart-btn:hover {
    background: var(--lh-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.3);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

.add-to-cart-btn:disabled {
    background: var(--lh-gray);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Secondary Actions */
.secondary-actions {
    display: flex;
    gap: var(--lh-spacing-sm);
    margin-top: var(--lh-spacing-md);
    justify-content: center;
    padding-top: var(--lh-spacing-md);
    border-top: 1px solid var(--lh-light-gray);
}

.secondary-actions .btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.85rem;
}

/* ==========================================================================
   CTA Buttons
   ========================================================================== */
.product-cta-buttons {
    display: flex;
    gap: var(--lh-spacing-md);
    margin-bottom: var(--lh-spacing-lg);
}

.product-cta-buttons .btn {
    flex: 1;
    text-align: center;
    padding: 14px 20px;
}

@media (max-width: 480px) {
    .product-cta-buttons {
        flex-direction: column;
    }
}

/* ==========================================================================
   Share Buttons (Product)
   ========================================================================== */
.product-share {
    display: flex;
    align-items: center;
    gap: var(--lh-spacing-md);
    padding-top: var(--lh-spacing-md);
    border-top: 1px solid var(--lh-light-gray);
}

.product-share .share-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--lh-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   Product Cards (Grid/Archive)
   ========================================================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--lh-spacing-lg);
}

.product-card {
    background: var(--lh-white);
    border-radius: var(--lh-radius-md);
    overflow: hidden;
    box-shadow: var(--lh-shadow-sm);
    transition: all var(--lh-transition-normal);
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--lh-shadow-lg);
}

.product-card__image {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--lh-off-white);
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--lh-transition-normal);
}

.product-card:hover .product-card__image img {
    transform: scale(1.05);
}

.product-card__badge {
    position: absolute;
    top: var(--lh-spacing-sm);
    left: var(--lh-spacing-sm);
    padding: 4px 10px;
    background: var(--lh-error);
    color: var(--lh-white);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: var(--lh-radius-sm);
}

.product-card__badge--sale {
    background: var(--lh-success);
}

.product-card__badge--new {
    background: var(--lh-info);
}

.product-card__body {
    padding: var(--lh-spacing-md);
}

.product-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--lh-spacing-xs);
    color: var(--lh-dark-gray);
}

.product-card__title a {
    color: inherit;
    text-decoration: none;
}

.product-card__title a:hover {
    color: var(--lh-primary);
}

.product-card__sku {
    font-size: 0.75rem;
    color: var(--lh-gray);
    margin-bottom: var(--lh-spacing-sm);
}

.product-card__price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--lh-primary);
}

.product-card__price .original {
    font-size: 0.9rem;
    color: var(--lh-gray);
    text-decoration: line-through;
    margin-right: var(--lh-spacing-xs);
}

.product-card__stock {
    font-size: 0.8rem;
    margin-top: var(--lh-spacing-xs);
}

.product-card__stock.in-stock {
    color: var(--lh-success);
}

.product-card__stock.out-of-stock {
    color: var(--lh-error);
}

.product-card__actions {
    display: flex;
    gap: var(--lh-spacing-xs);
    margin-top: var(--lh-spacing-sm);
}

.product-card__actions .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.8rem;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 768px) {
    .product-single .entry-title {
        font-size: 1.75rem;
    }

    .product-media {
        position: static;
    }

    .price-display .current-price,
    .price-display .sale-price {
        font-size: 2rem;
    }

    .price-display .regular-price.strikethrough {
        font-size: 1.25rem;
    }

    .product-actions {
        padding: var(--lh-spacing-md);
    }

    .add-to-cart-btn {
        padding: 14px 24px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .product-single-grid {
        gap: var(--lh-spacing-md);
    }

    .product-pricing-section {
        padding: var(--lh-spacing-md);
    }

    .quantity-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .quantity-selector .qty-input {
        width: 100%;
    }
}
