/**
 * Shopping Cart Styles
 *
 * Styling for WooCommerce shopping cart integration
 * including product widgets, cart page, and mini cart widget
 *
 * @package StraightShotzUSA
 * @since 1.0.0
 */

/* ==========================================================================
   Product Widgets (Homepage)
   ========================================================================== */

.product-widget {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.product-widget:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-widget .product-info {
    margin-bottom: 15px;
}

.product-widget .product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #28a745;
    margin: 10px 0;
}

.product-widget .add-to-cart {
    width: 100%;
    font-size: 1.1rem;
    padding: 12px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.product-widget .add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.product-widget.product-unavailable {
    background: #f5f5f5;
    opacity: 0.7;
}

/* ==========================================================================
   Purchase Options Section (Putter Page)
   ========================================================================== */

.purchase-options {
    background: #f8f9fa;
    padding: 40px 20px;
    margin: 0 -15px;
}

.purchase-options h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.purchase-options > .col-12 p.text-muted {
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.product-option-wrapper {
    background: #fff;
    padding: 30px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-option-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.product-option-wrapper h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.product-option-wrapper > p.text-muted {
    font-size: 0.95rem;
    margin-bottom: 25px;
    min-height: 40px;
}

/* Adjust product widget styling within purchase options */
.purchase-options .product-widget {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

/* Mobile responsive for purchase options */
@media (max-width: 768px) {
    .purchase-options {
        padding: 30px 15px;
    }

    .purchase-options h2 {
        font-size: 1.6rem;
    }

    .product-option-wrapper {
        padding: 25px 15px;
        margin-bottom: 20px;
    }

    .product-option-wrapper h3 {
        font-size: 1.3rem;
    }
}

/* ==========================================================================
   Mini Cart Widget (Header)
   ========================================================================== */

.mini-cart {
    position: relative;
    display: inline-block;
}

.mini-cart .cart-link {
    display: flex;
    align-items: center;
    color: #333;
    text-decoration: none;
    font-size: 1.2rem;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.mini-cart .cart-link:hover {
    background: #f0f0f0;
    color: #000;
    text-decoration: none;
}

.mini-cart .fa-shopping-cart {
    font-size: 1.5rem;
    margin-right: 8px;
}

.mini-cart .cart-count {
    position: relative;
    top: -2px;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 50%;
    min-width: 24px;
    text-align: center;
}

.mini-cart .cart-total {
    font-weight: bold;
    font-size: 1.1rem;
    color: #28a745;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .mini-cart .cart-link {
        font-size: 1rem;
        padding: 5px 10px;
    }

    .mini-cart .fa-shopping-cart {
        font-size: 1.3rem;
    }

    .mini-cart .cart-total {
        font-size: 0.95rem;
    }
}

/* ==========================================================================
   Cart Page
   ========================================================================== */

.cart-content {
    padding: 30px 15px;
}

/* Empty Cart Message */
.empty-cart-message {
    padding: 60px 20px;
}

.empty-cart-message h3 {
    color: #666;
    margin: 20px 0 10px;
}

.empty-cart-message .text-muted {
    font-size: 1.1rem;
}

/* Cart Items Table */
.cart-items-table {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cart-items-table table {
    margin-bottom: 20px;
}

.cart-items-table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    padding: 15px 10px;
}

.cart-items-table tbody tr {
    transition: background 0.2s ease;
}

.cart-items-table tbody tr:hover {
    background: #f8f9fa;
}

.cart-items-table tbody td {
    padding: 15px 10px;
    vertical-align: middle;
}

/* Cart Item Product Display */
.cart-item-product {
    display: flex;
    align-items: center;
}

.cart-item-image {
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.cart-item-details strong {
    font-size: 1.1rem;
    color: #333;
}

/* Quantity Controls */
.quantity-control {
    display: inline-block;
}

.quantity-control .input-group {
    width: 140px;
}

.quantity-control .form-control {
    border-left: 0;
    border-right: 0;
}

.quantity-control .btn {
    padding: 6px 12px;
}

.quantity-control .fa-plus,
.quantity-control .fa-minus {
    font-size: 0.9rem;
}

/* Price Display */
.item-price {
    font-size: 1.1rem;
    color: #666;
}

.item-total {
    font-size: 1.2rem;
    color: #28a745;
}

/* Remove Button */
.remove-from-cart {
    padding: 8px 12px;
}

/* Cart Actions */
.cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   Cart Totals Sidebar
   ========================================================================== */

.cart-totals-sidebar {
    position: sticky;
    top: 20px;
}

.cart-totals-sidebar .card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cart-totals-sidebar .card-header {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 15px 20px;
}

.cart-totals-sidebar .card-header h4 {
    font-weight: 600;
    color: #333;
}

.cart-totals-sidebar .card-body {
    padding: 20px;
}

.cart-total-row {
    padding: 8px 0;
    font-size: 1.1rem;
}

.cart-total-row hr {
    margin: 15px 0;
}

.cart-total-row h5 {
    font-weight: 600;
}

.checkout-button {
    font-size: 1.2rem;
    padding: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.checkout-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.cart-info .alert {
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* ==========================================================================
   Alert Messages
   ========================================================================== */

.cart-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 500px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cart-alert .fas {
    margin-right: 8px;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.add-to-cart:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Mobile Responsive Styles
   ========================================================================== */

@media (max-width: 992px) {
    .cart-totals-sidebar {
        position: static;
        margin-top: 30px;
    }
}

@media (max-width: 768px) {
    /* Stack table on mobile */
    .cart-items-table table,
    .cart-items-table thead,
    .cart-items-table tbody,
    .cart-items-table th,
    .cart-items-table td,
    .cart-items-table tr {
        display: block;
    }

    .cart-items-table thead {
        display: none;
    }

    .cart-items-table tr {
        margin-bottom: 20px;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 10px;
    }

    .cart-items-table td {
        text-align: right;
        padding: 10px;
        position: relative;
        padding-left: 50%;
    }

    .cart-items-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        font-weight: bold;
        text-align: left;
    }

    .cart-item-product {
        flex-direction: column;
        text-align: left;
    }

    .cart-item-image {
        margin: 0 auto 10px;
    }

    .quantity-control .input-group {
        width: 100%;
    }

    .cart-alert {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

@media (max-width: 576px) {
    .product-widget {
        margin-bottom: 20px;
    }

    .cart-content {
        padding: 20px 10px;
    }

    .cart-items-table {
        padding: 10px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .mini-cart,
    .add-to-cart,
    .remove-from-cart,
    .quantity-control,
    .cart-actions,
    .checkout-button {
        display: none;
    }

    .cart-items-table,
    .cart-totals-sidebar {
        box-shadow: none;
    }
}
