/* ========================================
   SHOP — Carol's Homestead
   Product grid, detail page, cart
   ======================================== */

/* ── Product Grid ────────────────────────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* ── Product Card ────────────────────────────────────────────────────────── */
.product-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

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

.product-card .card-image {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.product-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .card-image img {
    transform: scale(1.08);
}

.product-card .card-body {
    padding: 1.5rem;
}

.product-card .card-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.product-card .card-text {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── Stock Badge ─────────────────────────────────────────────────────────── */
.stock-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
}

.stock-badge--in {
    background: rgba(74, 124, 41, 0.9);
    color: #fff;
}

.stock-badge--low {
    background: rgba(218, 165, 32, 0.9);
    color: var(--bg-dark);
}

.stock-badge--out {
    background: rgba(139, 37, 0, 0.9);
    color: #fff;
}

/* ── Out of Stock Overlay ────────────────────────────────────────────────── */
.out-of-stock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    border-radius: var(--radius-lg);
}

.out-of-stock-overlay span {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ── Price Tag ───────────────────────────────────────────────────────────── */
.price-tag {
    font-size: 1.5rem;
    color: var(--accent);
    font-weight: 700;
    font-family: var(--font-sans);
}

.price-tag--small {
    font-size: 1.1rem;
}

.price-original {
    font-size: 0.9rem;
    color: var(--text-light);
    text-decoration: line-through;
    margin-left: 0.5rem;
}

/* ── Category Filter ─────────────────────────────────────────────────────── */
.shop-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: transparent;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

/* ════════════════════════════════════════════════════════════════════════════
   Product Detail Page
   ════════════════════════════════════════════════════════════════════════════ */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.product-detail-image {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.product-detail-image img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.product-detail-info {
    padding-top: 1rem;
}

.product-detail-info h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.product-detail-info .product-category {
    font-family: var(--font-sans);
    color: var(--text-light);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.product-detail-info .product-description {
    font-family: var(--font-body);
    line-height: 1.8;
    font-size: 1.05rem;
    color: var(--text);
    margin-bottom: 1.5rem;
}

.product-detail-info .price-tag {
    margin-bottom: 1.5rem;
    display: block;
}

.product-detail-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1.5rem;
}

/* ════════════════════════════════════════════════════════════════════════════
   Cart Page
   ════════════════════════════════════════════════════════════════════════════ */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
}

.cart-table {
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.cart-table thead {
    background: var(--bg-dark);
}

.cart-table th {
    padding: 0.85rem 1.25rem;
    text-align: left;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-on-dark);
}

.cart-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    font-size: 0.95rem;
}

.cart-table tbody tr:last-child td {
    border-bottom: none;
}

.cart-table tbody tr:hover {
    background: rgba(45, 80, 22, 0.03);
}

.cart-item-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-item-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.cart-item-name {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text);
}

.cart-item-price {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--text);
}

.cart-item-subtotal {
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--primary-dark);
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-remove:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

/* ── Quantity Controls ───────────────────────────────────────────────────── */
.qty-control {
    display: inline-flex;
    align-items: center;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.qty-control button {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.qty-control button:hover {
    background: var(--primary);
    color: #fff;
}

.qty-control input {
    width: 50px;
    text-align: center;
    border: none;
    border-left: 2px solid var(--border);
    border-right: 2px solid var(--border);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.4rem 0;
    -moz-appearance: textfield;
    color: var(--text);
    background: transparent;
}

.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-control input:focus {
    outline: none;
    box-shadow: none;
}

/* ── Cart Summary ────────────────────────────────────────────────────────── */
.cart-summary {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 6rem;
}

.cart-summary h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-family: var(--font-sans);
    font-size: 0.95rem;
}

.cart-summary-row--total {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 2px solid var(--border-light);
}

.cart-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    font-family: var(--font-heading);
}

.cart-summary .btn {
    width: 100%;
    margin-top: 1.5rem;
    justify-content: center;
}

.cart-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.cart-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.cart-empty h3 {
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
}

.cart-empty p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}
